设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15196|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ p! i4 ]0 ^, J% F: z2 ^% |7 g9 E
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! F1 `1 g: g8 @- ~0 X! E; {8 L

( n. c/ k9 g/ s9 n2 {# l4 C" Ibegin P_read arriving
5 t' s7 J1 X! I    while 1=1 do begin2 }$ Z, I* _. s. z1 E
        read A_tote from "data.txt" with delimiter "\n"' P+ [$ U8 a2 V9 W: ^
        read A_time from "data.txt" with delimiter "\n"
, l% K7 I5 ~  u% C# h" w        read A_leave from "data.txt" with delimiter "\n"9 b4 k2 S/ [# k+ ]
        read A_picks from "data.txt" with delimiter "\n"% A" F( i6 r$ S# U
        set load type to A_tote; f+ i9 F4 S0 b9 I4 t7 H: |
        if A_tote="tote 1" then set A_induct to 1# b, i4 `7 {  _( X+ [; Z; X# h
        else if A_tote="tote 2" then set A_induct to 2
2 p* q6 z) e4 U  W- F3 k4 {3 F. H' b            else set A_induct to 3    & Y. t# o# N7 g1 p# |! j8 X
        set A_i to 06 f3 K1 R+ P: o4 E7 p
        clone 1 load to P_induction( K* j* o: _9 R: i/ `; j
        wait for A_time sec* c/ V4 ~+ Q" @
    end9 B! ~* S5 @$ ?" J: b( P
end
( D4 v. k; c% u/ o0 e4 J( O: T( P( r5 T/ ]
begin P_induction arriving
" K- D$ [: Q5 T, r4 s2 m$ r    if A_induct=1 then clone 1 load to P_pick1) t8 S- {( x* G6 U: m- X: ]; L! Q" c4 x
    else if A_induct=2 then clone 1 load to P_pick2
7 x+ a# e3 Y. B# B5 K) Z9 u        else clone 1 load to P_pick3' ~" |3 G4 m- Y4 W! x# {
end
( ~' |  o( h1 I) F8 ~& r! `/ u; q- c0 Z# g) j
begin P_pick1 arriving% [% x" n. ^/ _/ @" y
    set A_i to 1
. R  Q3 Q5 E* W) S- Z' ?0 k    move into Q_induct1$ H& `1 @. ?4 p3 f
    move into pickaisle.induct1
& i$ M! ^7 K% O2 V, D    while A_i<=30 do begin
4 X9 k, Y) R4 }6 j2 K' N" `        travel to pickaisle.con(A_i)/ g8 E2 T/ X, z  [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# U( n3 p  P$ f* r
        else wait for 10 sec
" D. M5 ^- W* [! ~1 L        if A_i=A_leave then send to die
- R% u7 l1 B: m8 C        else inc A_i by 1
5 Z: a% b' V8 l1 B) b4 I. f6 J    end
/ U% f6 Q6 L6 ]- \end
& v; @2 O) D! q1 }7 T1 t3 h5 ?' X- e. b* E6 |6 \
begin P_pick2 arriving
- N3 Q' ^' n9 G; U" P% z6 \& o    set A_i to 11
( K. }% @' y+ K$ U# Z2 h5 k    move into Q_induct2% h0 z) c6 r% T  c
    move into pickaisle.induct20 J7 G  O! d" n* t
    while A_i<=30 do begin9 S7 x5 L% {$ e7 `8 s
        travel to pickaisle.con(A_i)
; z) M1 X% d0 H( Z7 K% T' n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* z" z( A& }: \5 I! ^5 z4 A: R
        else wait for 10 sec9 L/ Y8 o2 c7 N' m  z
        if A_i=A_leave then send to die
: P, b3 p  k/ ?1 E; K        else inc A_i by 1, e: B3 S! x9 t% G
    end
1 ]  j. d# U0 W1 r: e, @5 n% k  k; Aend
; V( q/ @2 g4 ?  B
5 S$ Y4 x0 d) y% L5 M. @2 R  D4 ibegin P_pick3 arriving8 P: l, m% h& `9 B" ?6 Y- v
    set A_i to 21
- V; @& C2 ]+ g8 Q) ^    move into Q_induct3. D( }) A/ z  }5 B" ^) F6 I
    move into pickaisle.induct38 f  B. o" o1 O0 l0 d& [
    while A_i<=30 do begin
$ d- _  Q" x9 E. ~0 j        travel to pickaisle.con(A_i)5 v8 _9 h% z; \: k, }9 T$ o# q3 W: x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( m, o( z& E" j! p        else wait for 10 sec% N7 V1 s& T% I6 y1 P$ ]! s, [. B8 W0 K
        if A_i=A_leave then send to die
) s, G# W# s: s% N, Y  ~        else inc A_i by 1
! T/ {& o/ O2 {5 e    end" s% B) T: I7 c7 K# {- v
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是个什么东东?
/ R7 N5 V# a" N  I3 Tmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
# s) c' J6 K6 T) T
/ @" M! D, V. F% oAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。  I5 V; S' a* o( D1 Z

1 ]) K7 I7 n( \' v另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 n  I3 g3 |5 H- V
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" s; }. ]4 Q: M6 N% x  B
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 V' n' N8 D* D) ?9 ~& n5 t
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ J( a# P0 p2 }; G' a4 q3 T4 g: E1 `begin P_induction arriving
& R. T( H6 _# \    clone 1 load to P_pick(A_induct)
: {. J& R: B4 G5 W0 B! ~5 Bend最大的系* ^+ J8 R5 B3 T7 c6 ?
4 r2 v* E4 X/ c& ^
begin P_pick arriving. t2 O& u2 D3 ^; u3 D
    set A_i to procindex * 10 + 1( I+ @7 O' K; b
    move into Q_induct(procindex)
2 y: u; e3 {6 `2 h$ y: y    move into pickaisle.induct(procindex)
1 R( K1 J9 f2 K    /*check the type of pickaisle.induct(i), for your last problem.*/, x9 o, Y# A3 p! E

" p1 I- J# ?5 B$ n5 B8 k    while A_i<=30 do begin
' y2 C; o7 }2 k% r        travel to pickaisle.con(A_i)
4 n6 \: @. B/ \. m" z, T) N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; n/ `# C# |7 r, Y5 e4 }        else wait for 10 sec$ i& N5 d+ I/ Y  {
        if A_i=A_leave then send to die2 q8 I) \9 l2 ?" R% v
        else inc A_i by 1
. P, Y! G  q6 q2 ^    end& S( L8 n6 K# s/ |5 m$ w4 ]
end% t4 O6 R/ y, e) Q% g8 V4 ]) R

; O/ l& E3 S/ J; I, n+ ?, H其中的procindex为整形,代表当前process的序号。
0 U. ^' b% c/ f1 v/ Y# l1 s3 |3 Y( ostation和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-8-22 05:57 , Processed in 0.017134 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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