设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11866|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ n+ {8 @1 E( G' M- S' j
: H% o! J& ]! ~% M& c我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% t1 r8 k& F0 e& R: s; s
$ ?& d- z9 C9 mbegin P_read arriving
" P  s1 R% h" @$ N3 g9 d    while 1=1 do begin
4 i) h: ]7 @6 j, y* x        read A_tote from "data.txt" with delimiter "\n"
4 }: Z4 D: ~9 W5 B3 v* O# ^" v% z        read A_time from "data.txt" with delimiter "\n"9 R, p6 E$ [9 Y9 ], I
        read A_leave from "data.txt" with delimiter "\n"8 m- A/ z' z' j( A9 E
        read A_picks from "data.txt" with delimiter "\n"* B5 L2 Z7 \1 P% O4 v. c
        set load type to A_tote
3 _0 K& t3 a* z1 L- L2 \8 O2 f        if A_tote="tote 1" then set A_induct to 1
  E( J+ T7 t. b% a7 p5 j+ l: Q        else if A_tote="tote 2" then set A_induct to 2
9 G5 u! G$ I1 s            else set A_induct to 3   
$ A, \6 v- \, J4 V( H: \  ~        set A_i to 0
' Q* {$ R2 d, C1 R1 Z: P, C9 M        clone 1 load to P_induction: s2 ~$ \( W$ O' {) r( i
        wait for A_time sec
* i. R8 {( I! s    end
# G( S) ^: C. Fend
& B; f8 Y% c; m2 X+ v* |2 A0 H( Q
begin P_induction arriving& K* I+ M4 @" C+ W- @+ }
    if A_induct=1 then clone 1 load to P_pick1
0 l: g+ D% |0 {1 Q    else if A_induct=2 then clone 1 load to P_pick2
4 ]0 A1 f2 L6 ?. p/ F* ^& n4 ~        else clone 1 load to P_pick3
. l( G1 o* a1 C- Send0 z$ ~; R, ~: p  J$ D3 d

7 H5 S9 g4 K3 G0 J3 d, Sbegin P_pick1 arriving
2 u) c  F! S+ w' Z" g0 C# Q# v    set A_i to 1& v, i) \) Z: _/ z/ G
    move into Q_induct1
9 f9 B1 p* [) ?% c2 H0 M    move into pickaisle.induct14 r) @1 r2 _2 u" F- F. R* C, y9 I* R
    while A_i<=30 do begin
, }" L5 v$ l! ~        travel to pickaisle.con(A_i)
, Q6 c( X0 v. w$ g, ?+ Q" Y$ |, v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 h% P. o7 X  Y7 ~. u        else wait for 10 sec
. N! Z+ V) Z/ V3 U, e7 n# E% V+ U        if A_i=A_leave then send to die
5 R0 M. ~8 e. b2 o% C        else inc A_i by 1
: i( I+ k0 p2 p6 c    end
( T: U  D2 K1 p% dend
. }) J1 Y" w5 c+ \; @' t9 D
0 g+ Z4 i9 K" sbegin P_pick2 arriving
  e+ I) h9 Y; K4 Q  R+ G/ j    set A_i to 11( u7 U. Y. k5 m, t: Q, O, G
    move into Q_induct2
. a- J) t# j5 O# ]* @    move into pickaisle.induct20 r1 {0 V, w1 L( e( X9 _4 J9 P
    while A_i<=30 do begin
% w# f" g+ \0 l# Y7 S        travel to pickaisle.con(A_i)
5 {# y5 g* n8 }4 a9 \5 F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) I7 A5 g# v3 I8 t
        else wait for 10 sec
! t% @7 ^9 I& D  ], O% Z6 @0 ]        if A_i=A_leave then send to die5 k" Z$ t  T8 p) N- K  Y/ b
        else inc A_i by 1
' e- B: q1 [: I& h- T( w    end
# _4 o. |6 K, ~2 U+ |  g2 ]5 R0 ?9 Mend
/ \. S9 ?* _& T! D& D5 t- B" E! @
, B# y, g0 G8 b+ t& ^$ X0 {8 M8 gbegin P_pick3 arriving0 n  v' ]5 t9 ~: o5 x
    set A_i to 21% e* s1 A3 C1 `" i
    move into Q_induct3( k9 `3 h! Z  \/ s* i8 J, X
    move into pickaisle.induct3$ ^" w6 X( a7 T  d5 M% \- U
    while A_i<=30 do begin
/ k/ J$ l. P8 g. ]        travel to pickaisle.con(A_i)
. H' B" H, |+ x, b5 ~/ t: W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, h5 n3 x/ L7 j& ~6 |' V% w4 L        else wait for 10 sec; `+ G& |+ ]  [% v% j: v+ I$ L
        if A_i=A_leave then send to die
1 J" E+ g0 e% P/ Z' c/ q2 |: ?        else inc A_i by 1
+ h4 v# X+ B1 e& N    end6 j+ y( l5 V% F3 j
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是个什么东东?
* a: _+ V7 Q" O: c! w/ I4 dmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
# y  J% H- m# X6 ~" N$ ?; j: h5 |( c1 m$ o: m) W  S" R# G
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。( ^9 B% ^9 w  ?/ ^9 t+ @% O1 v; }

& D1 l+ m: `- u, O/ Q$ E另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:1 I' J% u7 U! o# ~4 j: K
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! V6 s. i0 }, g+ D5 J; V
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 |' C* P( Z  ^! q% c
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. E% G# v. d9 s" U' X8 o) X
begin P_induction arriving3 \+ f: N: O+ ?6 O, v
    clone 1 load to P_pick(A_induct)6 ?) Y8 d1 L" k# G; R* c$ s+ s
end最大的系! w8 R+ H4 a: F+ f
& ^4 u$ z: j2 f3 ^
begin P_pick arriving
3 N# P; w  C0 _7 y    set A_i to procindex * 10 + 1. {: p# g, b0 Y- {; k. e
    move into Q_induct(procindex)
! M! m+ D8 L- `  `    move into pickaisle.induct(procindex). j3 r4 |, ~0 c) w3 [
    /*check the type of pickaisle.induct(i), for your last problem.*/
9 b6 N. Y; [5 l- s
* P0 E* t7 n/ `5 V& E    while A_i<=30 do begin
: c# L$ C$ j3 b$ {" K' g        travel to pickaisle.con(A_i)
" f- z. M# |- I5 b6 x& L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. Y- ~! T7 t4 W+ Q' z
        else wait for 10 sec
# X& k6 P* O' Z' q6 x; u+ n5 ]        if A_i=A_leave then send to die3 ?8 G4 w4 H/ H$ s4 q6 f
        else inc A_i by 1, t7 ^; m7 g  A' E
    end2 d; m" ~5 Z4 ~! q# \' A0 W
end6 D* }0 n# U3 Y) E" ^, A6 M

) l% p- H; ?1 E+ g6 @+ F其中的procindex为整形,代表当前process的序号。$ p' ^, D# B2 F+ X
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, 2025-12-11 13:24 , Processed in 0.021720 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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