设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14213|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. V+ e6 ]; S4 _
3 f9 e/ J3 J% ?; A% W我的问题是,在每个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中的数值,不知道会不会有什么不妥。; d6 S0 E6 c/ l; d0 x9 K: w" o

8 h) r( G: W& J: \5 W) jbegin P_read arriving! u" l) S+ m4 a
    while 1=1 do begin
# n& |3 P0 P6 M( `: E8 y        read A_tote from "data.txt" with delimiter "\n"
" n, _+ \8 P' @! Z/ i        read A_time from "data.txt" with delimiter "\n"
6 g/ j0 ^  U! o! ?0 s1 _# I( J% J" `        read A_leave from "data.txt" with delimiter "\n"
0 L9 _. s, A5 E        read A_picks from "data.txt" with delimiter "\n"
7 D) P; w# P5 ^9 g1 U        set load type to A_tote+ S* z( T! |7 _. I5 P
        if A_tote="tote 1" then set A_induct to 1
+ o9 i/ s6 r! h0 R        else if A_tote="tote 2" then set A_induct to 2
" l( `4 |* W: t9 O* u' G( m            else set A_induct to 3   
1 p5 S9 i3 P( N- r% C; G& j: s        set A_i to 0
; q* z3 ~" Q) e6 H2 O/ x% \& \        clone 1 load to P_induction
7 W8 o5 d) Y7 B9 X        wait for A_time sec+ H* B" v% [$ x8 M
    end9 J; b$ t' ^4 B2 y
end! i0 M2 a$ c1 q
) g6 {; i/ ?4 b- @( \& S9 B) d; X# n
begin P_induction arriving& i' j4 }" N9 d3 W6 z1 t& I
    if A_induct=1 then clone 1 load to P_pick1
7 _: c2 l" }& Q. O6 P. i4 C    else if A_induct=2 then clone 1 load to P_pick2
& e; X9 L4 T0 `* A5 d& O$ J        else clone 1 load to P_pick3/ G1 u" b% ]( Z& J' L% p) U$ o
end4 X* \1 u) ^" {: b

1 W% V+ D3 B0 c. `1 I6 t  `begin P_pick1 arriving6 }! m! p& Q, D
    set A_i to 1' Q( R! [1 N! c
    move into Q_induct1
9 c, @- g' q5 L    move into pickaisle.induct1) I2 e  q7 Q+ y" i+ H
    while A_i<=30 do begin' R! E8 `# s. R7 a3 k# U
        travel to pickaisle.con(A_i)
! u9 q% K6 T/ z  ^. N2 k' f9 C* G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ q2 {7 w, e) R
        else wait for 10 sec  ?4 A) k7 t* b" W  {+ a+ Z9 N
        if A_i=A_leave then send to die' B  b% I% d# ?; I% Y3 c$ W
        else inc A_i by 18 x9 L/ `5 a$ \3 U8 x
    end* t, n3 I! U) z1 z0 X4 `2 l) C
end
* P* r! U$ z1 I+ }9 n* z) N$ {( I3 W0 f* q5 F
begin P_pick2 arriving3 D7 |$ n8 {/ c  _' y/ o
    set A_i to 11
' O6 D' p. D: A) t. g    move into Q_induct2
, K8 S' \' E' {    move into pickaisle.induct2$ s1 p8 p$ A( a; W; E; L
    while A_i<=30 do begin- S6 `1 E) x* ?* p+ N: E% C
        travel to pickaisle.con(A_i)
) N0 H  h2 f9 S% i- |/ M) q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% [* X  b/ [4 V
        else wait for 10 sec
/ y' p6 Z% K2 |& [# J1 u        if A_i=A_leave then send to die
" d( Z5 e/ X3 d" @        else inc A_i by 1+ ]6 k  H4 t1 r3 G) n; q
    end
% Y  D9 M$ p' @' c7 fend
0 V3 l2 X) \4 C; e" d: b8 P" t7 `: h9 Z/ R( a& a* y! d6 _+ x8 P
begin P_pick3 arriving
/ c, l' |2 |( C; h- e4 U( O. z3 L    set A_i to 21
  B9 u* _8 K, a4 w, ?* F  n) Y    move into Q_induct3+ |2 T/ J8 E+ m1 a$ F' f2 D
    move into pickaisle.induct3
4 F: b/ W2 h' O) o, v1 A$ _5 g    while A_i<=30 do begin& o& @" F" \& X/ I0 j0 y, Y& p
        travel to pickaisle.con(A_i)* Y; M% Z7 p- \4 \+ F' X& i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ x/ v  r+ D1 a9 F0 E        else wait for 10 sec. U" |  y1 e1 ?; z! J: I
        if A_i=A_leave then send to die
1 [  w* W; C6 o6 J$ }8 l        else inc A_i by 1
; B" Y( K1 \2 t: [3 E    end# q' `( i5 l* U( p6 t
end

最佳答案

查看完整内容

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是个什么东东?" k# r6 W6 ~, n) D) G+ g- j
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( P7 F; \5 l) \0 [. |( m1 t& l
( K& z8 n- E; @& }: s  HAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
8 E7 M3 \' P" c$ W+ _, J8 n" e1 w, R' b( B9 T! \* L
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 E+ o! a4 I( W3 ^1 g: a. I
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' [- v1 g. H2 j5 X
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% \) p" }  b2 t) e6 J7 ~3 y. u3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 I- B0 B- k! k0 c$ z( w# y- E
begin P_induction arriving- G0 _. H( P, {) s; T5 U7 J
    clone 1 load to P_pick(A_induct)) Q0 Z6 U$ g' ]1 _; A# B4 Q& W
end最大的系5 H9 E# o% ~8 ?
) J7 ~* H, d! H5 h& y+ G
begin P_pick arriving+ p0 y! W# T3 {7 x5 f
    set A_i to procindex * 10 + 1" ^; M7 \& c3 t2 b/ x; G
    move into Q_induct(procindex). D, V0 n$ Q+ i! O5 f: c
    move into pickaisle.induct(procindex)& X/ `. C4 \/ m# a6 ^+ w" h
    /*check the type of pickaisle.induct(i), for your last problem.*/
' {/ L4 M8 |8 _8 B3 A" G; A. m$ C8 E( i
    while A_i<=30 do begin
& o/ L/ A- I4 C+ I        travel to pickaisle.con(A_i)7 f4 F& g( t0 y/ X5 Z' o' {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% N& @# D: P5 e, K. N        else wait for 10 sec0 I& t+ I8 M9 `; m4 I# e
        if A_i=A_leave then send to die
- |8 a1 k/ o4 m3 i- r' y5 }! C        else inc A_i by 1) \2 D' I+ B$ ?: T
    end
5 \5 N5 \! k" F1 @) D5 Dend
: U' {! Q8 D) V& k) J0 e
* ^) f$ _+ `1 N( J) }, ~, w1 Z0 f! Z, j其中的procindex为整形,代表当前process的序号。
# l. T. r( M( z; C# d; r6 Xstation和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-6-21 11:28 , Processed in 3.071964 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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