|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- }. ]7 V- ^* l, d+ q5 [ o
1 @% W. R/ S1 ?4 m
我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 E. R9 j7 f3 H4 `9 l; |5 e
. G% @( F' `! R4 q$ jbegin P_read arriving
' e1 |4 s: z7 N) \. s( t while 1=1 do begin: ^; N) m( \6 A
read A_tote from "data.txt" with delimiter "\n"
6 v/ w* m. b% w5 q( r& f E read A_time from "data.txt" with delimiter "\n" E# H+ }' O: l2 O
read A_leave from "data.txt" with delimiter "\n"
0 s. a) V8 l$ }0 e7 d/ X$ e read A_picks from "data.txt" with delimiter "\n"
3 m2 p. R2 U3 C' n5 y3 `5 } set load type to A_tote
8 f6 R+ y% I5 @; ?7 y1 K6 M if A_tote="tote 1" then set A_induct to 1
% b; u+ q4 n8 ^* G2 W else if A_tote="tote 2" then set A_induct to 2; H2 j" r) ~+ [# N' |1 U
else set A_induct to 3 ! c1 r: g7 X& T5 j8 Q, @
set A_i to 0" g3 Q6 d% r) ?5 [
clone 1 load to P_induction
% a$ Z/ p7 v3 o$ ^( J wait for A_time sec$ e9 A1 E; u6 d& P r9 _* W- i& B
end$ C: i6 x8 _5 Y
end( i5 t( M* t) B1 i
' n) U4 X/ L$ z. }; c& f
begin P_induction arriving) L: q+ c* D4 D& a
if A_induct=1 then clone 1 load to P_pick1
. H3 e" X5 }3 G$ P3 [" t0 u else if A_induct=2 then clone 1 load to P_pick2
: i$ z- |; ~) q, Q; C( S else clone 1 load to P_pick3
5 T* q5 K0 E2 K% t+ {end
# D. o. `: S: H! Q9 P9 f5 }
( h3 o0 D- S; B# F3 ~0 g8 e m$ z) y8 dbegin P_pick1 arriving- ?& V4 |9 g& u9 R" _" A' ^
set A_i to 1
% e7 v, j+ u/ \: |. x7 z; u move into Q_induct1
* q; W4 D4 T) \5 n5 B+ v1 P, O move into pickaisle.induct11 O' b/ }* j8 [. E9 I
while A_i<=30 do begin" B3 x+ e% W* q7 w4 d6 m
travel to pickaisle.con(A_i) z& ], w# ?0 h m( l9 r2 c6 J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 B$ B. d. {: u5 u
else wait for 10 sec
2 i3 l$ l/ J. Q* L$ b+ V2 o$ _8 R2 X if A_i=A_leave then send to die
/ T! Y+ E$ [+ h) m: d* ^6 F else inc A_i by 1
- L* o) W3 Y% V# e* \ end5 h& Q8 E* w3 a9 ^8 X1 a6 g# A
end
9 m* @2 }% ^# l
5 W5 K' v6 o, C9 R3 s( n H' J) Nbegin P_pick2 arriving
) ]1 h" a$ `1 F" e7 o# N set A_i to 11- o" [2 ?. o, A+ ^+ _& ^% v
move into Q_induct2& z( H8 Y* k+ p. {" c
move into pickaisle.induct29 q% c) D7 k! D' G
while A_i<=30 do begin
! k2 L. [& q' d' H travel to pickaisle.con(A_i)
, G* N7 Z- m/ O6 `# B& V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) ~8 H- R2 j' I @; \% P& c
else wait for 10 sec
0 g- K+ ~9 [) q& b; y% S3 f1 i if A_i=A_leave then send to die
$ k: y7 i g3 j0 i else inc A_i by 1
' U7 i% n; ^1 e# k1 \# u# w. w end2 }* W5 M, m. e- A
end- i% M/ j% r( n6 [& i3 J- ^
! q! O! C% M j* U
begin P_pick3 arriving& N& z: p4 d$ O Y
set A_i to 21
4 V% S% {# `: m$ Q6 R5 s! C* j& G+ D move into Q_induct3) D) {6 C, E9 U0 B- [
move into pickaisle.induct3/ M; `. J7 x8 V) r- \
while A_i<=30 do begin
0 W$ F7 L) O" ?% `: _ travel to pickaisle.con(A_i)
?$ ~' }. y% b/ F2 U6 S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( j* J% c1 {" [- b, W! ]
else wait for 10 sec( a; A. C$ }8 ?, Z% b
if A_i=A_leave then send to die- r' |2 I2 s& _# n; J6 w& O8 p1 P
else inc A_i by 1
& R8 f, a& T# R, h4 k end
; u9 W+ J" o$ u' [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,其它按你的 ...
|