|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' d0 I' `, }; L _. f4 g8 T
$ j& c4 ]( D; ~8 u. k9 V9 W我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 p3 Y7 z7 N5 q: J1 l4 }5 p! G+ a) Z! ]! `2 Q E
begin P_read arriving
5 z$ _9 o1 K+ Q `8 \$ n4 } while 1=1 do begin2 @2 V. u' Q7 j; T, e
read A_tote from "data.txt" with delimiter "\n"
8 a! j5 ~2 A6 V5 l3 }/ r# D5 f, e read A_time from "data.txt" with delimiter "\n"! G8 h; p/ V" V( P3 j3 X' `
read A_leave from "data.txt" with delimiter "\n"
/ S2 D, k% N; c+ O# T6 O$ Y read A_picks from "data.txt" with delimiter "\n"2 Z# ]1 j5 N+ q
set load type to A_tote5 Y. d* h/ K+ _5 g+ a0 e& C
if A_tote="tote 1" then set A_induct to 1: O* m. @8 g' a" C- ]3 C. z W
else if A_tote="tote 2" then set A_induct to 2
" @% l h% e7 j else set A_induct to 3 9 R; T6 A3 Q- x0 P$ q0 b
set A_i to 03 @8 F( T# J' g2 q
clone 1 load to P_induction
! \0 x5 T7 f4 r4 `$ l wait for A_time sec* u) q# p' w* K! J1 {. z
end. }3 R; U6 ^6 k5 N5 w. o
end
6 C, a! V5 Y5 v( a( F9 B+ F1 d5 k( }# [1 F. e2 @
begin P_induction arriving
! R; }" n# X7 q/ I% b3 a9 s if A_induct=1 then clone 1 load to P_pick18 X, ]) W: U) [9 d3 _# d* V
else if A_induct=2 then clone 1 load to P_pick2
# r: F% b3 s* C9 z else clone 1 load to P_pick3
( x* S6 }* J% s; s" S+ D" K/ p4 mend; T0 B! M) e! e* x5 E* Q
( [, t8 b% S }0 I0 V) tbegin P_pick1 arriving
+ b* ?, h5 i' b set A_i to 1
8 r8 [( S9 h* [, J: c move into Q_induct1
3 T5 ~8 Y8 t0 B. @" E3 r move into pickaisle.induct1/ A& h$ ]( z8 r" n3 \* @$ }& `
while A_i<=30 do begin
+ V S! u- \2 g$ i7 e! H travel to pickaisle.con(A_i)$ v5 t+ s! z" V2 y9 n$ f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ J! x! s0 O. M6 W' S else wait for 10 sec
; W/ ^) H% j' z5 s+ X: h% g if A_i=A_leave then send to die
! g% C0 g$ o, \ S4 O else inc A_i by 1
( ]+ x3 M. p' b' K& Z5 C end# g7 N: N9 v; V: k5 Q
end
8 N5 Q. J. W8 A& k& b. L U* {, d: Y2 j3 \* e8 [$ ~) `
begin P_pick2 arriving# w3 d. F* F$ s+ G5 C, `" P1 N
set A_i to 11. W' v8 J9 F! ~0 ]
move into Q_induct26 J8 ~& C$ W4 B5 G% G1 o7 ?
move into pickaisle.induct2
) \* A* R9 Z6 ^0 y/ R% n! y while A_i<=30 do begin8 l5 t( Y2 T. w0 v+ d1 O0 B4 X& I2 C
travel to pickaisle.con(A_i)
% _$ @4 `. r! P5 u if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 {! s t0 C) s% ` else wait for 10 sec) \7 p& F4 L* p& ?; l
if A_i=A_leave then send to die
$ w- G0 R% j6 G. r2 P3 s else inc A_i by 1. y% E R% D3 R. e- K. A
end
* F. m5 X4 h" P: [9 f8 [4 Rend
+ _! Z; B* G2 ?" t
* y* t' d; R" O$ Lbegin P_pick3 arriving
+ Z0 v3 t( o4 { F% \ set A_i to 21
1 x9 u3 g6 M3 i0 S5 K* [ move into Q_induct3/ z; S- Q4 z( y. e- _3 m9 V
move into pickaisle.induct3: I3 ]5 H& t8 |: h
while A_i<=30 do begin, }* w4 L0 I0 @0 Q' M Y
travel to pickaisle.con(A_i)
/ r3 D1 ~! P4 L2 I6 u' a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. f# F+ N' h( S0 F else wait for 10 sec; T/ p; Q+ N" `) }7 {, E: o
if A_i=A_leave then send to die
+ c' g6 |3 s! O) m else inc A_i by 1
; L" \* W0 D, D/ A end
5 C: A2 V& n9 ?8 O' 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,其它按你的 ...
|