设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13479|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* d" l7 J7 _. P4 b/ O/ Y$ U. @
) d) I" j, ]- h7 H7 g% r  @+ _$ j! `我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。
* z2 K1 v2 U0 l( U" c2 P$ n0 f; d7 b4 g
begin P_read arriving9 M0 S, n6 d0 N
    while 1=1 do begin
* _, G5 \3 |5 K, b2 w2 A# x6 e        read A_tote from "data.txt" with delimiter "\n"
1 q% ^4 W4 I% ]        read A_time from "data.txt" with delimiter "\n"( b4 S$ R. a6 [( o, G, A
        read A_leave from "data.txt" with delimiter "\n"1 F, [. P7 l5 J5 W  R- \5 m
        read A_picks from "data.txt" with delimiter "\n"3 a  ?& q' Z5 W) V* J) }
        set load type to A_tote
- [) D- q# {; T/ I7 H# y' W        if A_tote="tote 1" then set A_induct to 11 s1 I6 H4 O% n) k; x& l/ }
        else if A_tote="tote 2" then set A_induct to 2
* Q% a. D" L# Z8 B            else set A_induct to 3   
+ Y" v2 M/ ^: W5 S        set A_i to 0! J  x5 m& j6 N$ ]
        clone 1 load to P_induction) a1 E% G: S' f5 Y+ L; {) ~
        wait for A_time sec
* t+ V: u( ~. A, s    end
8 l% E- H& a4 U' R) ^6 Hend7 g# o' r# E, ~& p% d* y! ^

% R0 d1 H/ L1 F; }; S4 U9 G  wbegin P_induction arriving. \. B3 E8 z5 z# @! @( K
    if A_induct=1 then clone 1 load to P_pick1
: Z$ S; c- b9 r! A3 o7 x+ |    else if A_induct=2 then clone 1 load to P_pick2" B& F  E" [* I: b' j
        else clone 1 load to P_pick3
! Z! G2 q2 z; E" Y3 J3 Iend
' Y# y' G7 d1 z$ i1 R3 {
8 m9 G  U: ~$ R- T" g6 F7 y& qbegin P_pick1 arriving& }9 @  v% b) X8 e
    set A_i to 1; B6 z& n/ l5 j( _
    move into Q_induct1" i- y) S: c$ x2 X
    move into pickaisle.induct1
" N( c2 T0 F9 ]. h; ^    while A_i<=30 do begin; _+ l3 ]' X$ h) Y" E' p* B  a
        travel to pickaisle.con(A_i)
! u- T' s5 t) b( r; f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& i7 e2 T  L2 ~) r7 J: i$ k        else wait for 10 sec
8 m9 r9 S  X! A: f0 z# Z- V        if A_i=A_leave then send to die1 O& N. ~' k( r, ]; A4 j% h) ~& Y9 ~; X
        else inc A_i by 1; i, O# w# S0 i8 {3 q9 F
    end
0 t" G6 S. D) H- \# c( Mend1 e, L3 c+ m  @+ {/ U6 I( o
" T8 T! b, ]4 S7 D
begin P_pick2 arriving
0 D7 {4 v5 R7 ^) @    set A_i to 11
- J2 _2 U/ P' |4 A; i    move into Q_induct2
4 X  e5 f; Y- }! A  r$ i    move into pickaisle.induct2
. l1 u# _7 x) L! g4 J: |( @, r    while A_i<=30 do begin6 m8 ^0 J$ T; s8 ~* A& l2 I% a
        travel to pickaisle.con(A_i)2 l4 w' ^* z' Y$ e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' M+ ~/ C% m! ~  v        else wait for 10 sec
9 |' z, ]$ X- F( e. W9 t. v        if A_i=A_leave then send to die
0 I8 K! i) G  Q* H/ T+ e+ G8 ]' Q        else inc A_i by 1
- `9 B' z) P3 H) E, `    end5 U3 e. |2 p- R$ c7 a+ ?
end8 l  ], S7 ^4 m  V
& ?/ O( A" z! A4 z) R" l* T
begin P_pick3 arriving5 s5 E% x- G$ I; R9 ?
    set A_i to 21
/ e5 m* X1 u5 V% Z' ~0 W/ B    move into Q_induct3: _5 b% l  s7 [0 r  ~: S* o3 K6 k
    move into pickaisle.induct3
( F; G" ?. V! K, {* F    while A_i<=30 do begin, m' U5 n. c, i/ ~2 Y) N6 s
        travel to pickaisle.con(A_i)& C+ L* }: Q  x* r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 N4 E4 ?1 K. ^
        else wait for 10 sec! _' |: Q  d# ^. P- j6 ~
        if A_i=A_leave then send to die0 g$ l# y( l! M
        else inc A_i by 1
; d! |0 g1 t" B  Z; `& d5 G    end
9 x8 ?6 f+ ]/ F7 t1 Jend

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?. F: w6 I5 o$ Z5 Z2 I8 S
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
* f. [- Q+ n* T* g, M3 U6 V" f" v) K. g( H5 H2 e
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。  j$ P( X" ~, |! m

+ V9 S! t1 `; O$ d2 g  H另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, H8 \% H2 s* X1 ~
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;: g7 s6 s: M' u( p! u5 s
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;+ Y6 f" X2 z( F/ Q; W9 M5 |4 O; z+ f
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 z# A7 J7 A9 D2 k
begin P_induction arriving
7 P' Q# `$ q- E( [$ r9 s    clone 1 load to P_pick(A_induct)
! ^: h4 S( T  R/ U( R2 {+ a. rend最大的系1 @! S% k; i; n& X! v- k
) [6 \) N# j2 F0 g3 m6 R" i
begin P_pick arriving% W3 e* y5 W7 z7 l! [% C
    set A_i to procindex * 10 + 1; `% U1 G; E* m3 f& s. Y* R  J
    move into Q_induct(procindex)  X! ?6 `: S6 r& c" Z
    move into pickaisle.induct(procindex)! G  ?, O( h4 p. b  J8 f
    /*check the type of pickaisle.induct(i), for your last problem.*/, f9 R9 U& b1 o7 N2 H: T. w# f

# j9 D5 A& G# T2 N/ x; K' z    while A_i<=30 do begin
8 x, a5 T9 m: ^7 `+ n& U- g/ u        travel to pickaisle.con(A_i)
% z* {$ J, Z0 A0 y$ M( {  S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- P% U& I8 M) u) C4 r( r
        else wait for 10 sec
: o: q8 M# x8 u" b5 |        if A_i=A_leave then send to die6 _& n# C7 x7 f' G3 j& w
        else inc A_i by 1# G; a1 H6 w6 D1 N4 x5 R) w# K
    end
0 X% q, `4 D4 a) N8 yend7 x: P1 e$ j& Y" ~
; Y! X# p2 |3 O6 Y8 h  u
其中的procindex为整形,代表当前process的序号。2 M' U7 u: N1 L! B, u; |
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-4-17 06:20 , Processed in 0.019847 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表