设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13514|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 {' T8 N( e( N$ H2 E( S
! m; a% f% r* j: 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中的数值,不知道会不会有什么不妥。
9 i9 w! w5 ^9 i4 X  J/ ]  t+ v
8 T' L! `, q& _  C# X2 K& Dbegin P_read arriving
) v% m+ c, ]7 V6 V) d1 d6 n$ ?    while 1=1 do begin/ I" j/ o  q% e
        read A_tote from "data.txt" with delimiter "\n"- t+ x6 d8 d' P0 p, Z% z. w
        read A_time from "data.txt" with delimiter "\n"
, p8 ?4 Y$ ~/ k; u        read A_leave from "data.txt" with delimiter "\n"3 n2 P/ r# _) L7 D3 k& J
        read A_picks from "data.txt" with delimiter "\n"+ O' U: R  o) _; C9 Q" p( ]
        set load type to A_tote
" c3 k9 |9 \% C; {/ i; q        if A_tote="tote 1" then set A_induct to 1
& d2 l) C; D4 t& g1 e        else if A_tote="tote 2" then set A_induct to 2
: _" R, r1 d+ }7 l0 L            else set A_induct to 3   
8 Y  f; G, G4 v( f! e        set A_i to 02 `1 M0 W5 N( ]
        clone 1 load to P_induction' H2 j0 x$ B; ?6 f- v# }
        wait for A_time sec
4 t  [9 m* _% m( z$ Z    end' A! L8 [( z+ n/ `" C) R
end4 P% v# y+ X) y: H

# w( ?8 {& U4 [/ b: X1 p% {3 h2 x/ Kbegin P_induction arriving/ T' g* u) x: u
    if A_induct=1 then clone 1 load to P_pick1
7 r) l6 ^# {$ s& T7 c  X  ]    else if A_induct=2 then clone 1 load to P_pick2
0 o$ [# h$ Z* J# K        else clone 1 load to P_pick3
: q. b1 E5 g' K  D4 Y) X6 \6 q0 p4 \end: S; K6 r- A* ^3 k1 ?4 z; X2 `7 @
. H& u! t8 m% z7 B' g# r
begin P_pick1 arriving* D8 W2 b. `/ X. A2 m
    set A_i to 1; L5 _2 I/ Z" r1 S
    move into Q_induct11 C+ `0 Z2 @- p+ h4 P; q( |5 R
    move into pickaisle.induct1
# l- [) M8 ^# j8 `( ^8 J; v    while A_i<=30 do begin
$ v8 R0 C3 V% F0 B: {: [        travel to pickaisle.con(A_i)
, p) v) q$ K& d7 j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 n: K1 U! W; i        else wait for 10 sec
( ^% W4 f! v) p        if A_i=A_leave then send to die
7 x$ b+ V2 ?2 O+ v# Y" r4 x        else inc A_i by 1' n9 Q, \3 g7 d5 p1 T. A
    end
9 |- c- e$ K) v+ zend
* x1 {# c) R6 j- o' h9 ^8 {! X% L& a# ~
begin P_pick2 arriving/ ~( V* ]' g1 |8 u: A5 Z2 U
    set A_i to 11! K7 M/ A) ^, h" y3 t! a) J
    move into Q_induct22 @' r* F1 Q7 x5 S* l. \
    move into pickaisle.induct2
. q: S6 i0 ~5 m. J/ \3 `  s: v8 a    while A_i<=30 do begin3 B/ f0 c0 d/ h0 B8 t
        travel to pickaisle.con(A_i)
% I) k( L' }2 n( j" o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 r. m+ G9 R# i9 q1 r4 z
        else wait for 10 sec
# p, @0 g: _6 ~* V: X  @! ?        if A_i=A_leave then send to die7 N! X, p5 B9 B7 t# Z+ ?, M
        else inc A_i by 1" d) s2 [3 ~( f
    end
6 n- f% _: X3 n( h3 E, ~+ _; ~end$ B( q5 K/ m2 g; ^+ b5 U

# E* [7 x* w5 ?1 ^' d' u% Xbegin P_pick3 arriving
# X: r: k9 k4 j9 P4 `8 a    set A_i to 21
7 c5 i, R! q  s$ B, s( h, K5 T; n    move into Q_induct3
5 h: b$ q% I8 [" g  T2 Q    move into pickaisle.induct3% h1 i! Z* ~7 u: C
    while A_i<=30 do begin+ X- B+ x8 m0 F' Q7 Q- b6 g/ e
        travel to pickaisle.con(A_i)3 h+ v4 l5 K: J$ I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 M1 z  q& q: A& u- q  Z! x        else wait for 10 sec
' Q( G$ i& U4 V6 d/ |        if A_i=A_leave then send to die
8 k; W0 l" [7 S        else inc A_i by 1
+ x7 e5 F$ Z# ]5 |) s- ]    end
& j2 P& ?5 D' e' f* r0 d+ ^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是个什么东东?; J8 f& U* b3 J
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" I! |& a+ R0 U" ~
- K# X0 r8 F# ?
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* [8 o$ n: C- J8 F4 u1 v: D2 F! _& R+ y' e: d( T
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ E9 ^; s& N1 u; k+ K& d: |+ O
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
" c' V. Y4 {7 q0 P! e0 [, q5 ?2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. x2 m0 g* q9 F8 V
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- _3 O( q& f. u2 R3 Z1 t% y7 Ibegin P_induction arriving+ i. i. x* _) F; H$ }) A6 q
    clone 1 load to P_pick(A_induct)
0 q. M# Y. l# [& _) i7 W/ X: Fend最大的系
9 ]  h; n* ]: i7 P3 H9 i
+ r( W% J, d. [" T( G, z8 Ubegin P_pick arriving2 w, n1 M. y2 T2 `" B
    set A_i to procindex * 10 + 1
+ A' N0 m* s" \: B2 w! ^; C1 Y    move into Q_induct(procindex)
0 D$ m& c- q- a    move into pickaisle.induct(procindex)
& C8 `1 o. K$ ~    /*check the type of pickaisle.induct(i), for your last problem.*/+ O3 D$ t6 j% s8 Z# V

1 k4 v; i. r7 V% R) z; Q: Q    while A_i<=30 do begin
9 |) b2 v4 Z. V% C  ]        travel to pickaisle.con(A_i)
/ e7 c% X4 z0 `6 i! |$ H# |& H5 m. ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) D& I4 X- d% {5 O+ L        else wait for 10 sec5 k/ O6 r2 p9 b3 w  z! L! \8 ^
        if A_i=A_leave then send to die
6 d. [% e  E' T. G        else inc A_i by 12 o6 e& I0 N2 S4 a- t
    end
+ @+ W7 R1 p: b# O/ {6 S. Oend% @- {) M0 `7 l, ^- K6 ?/ M5 j: r
+ E& h2 {/ H5 k! Z' B5 U
其中的procindex为整形,代表当前process的序号。
# U* B; q' c6 {: n$ @+ `: D5 K8 Qstation和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-18 14:20 , Processed in 0.019552 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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