|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. s. `( Y: C( n" \. w% ]4 R P* _ Q+ T, M6 h5 u: Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 P1 {% ]1 w& Z" o6 k" o
6 K* E* m/ V: e' T' P; kbegin P_read arriving! y5 |2 Q2 Q5 j/ C7 A
while 1=1 do begin& U3 @/ G8 P, ^* l! a
read A_tote from "data.txt" with delimiter "\n"
& \6 u4 V% N2 L* {( ` read A_time from "data.txt" with delimiter "\n"
9 Z* f* ?6 t8 Y8 y& O read A_leave from "data.txt" with delimiter "\n". Z7 o4 @/ j& ?
read A_picks from "data.txt" with delimiter "\n"8 z5 m3 ]- j/ d, M* W2 I, C7 F
set load type to A_tote8 V9 m: Z# g8 X* h1 {6 f
if A_tote="tote 1" then set A_induct to 1 Y# h! b9 ?, m0 H: f2 [+ }8 p
else if A_tote="tote 2" then set A_induct to 2
+ |2 t a! N% G2 H- N# ]2 f else set A_induct to 3
! _5 L5 T" }6 M1 k7 `& l( v1 j set A_i to 0, D' q, a- Q7 y- C0 k
clone 1 load to P_induction
% n7 G, m9 s/ R8 S* Z+ K: s4 c5 L wait for A_time sec: \, c$ G7 M b* d# O! Q
end
1 G J+ M$ `; z' \. R% r) d- ?; d# jend- V2 \, _. t* Y- K" t7 w# X! M
: M8 ]0 H" @. B: x# Q; ^ ` \
begin P_induction arriving
7 f# L% G9 I6 M7 y. M* G! r if A_induct=1 then clone 1 load to P_pick1
# p c* j. c; U$ M D else if A_induct=2 then clone 1 load to P_pick21 s% G; I0 a! K1 {
else clone 1 load to P_pick3 C& g& r% s9 P- ?
end
$ f4 o7 J9 W' J! M' B' ?3 P8 Y$ G) U3 u0 t7 t
begin P_pick1 arriving
& }% g1 R8 L" X2 i! t; K3 g set A_i to 1
5 C* ~1 L( e; E3 U* z+ P& } move into Q_induct1
" }; @7 }0 a3 E' ^/ B/ C* ` move into pickaisle.induct13 c ]# t2 ~) D$ j4 e% e0 x& B8 e( I
while A_i<=30 do begin7 r7 X5 h% O7 Q; ~& e _- A
travel to pickaisle.con(A_i)& }" |1 ]; e- z5 r! a0 t' G% X
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 F0 C; h- S0 p' z) i
else wait for 10 sec
; I; \0 g& W: u2 y3 i if A_i=A_leave then send to die7 i0 v8 N( a: b/ O; S# z, i
else inc A_i by 1
' g% [" Z$ E6 w0 o" k end, \6 G( d" X+ V! j1 s+ g u
end
; P3 O: N7 j3 j$ r6 e* E% J4 T# e1 r$ g& q
begin P_pick2 arriving5 U3 I3 Z7 z) c7 W
set A_i to 111 Y+ R4 k: q$ n W
move into Q_induct2
2 N. @" ?+ v( S) L0 u$ x# U& U, c move into pickaisle.induct2) o- P7 L& c+ y& D9 e; G2 H- ^
while A_i<=30 do begin
- ]+ P7 s/ v1 D9 I travel to pickaisle.con(A_i)1 h% N" N- O" ~, R3 t7 k
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 ^+ g7 z' K, p8 ]2 a7 N1 [$ }
else wait for 10 sec
! h0 ~6 V7 R* @- Z6 q7 E if A_i=A_leave then send to die
5 f! ]7 P; C. b/ J8 e6 G3 ?, Q& \ else inc A_i by 17 y6 s% \* w7 d6 @6 ^
end+ X$ n+ G8 \) [0 L# h0 P
end7 E: y- s0 ^4 M. E8 w g
. \# P/ I# n" i; Y0 }3 X0 E
begin P_pick3 arriving
! y; [& b+ z9 W) A set A_i to 21
* N9 }6 i5 }2 O1 J4 c# W7 {, I move into Q_induct3! q6 ]% ]3 i9 h/ N* |7 U! d. m
move into pickaisle.induct3' o5 X' l" d& W1 D
while A_i<=30 do begin
, F" l' m6 A$ z) L travel to pickaisle.con(A_i)
7 i# O6 t o9 u% E0 X V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ V" B$ P3 x. P5 y+ H( v else wait for 10 sec1 ^& _, S; v' W$ m# `# @
if A_i=A_leave then send to die- d2 w7 D/ q+ y2 b$ T0 ]
else inc A_i by 12 _: K+ ^; I: e% W' u5 T4 F+ Y! O
end
n. \! t! G3 s- yend |
最佳答案
查看完整内容
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,其它按你的 ...
|