设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13299|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% i4 T7 S5 _6 S9 S  J
* W+ k9 M  M- d$ \
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ u" B  ~5 q( B1 q0 ~0 e. Z( v% r9 E. V: d
begin P_read arriving
) P, W8 g! a0 t" ?- s4 K6 E    while 1=1 do begin0 K! v) ]( ^: I% h" ~* H0 W
        read A_tote from "data.txt" with delimiter "\n"
+ x, P. @. \/ F6 j        read A_time from "data.txt" with delimiter "\n"
% p- C7 s/ q- s2 C        read A_leave from "data.txt" with delimiter "\n"3 r( f- p- z6 I+ m# U6 x, ?$ u% a
        read A_picks from "data.txt" with delimiter "\n"
6 W5 _* P5 j0 B- f5 P4 U. {        set load type to A_tote
0 _, Y% w' T. [1 g0 k0 P' }; ]        if A_tote="tote 1" then set A_induct to 10 s6 [5 n# g- E0 Q( j" `, Q7 q, ^
        else if A_tote="tote 2" then set A_induct to 2
1 k0 q' s2 u" E            else set A_induct to 3    4 }; Q% K. e: S+ i
        set A_i to 0  x2 X% r- {6 K& J4 c
        clone 1 load to P_induction. W$ ]" b* Z6 E6 ]4 b6 j6 b5 J$ {" j
        wait for A_time sec' E. i9 l- e$ s% u
    end7 ?1 `/ U8 }3 C' |
end
, N- C! h0 d# d7 b4 r1 e4 ?0 D: x5 |7 [, _# Y% z" Y
begin P_induction arriving  j  v. k, Q- ~& q7 ~; H- @# A
    if A_induct=1 then clone 1 load to P_pick1
' r0 [1 L* ~# h/ F5 G2 |    else if A_induct=2 then clone 1 load to P_pick2
* T3 M# x; H4 I, J( [7 B        else clone 1 load to P_pick3
; K' }7 D; q! n- G" f- hend
0 @, z1 i" ~7 k7 N* [
; w6 a* s6 l+ d. ^' I' P/ @begin P_pick1 arriving
& c' Z  e+ N6 H: Y    set A_i to 1. x' B' v4 V, X
    move into Q_induct1
. j8 p. |8 b" S: g2 x    move into pickaisle.induct14 T1 i2 g6 e3 ?* @6 c0 @$ R
    while A_i<=30 do begin/ I5 N9 e/ w/ i, O
        travel to pickaisle.con(A_i)  e. [% }# W0 l* i# \; n9 l6 X: @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 e% |+ u9 M7 S3 u7 w! a        else wait for 10 sec8 Z  C3 m2 {  x' ]4 ~- e2 A
        if A_i=A_leave then send to die, K" p' X  ]5 a4 ~9 C8 L
        else inc A_i by 1  t# ^8 r/ p9 s; K
    end
( N" o3 o8 ~  I9 U; n* ?1 jend
7 L( u& r  M( f( b
" K: d( _3 N7 T4 vbegin P_pick2 arriving+ K) ]1 M$ J  i2 s6 t+ k
    set A_i to 110 R( e" ?" J/ y  _9 Y  h1 r
    move into Q_induct29 E6 `# T  m0 j7 |* Q
    move into pickaisle.induct2
/ p: c9 H4 k9 m  s2 @3 u( B( C    while A_i<=30 do begin
; [  v- F# a- L/ v4 I        travel to pickaisle.con(A_i)
: o: Z6 h; D% x* r8 `$ B& q1 N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 e$ I# p. u: v) X" r% N
        else wait for 10 sec
0 }  d+ E3 O$ ^1 H1 [' n+ W        if A_i=A_leave then send to die
$ K, G! I6 {3 E- @+ d1 A( s% r9 L8 r        else inc A_i by 1( t1 u2 a* h  \6 E
    end
& E" w2 R. g$ F9 m0 Kend
+ w2 l6 g6 r9 l5 x0 s! A
7 L. V9 t! [6 R: @7 f4 i5 A5 o# b4 |begin P_pick3 arriving
4 `  Z% P& Y- B# ~3 _1 D( E    set A_i to 21
/ I' B9 @) {6 Q7 D4 R: ?( F! k    move into Q_induct3
# r  V: O; z8 b  @5 F    move into pickaisle.induct39 t# p4 M: A$ }! X- o
    while A_i<=30 do begin: V8 d. J" |/ G- F0 F
        travel to pickaisle.con(A_i)
4 Q( G" [, R6 d- V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: r: {% P# u! z6 f- L0 P8 |
        else wait for 10 sec; V! Q/ V) Q8 O
        if A_i=A_leave then send to die
) `3 \5 A5 @3 t        else inc A_i by 1$ P- z: O+ m2 h* q; ]6 n
    end
+ d" C, T9 m% P' r' Aend

最佳答案

查看完整内容

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是个什么东东?# g9 h; t/ F  y; \
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 C8 W! C6 t) ]+ u7 ?$ V- z- k6 h9 a6 e) s! j; M
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* q7 M; \' _* n5 [9 {8 Z; h- v
0 l: N/ h! k( }* @1 i另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; B3 w# ?0 r* G* ?8 T. J+ @) t5 @; b1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;6 h, d) V: Q' [/ J. v8 U
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% G: h) ~$ c8 ^2 @3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:" C, {$ L( d9 W) c) g1 @
begin P_induction arriving
0 U( X* y: P3 g. T9 Q" q8 Y    clone 1 load to P_pick(A_induct); n4 I, g0 a) S
end最大的系+ k2 q) z$ u, m& h" d; Z4 J* L
  T5 g3 c1 T" n2 e- x) u
begin P_pick arriving
; a/ R( C7 l( C: N/ C/ U    set A_i to procindex * 10 + 1
2 h! q& z4 e4 t1 |. r9 r9 |5 x    move into Q_induct(procindex)
4 t# c$ c. M7 U% ^! b! d    move into pickaisle.induct(procindex)
5 v: o+ V: @; j! r, {$ U    /*check the type of pickaisle.induct(i), for your last problem.*/; r. r+ i% a( f6 I% c

4 W" f! ]  L3 p    while A_i<=30 do begin
9 m- k, I3 U, q: S8 X9 p5 I        travel to pickaisle.con(A_i)
3 G- M" i" E# t" l* `' q3 ?5 W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 S1 [3 U9 C1 j# Q
        else wait for 10 sec; P$ J4 P$ ^9 z% J1 |  `
        if A_i=A_leave then send to die
4 W2 B% s3 p. A. R        else inc A_i by 1
; o8 C0 Y! T9 a& X    end
5 A" ?- a6 \. p; h0 Gend
, K* C. T$ Y: N1 W: `5 r
! g" Z6 M# i, M6 t9 E其中的procindex为整形,代表当前process的序号。3 d% N( [) V) R/ Q  S" I
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-2 11:20 , Processed in 0.020798 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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