设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12726|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 S; y9 l$ M& D% c' C  s

# f) z9 D4 m8 L我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 E6 i0 v( O1 @6 |8 c. ^% r
& |) V- ]7 A$ d# r  I* t+ y
begin P_read arriving7 L8 ?" @1 f% ^% `* Y. y1 M
    while 1=1 do begin
" w. h' b: C: u9 G3 _! R: A8 p        read A_tote from "data.txt" with delimiter "\n"( w: ]) q4 S2 G6 g! R
        read A_time from "data.txt" with delimiter "\n"# T9 U3 R/ n! I$ O
        read A_leave from "data.txt" with delimiter "\n"! v3 t  V. i* K* A0 w6 F
        read A_picks from "data.txt" with delimiter "\n"! g$ I- o5 v& |4 }/ ?( X6 ~
        set load type to A_tote3 N. p; \8 p$ d( G3 q, H0 |  s) D
        if A_tote="tote 1" then set A_induct to 1
# M* w) _: q& s( u; x        else if A_tote="tote 2" then set A_induct to 2
; \; v: t" Y; t            else set A_induct to 3   
0 q# U0 N7 f) A5 S) c5 [% h        set A_i to 0
5 F" S* y9 R/ Y# u/ _        clone 1 load to P_induction8 t1 P- }6 J- g8 }; O: Q$ u
        wait for A_time sec
4 M; V* W1 h/ @) l9 v4 _& o    end
# R0 S/ ]. I. ~/ ^& Q& v' \! T; Cend, v- f; h" L' _  |

  C& z1 z( F2 H& Hbegin P_induction arriving
5 v4 w3 X. Z: s( n6 c8 K4 s    if A_induct=1 then clone 1 load to P_pick17 ~+ ]1 U! E# \! t
    else if A_induct=2 then clone 1 load to P_pick2& Q8 {/ j; {% [7 ]  i: O
        else clone 1 load to P_pick3
1 [9 C* Q$ C  r0 lend) q+ z; V. \# D9 V, W- ^1 L
5 M9 i  F; D; O7 B+ p
begin P_pick1 arriving
8 v( ^# j9 |( T7 {2 {5 L' O- m8 T9 |    set A_i to 12 A) w- d; B4 c, t7 c
    move into Q_induct1
, C: X5 W$ U7 n# N    move into pickaisle.induct1
5 k1 u: }# m% Z( z, Q6 [( S* N+ ^2 d    while A_i<=30 do begin& H+ K- b  h# F  m. ]8 J( ]; E
        travel to pickaisle.con(A_i)
1 _) m+ @/ [) ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& x6 f! S$ B/ H* C% Z1 Q
        else wait for 10 sec( A" U7 R9 P  w- o
        if A_i=A_leave then send to die
9 D; j" s. Q, E        else inc A_i by 16 b) ^9 I1 ]- w( F/ g6 o% G5 t
    end
$ c) M' {! M3 R* l3 B8 d9 ~end
! e$ e; I/ z( @  @" D8 f+ V5 C1 o1 V) ?) d
begin P_pick2 arriving% ?# S/ }5 {1 B& w
    set A_i to 11
  a* Y8 }  \) u" X8 e    move into Q_induct2
( b+ `+ E. F0 C    move into pickaisle.induct25 s* ?: d2 |# K0 j- g) R& v
    while A_i<=30 do begin, I# ~3 G  f, f/ M  ]" m; }! i# `9 w& F
        travel to pickaisle.con(A_i)
! ^' p, L/ V! N" L! y/ f% `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ ^- r0 G0 l4 B: i. M
        else wait for 10 sec
% O3 `" i: {5 I        if A_i=A_leave then send to die8 g' c6 B6 s7 S" X( c+ T
        else inc A_i by 1
; I* t. j! }* Q0 v    end
' K; Y3 {8 r  r4 U8 kend
6 i2 X3 z; K; u- L- y6 i2 R& q$ V) C8 `
begin P_pick3 arriving
2 J8 G- R3 B8 \; ?    set A_i to 21
) [4 d, T8 U3 @: L+ [/ }8 q    move into Q_induct33 ?$ Y" U$ j& Y
    move into pickaisle.induct3& A% H9 |) ^% _( b
    while A_i<=30 do begin
, Q" K+ w: W5 i; D7 t7 p4 c        travel to pickaisle.con(A_i)
0 i# F, g" [0 _0 @) v) S) Y& C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 ]) R% @) D# Q        else wait for 10 sec
7 R: M; f* R% l        if A_i=A_leave then send to die& e" }' M0 q- f% ^0 P. }) J
        else inc A_i by 1+ s9 }" r* z, A; r- `) E
    end
% A) j7 X. M' k+ x8 F7 zend

最佳答案

查看完整内容

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是个什么东东?0 D! g8 _' ^8 c0 s" m$ J9 M
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ X- t. T. Y: y( X/ p
$ W: R& E3 `$ V( e; i$ PAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 l6 M8 j. _5 }1 Y$ F
" g, e! @" `/ s- i2 A! q& L
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:% y+ y" ?7 b) B5 K/ H# b6 [
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% Y% t. @4 N* E& N% ]2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;0 W; y8 s9 |2 L- |& r8 ^
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:( _) a# t" n8 p9 x" c3 v+ Q
begin P_induction arriving, }0 ?( `* F' t, G5 D8 |
    clone 1 load to P_pick(A_induct)" L1 S" k) h) v/ K; r
end最大的系
/ Q! @0 j% p$ ^% I8 x$ f* ?3 s3 A
# e- }0 [+ R/ Tbegin P_pick arriving6 h/ O9 e, n3 p% p7 H: g( f
    set A_i to procindex * 10 + 1  f6 w6 _5 z5 Y5 b5 q# u4 x# M( R
    move into Q_induct(procindex)
2 M# K( S1 C* V. r6 `) }# B% c    move into pickaisle.induct(procindex); j/ ~  l, f4 l, e5 r
    /*check the type of pickaisle.induct(i), for your last problem.*/
2 }1 n$ k. ?+ I1 P
5 X' H5 K# U+ {7 O    while A_i<=30 do begin
3 n! U0 m5 [, y. D        travel to pickaisle.con(A_i)3 V" W) Z9 K  x  I/ }5 Z) K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 u) j1 M0 i) @3 \2 Y
        else wait for 10 sec# c! H6 U# e) q" }0 P: I( J9 R
        if A_i=A_leave then send to die
+ S( R+ I" Z4 v+ z6 M; X        else inc A_i by 1
2 N' Z3 F* k! h5 j0 T, a, A0 K4 W1 a    end
5 _, \" j! q5 G  Qend
- |3 P( E% q1 u; u, R
% y. }% I& S7 |% o* _  J其中的procindex为整形,代表当前process的序号。
% Z9 R1 B$ G  q2 s- s3 Gstation和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-2-14 22:26 , Processed in 0.020068 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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