|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: d" l* F, r, s& j: Z
4 G# U1 \5 p0 m" T" i: L
我的问题是,在每个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中的数值,不知道会不会有什么不妥。& [1 Y# A, Y9 J7 Z
# H5 @9 w* b+ J* c6 q8 Z
begin P_read arriving/ U$ f0 T [/ X7 ~% c
while 1=1 do begin
4 {' @% y' R. N3 q9 A Y) Y, Z3 F read A_tote from "data.txt" with delimiter "\n"2 i, m9 v F9 a" t. F
read A_time from "data.txt" with delimiter "\n"; I, |0 [- Q. @2 B
read A_leave from "data.txt" with delimiter "\n", Z& h7 w$ y1 b
read A_picks from "data.txt" with delimiter "\n"
8 |' Z4 ~7 w. e0 O. h4 t set load type to A_tote
8 ?0 _8 O+ X; i [3 Z if A_tote="tote 1" then set A_induct to 1' ~- Z9 j* [: w, B& |" j
else if A_tote="tote 2" then set A_induct to 2$ g" O( N5 N$ ^/ Y5 E P
else set A_induct to 3 & d9 C6 \5 L1 T L( S+ \
set A_i to 0
7 @9 X- W% f0 t4 l$ [- Q6 } clone 1 load to P_induction; b8 L3 U, w+ w8 ^9 ]7 ]
wait for A_time sec
: Z4 O, V4 B3 {: O5 ]1 t# r! t! ]! N end2 ]+ h+ w% f" a q1 k- G) x$ y6 T
end7 v. u2 |5 v9 h, q/ c q) g ~
* R u0 j' O5 W4 @
begin P_induction arriving
5 u0 t( M5 D1 r$ {% `% @5 T' b if A_induct=1 then clone 1 load to P_pick1% s3 s- y3 \& K( w
else if A_induct=2 then clone 1 load to P_pick2. _' ~/ U! e( F8 Y6 ^) t
else clone 1 load to P_pick3
H. V+ }# p# B3 j3 Gend
: e1 ^! b7 L' u" _9 `$ Q) ^! [! a( F/ b* D0 D' l
begin P_pick1 arriving
6 V; }2 K. p' o( D9 \; p) l set A_i to 1/ n q7 y( D5 C5 U* H6 L+ J5 p
move into Q_induct15 Y: U! a& t- a) \
move into pickaisle.induct1! h; u: l+ L3 t4 V- z+ g. V/ ]- Z
while A_i<=30 do begin
* B) n% r" i& F; F' _1 m+ ~. c travel to pickaisle.con(A_i)$ [% b1 J/ X3 a9 h' B- k, y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! Y \" ~: m: l3 H/ D
else wait for 10 sec
* `! N/ H# T7 ?; J if A_i=A_leave then send to die
4 D5 O# E* j% `6 Y+ q# B0 ^* E else inc A_i by 1
% C# X$ I8 D9 d end9 n: `, Q. a+ G
end
8 Y7 K! L. d; x% m
1 }5 W2 A' J8 Q3 `2 I- Qbegin P_pick2 arriving8 b P9 u, `# P. _+ \3 t, ^
set A_i to 11
% E! H8 D, z" E: U F move into Q_induct2
$ L' ^1 g8 T) t4 ]- X6 V0 {7 ^. r move into pickaisle.induct2# N) D4 ?. }( d0 E( P- s2 W% v
while A_i<=30 do begin. g5 o0 O6 X' z7 U" K
travel to pickaisle.con(A_i)9 L7 J* d: [' c' V& d
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; Z& ?4 u4 l0 O" Y9 K
else wait for 10 sec
" m% L8 `& J5 q0 x: q if A_i=A_leave then send to die6 Z- z3 E2 `$ O8 r) `
else inc A_i by 1
1 F# j7 L( }2 S( a0 u end% j' u- G, n+ {) q" s/ I
end
' x1 i9 v G* |8 n
# L/ e" o9 v& _: a5 D5 rbegin P_pick3 arriving
+ G6 {; q: M- j' n* ` set A_i to 21
0 x1 y+ ^- K: u! ]& T move into Q_induct30 f e+ u* `$ G4 B
move into pickaisle.induct33 U" `! p: J& e- s5 c4 X) k
while A_i<=30 do begin
# B) n' D2 |0 r# F9 v* l travel to pickaisle.con(A_i)
$ Q8 Q# H5 ~2 W: A, f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' |$ m5 p& ^% Y1 T/ e
else wait for 10 sec
; ^9 Y* }/ x7 E if A_i=A_leave then send to die
4 G4 G1 h( Q1 U" x; y3 K T else inc A_i by 1
3 s8 J6 O* s6 L( @( Z1 [ end3 ^" E+ b4 n2 s+ |' H, T
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,其它按你的 ...
|