|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( j+ f I2 h9 ^/ p3 \
) R/ m" k6 T0 c1 \1 ^
我的问题是,在每个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中的数值,不知道会不会有什么不妥。 I( Y% g. Z* u- q0 k8 U7 P
# G9 |' B) h8 y4 M/ B; m/ R3 Rbegin P_read arriving) t- J- @$ `- b. s9 i8 G
while 1=1 do begin
# n! H3 k4 @4 T" U3 e* a; p* r read A_tote from "data.txt" with delimiter "\n"
/ F5 R7 u5 _9 ~( d5 @ read A_time from "data.txt" with delimiter "\n"
. ^3 g* b$ e: c0 L# |, ]1 t read A_leave from "data.txt" with delimiter "\n"4 T* q7 R- Z. y
read A_picks from "data.txt" with delimiter "\n"
; ~ ^7 |& X, x) [" h$ B0 Q- j set load type to A_tote
+ B7 N) a' V4 D6 m5 ~ r8 c if A_tote="tote 1" then set A_induct to 1/ l/ `: _/ v; k4 i" S
else if A_tote="tote 2" then set A_induct to 2
' O" ^; S- j/ ]2 O2 ] else set A_induct to 3 7 y4 A( K. A% z _% V/ [ y
set A_i to 0
3 s! C, @- x" ~2 r2 ` clone 1 load to P_induction
/ b- H. w4 ~3 G wait for A_time sec, s% F+ f7 G- }) |. F: b0 d+ b
end
7 B# ^3 D0 E9 P @end: z: h% k9 ^! w7 Y/ C2 K
, z) @5 F- `# K3 ~; k/ vbegin P_induction arriving: e t' C' ~% n0 u) g1 J* Z
if A_induct=1 then clone 1 load to P_pick1
3 Q! H0 D' `# r: ] else if A_induct=2 then clone 1 load to P_pick2- R, g0 U: O Y, W+ b2 ^
else clone 1 load to P_pick3; C4 p3 T4 ^# [0 [) Y h
end
5 L2 m: K3 X8 g7 j/ G8 K
9 ?( B# p2 F# X) y3 ]begin P_pick1 arriving
. A" C5 A, Y4 }) p" `; H/ }. n set A_i to 17 F2 q8 z$ f% C
move into Q_induct1
! c& `5 A! U% Q: [' y7 b move into pickaisle.induct1; k& r( H" |6 C% W8 [' J
while A_i<=30 do begin$ b) t9 J/ y3 E+ |2 V
travel to pickaisle.con(A_i): y; C% u3 j# r& b* K
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 V5 I& ?& {. A" z
else wait for 10 sec
x; s% q' ?1 q( ] if A_i=A_leave then send to die2 Z8 ]. m7 p3 m; k& d- D6 n
else inc A_i by 1
. O( f5 c' n' n% Y0 s9 A" W2 T8 h end8 b% O* b8 y) [+ ] F! f# Y
end7 k0 F& v1 z8 M4 X5 A
8 e& Z& k# @6 \$ P; C7 p" `4 H9 Obegin P_pick2 arriving
, N3 ]0 O/ Q. B& r1 z* F& B+ r) }) ? set A_i to 114 H) n( ^7 E/ h. a" t6 ^+ w
move into Q_induct2
% E, r6 l% z9 b3 J move into pickaisle.induct2
# q2 _. {8 t* ^* [' j4 f& g while A_i<=30 do begin
2 v2 ]/ G5 [$ J+ L travel to pickaisle.con(A_i)
5 v5 c% q4 M) ^# K7 d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 z% U, F0 g, _2 V0 @ else wait for 10 sec9 o9 o. N ^+ Q; q7 C3 ^" H
if A_i=A_leave then send to die
# n7 c7 J! m8 D) S# R& W else inc A_i by 1
4 B. }4 x1 ?2 e. k1 J end
6 Y' c5 e. O0 C- M5 h/ }2 g8 o- Kend
+ Z& ~( }! R: z6 u z
2 J2 H7 g5 n7 |' T' b( p" r, C3 Ubegin P_pick3 arriving' d2 [# o& |+ r$ v) F
set A_i to 21" b) u) x, g! t
move into Q_induct32 c2 B! G e4 T* z* l) y/ V! z
move into pickaisle.induct33 O# C3 V. {* x+ r& s
while A_i<=30 do begin
. C: R' u9 K4 u0 a3 f+ ?# `7 W travel to pickaisle.con(A_i)
, ?4 j2 G9 Y6 P+ b6 E/ c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 M6 h+ l, x6 Q, R7 d b
else wait for 10 sec: W! i' O8 _+ J. v5 i; |' t
if A_i=A_leave then send to die
* c3 J- a8 I7 s; I- a else inc A_i by 1
% ^% z0 @) i; _- G3 e6 O% V end B$ s# N/ @/ ^& w, U4 c9 Q
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,其它按你的 ...
|