|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 [- Q; @6 o2 `. v. W
' `" z# m" I; U% p6 x/ j我的问题是,在每个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中的数值,不知道会不会有什么不妥。( Y, V* P- V% M! ^8 E
, {# Q& W% y8 x( y$ Z
begin P_read arriving
8 T( x& K. I* T while 1=1 do begin
* o, ^3 x6 F9 R read A_tote from "data.txt" with delimiter "\n"/ S- T; R$ X+ b6 Q7 R: y
read A_time from "data.txt" with delimiter "\n": C$ \; v4 j3 [8 d( f
read A_leave from "data.txt" with delimiter "\n"
; |* U! Q/ h8 n3 k6 I8 V2 e. r read A_picks from "data.txt" with delimiter "\n"
' H3 p0 O2 T- Z% m! m set load type to A_tote
$ d0 S) {4 h4 ?. K! H& i if A_tote="tote 1" then set A_induct to 1
% Y7 k8 _- l1 M+ K9 z" f else if A_tote="tote 2" then set A_induct to 2( S- i4 O/ G7 a" o2 I4 d
else set A_induct to 3
2 L" Z( r6 ?7 m! L" e6 @ set A_i to 0" C0 c+ h+ }8 T
clone 1 load to P_induction
Q0 f2 {4 @& B' K/ a1 L/ i/ z wait for A_time sec
2 `* C+ G! [7 P- g/ _" E; s end
1 C4 L' t/ P1 ~end: z* o/ Z/ ^/ R
1 a, A6 j8 T8 }* X. {begin P_induction arriving
! h) |! R/ b; \8 \. K if A_induct=1 then clone 1 load to P_pick1% r3 _6 x- R" |0 u( k
else if A_induct=2 then clone 1 load to P_pick2
0 h$ ?) G- u8 X- O8 J9 z9 l else clone 1 load to P_pick3
5 r: e9 n% ~; }, ~" @7 rend- E; _! U; U1 U5 u
, W. c* z7 f4 Tbegin P_pick1 arriving
) _8 t2 k% P, J I% E. l5 K- W set A_i to 1
' a& l" }6 S) ~" J5 L move into Q_induct15 W) ^3 n' ?% L5 V/ n
move into pickaisle.induct1
/ T! `9 E4 K; ^7 |4 |; Q while A_i<=30 do begin
# N- H( o+ U3 p5 ~ travel to pickaisle.con(A_i)/ B+ r& n: {; O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) A. {0 m$ k. d2 t
else wait for 10 sec
( }' _/ t3 G2 y" Q# p% n if A_i=A_leave then send to die
+ N. T4 }- y7 p1 z5 H else inc A_i by 1
6 J0 c; t- t g, m) y3 R end
! o, H/ s+ x5 W- z1 v0 gend
& j% H5 h9 o: r* x) H3 n) q5 o3 f. _# t9 ?% l% o% x/ f! i* j
begin P_pick2 arriving
* N. v0 W( o5 x5 | set A_i to 11
% {) Y8 r& U* {: E/ `; W3 n- x move into Q_induct2# b$ x8 t6 n2 `) P% ^
move into pickaisle.induct2/ Q' g. O& ^. f5 {& ?2 s
while A_i<=30 do begin
9 s' R$ J4 w- s0 {! S travel to pickaisle.con(A_i)
/ c" o& H$ J3 d/ N* P4 \' Z% M1 P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* P. d. h+ a$ v- Q7 D4 E+ i
else wait for 10 sec
3 j9 x/ F. N$ v% p; m if A_i=A_leave then send to die& G$ G: ~! F- G5 ]( d
else inc A_i by 1+ A7 D6 P0 g1 B* B4 F) m
end
# s _. P2 h/ k+ Rend" P) {1 C. |% m
6 v* ~ G+ S: ~begin P_pick3 arriving U# J8 v6 l& W+ Q
set A_i to 21
" V; N0 A) M& K' s move into Q_induct3
6 m% p8 \2 J7 i- D7 L5 ^) _ move into pickaisle.induct3
) V& s9 ~3 w& U7 |% C a while A_i<=30 do begin
$ R1 s) x& o! w+ S travel to pickaisle.con(A_i)" J V, M5 O) |' L: e0 |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, G/ }. a6 l% A; q) M
else wait for 10 sec/ T0 D7 l; w7 C" {; G
if A_i=A_leave then send to die
/ e# m! M/ L3 E6 t else inc A_i by 19 M* l, t: i6 g7 \+ O
end4 D8 ^" \- Y1 ]7 w* ^. e9 S. b
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,其它按你的 ...
|