|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 u3 M$ G$ K# |5 d" t4 `" E8 C; `# |; @# t' Y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
`! r; A; K( ~( a# m6 F
. A H3 M% }' D- k( r0 Q( k9 gbegin P_read arriving
+ s6 p7 ~+ Q0 p& O# r8 m6 | while 1=1 do begin: }" k9 H- B, T$ w! q+ E) S
read A_tote from "data.txt" with delimiter "\n"8 F9 _8 \4 B5 v& Q
read A_time from "data.txt" with delimiter "\n"
7 A+ Z" {. V9 A" ~ read A_leave from "data.txt" with delimiter "\n"
! Y3 E7 t8 m. _8 K read A_picks from "data.txt" with delimiter "\n"8 Z# \" ~" x* A4 w
set load type to A_tote7 G; G) P' }) ]- v, S
if A_tote="tote 1" then set A_induct to 1
5 K/ x v. s0 V' f7 k. c else if A_tote="tote 2" then set A_induct to 2
! y0 r( }; M6 S/ d+ k5 i else set A_induct to 3 . I: l1 ]% |- p" X6 A% `
set A_i to 0& W a. ]/ C0 j6 x. G* V, B
clone 1 load to P_induction- q! I2 v% y% a1 p# J
wait for A_time sec
9 [, r0 O' i+ e: L4 z7 b/ u end
* p% f# V8 K( K* yend2 F. f5 ?) ^+ h0 y8 P# r+ F' |
! _( B2 o; f7 [# \6 g. v* b
begin P_induction arriving) S6 U @& g! A+ e5 ^+ r
if A_induct=1 then clone 1 load to P_pick1
2 j/ E% x9 S9 k+ g$ j" r: u else if A_induct=2 then clone 1 load to P_pick28 Q+ d2 n# Y0 V8 d, a" a* Z
else clone 1 load to P_pick3
7 i, U. r# F$ m% q. ^$ uend0 W3 V" e, ~ S# ?1 w+ v( J
- K; S0 }' C2 g7 B( g- v( O" V9 gbegin P_pick1 arriving
6 Q p; U" X8 H, W9 m4 t! | set A_i to 1# {4 a5 b" `- E7 h
move into Q_induct1
P' m; d% r$ E4 P9 ? move into pickaisle.induct1
4 R" H" ]1 t0 o' h& F+ S# k while A_i<=30 do begin4 p$ ^& \' t' y) }7 ?
travel to pickaisle.con(A_i)- p/ J9 o V- D/ K3 `# L
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: D2 {1 \- j9 X" B2 U1 W; G9 G2 C
else wait for 10 sec
C+ c% R2 n1 F1 R8 F if A_i=A_leave then send to die
) k+ W2 U7 }+ {3 t else inc A_i by 1
0 u$ ?# `) n2 v S4 N end
, ^! Y: r( u/ ~+ T- ~, ` S8 qend/ F1 d6 k8 p$ U$ s( I& |3 U- G
; T- F0 K( l, n8 j& c, [( Ibegin P_pick2 arriving
/ P4 C4 A# ^* K6 H set A_i to 11, [1 ?/ N6 j3 K# \0 D* s: ~& y# T; L
move into Q_induct2
# o9 y( n$ P! v5 V( n# X move into pickaisle.induct2
9 Y& s, k: ]- t% O T0 B8 V# w" n while A_i<=30 do begin" z: P8 S2 F; g5 V: t& j' V# }- Y
travel to pickaisle.con(A_i)$ L- J9 S2 \. ]3 B& v0 y8 _
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& S' P6 x* C" Q3 M! x4 e3 V else wait for 10 sec
2 j! @9 O/ ]/ x1 ] if A_i=A_leave then send to die
6 g" u* l, u- L3 y( I/ \/ ? else inc A_i by 1
5 L+ H9 v1 h2 f' V end
' F0 Z) Z3 Z2 m* _$ O: Gend
! Y6 C' |# I2 j
) D; V+ ~% b+ Pbegin P_pick3 arriving
% q( N7 x, W9 I( X9 [ set A_i to 216 Z; h; v h$ W/ b$ x
move into Q_induct36 M" n0 ` e L; b- U) F
move into pickaisle.induct3
- Q( Q; ]: y* X& O8 C( @ while A_i<=30 do begin: `6 ^9 w$ O2 p( H) l8 M# X
travel to pickaisle.con(A_i)- R/ b# G; f" {3 u& o6 h
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ \7 i$ m1 f: M+ U5 z, g else wait for 10 sec! E1 ^& j0 [- S2 }4 ?
if A_i=A_leave then send to die
/ Q+ h) C5 m+ U else inc A_i by 1
; N* N5 a n. `! C) Z7 z, v @* y" ] end* _7 V( a: k1 y. I. X& p
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,其它按你的 ...
|