|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: ?4 }6 A5 U( f, c. n5 G7 h
* d1 k8 I6 j% f4 X+ y4 P我的问题是,在每个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 n" T; L6 j5 b, s" G% j& i
2 R4 L' d7 f6 O' e) w jbegin P_read arriving
, l) _; P; D, @. Y) n5 a while 1=1 do begin
4 x Q! s+ P9 v$ _" \& G0 r read A_tote from "data.txt" with delimiter "\n"
1 G1 o& _0 o5 p4 G& z read A_time from "data.txt" with delimiter "\n"* k* t0 r! h S1 {6 H
read A_leave from "data.txt" with delimiter "\n"
: @3 b% v) a& h0 ~; c read A_picks from "data.txt" with delimiter "\n" \9 \ |1 b" o8 h
set load type to A_tote) G% @$ X# `, E6 ?
if A_tote="tote 1" then set A_induct to 1; K# A/ `; K+ p1 d
else if A_tote="tote 2" then set A_induct to 2 g4 l @& Z' u& b9 ]
else set A_induct to 3 4 k" S9 L5 s+ |$ o
set A_i to 0; u# C h2 b, L7 B0 [, P
clone 1 load to P_induction
0 X( }- u1 v" u6 P* U7 X& ~& i! k+ f1 l wait for A_time sec6 `5 F) r' E2 Y9 k. a
end: k( k; {8 t% |
end) T( t7 v& |4 {5 m% S) ~. H; l9 M: K
' [6 Z! A- @2 H9 `+ N4 d) \6 d% G
begin P_induction arriving8 ^% Y$ q9 e- _6 k% H6 b Z
if A_induct=1 then clone 1 load to P_pick1
4 f+ d! y) H5 _ h! o3 I! E else if A_induct=2 then clone 1 load to P_pick2
2 W8 T& y6 a6 L& |; ^ else clone 1 load to P_pick3
' ]3 |, ~1 l r0 L3 i5 Gend B8 y% M" c: D
* g q/ G1 b; |; Cbegin P_pick1 arriving Y- j# P" y) Q+ ~* ]
set A_i to 1
, l& `3 I8 t, y move into Q_induct1& k" t8 `* y1 o. x: M3 n! A* ~
move into pickaisle.induct1
- m( d9 o( v. S: U1 F7 O: Z while A_i<=30 do begin
]! Z8 A9 R* h5 I7 h9 b ^3 D travel to pickaisle.con(A_i)
' s% O' |- g Z, D! K# y1 U% U if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ b7 q1 g. L7 I
else wait for 10 sec
# e% H4 G/ {% f9 W( K4 |: P if A_i=A_leave then send to die2 f J: j7 G4 q. k- F6 N) F# O4 o
else inc A_i by 1/ V0 l* e3 c2 B" M. h/ E2 q8 f0 g; K+ ]
end
; f4 Y+ r. @: |9 |% \& h! pend
3 F [* _0 N0 W8 y* v$ z4 t# ]
* R6 G. Q4 T: L/ V3 f1 ^5 qbegin P_pick2 arriving1 f" q k9 W7 [9 Z" B
set A_i to 11
* ]# }; s0 t$ K Z* S% {6 T move into Q_induct2
# N- w; _1 S/ H) X. w( \7 }3 c1 O" _" M move into pickaisle.induct2
: J, B& h$ B9 X2 }8 X% W: f while A_i<=30 do begin/ V. }" P; S J/ R1 J9 z% m& T
travel to pickaisle.con(A_i): p- r& `' u7 n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ d/ _- f, [7 V8 L
else wait for 10 sec
/ | ~% _# P( f% G" s1 Y- h; W if A_i=A_leave then send to die$ T; O0 p& @9 A' R
else inc A_i by 1, }) Q" w3 F9 \; E2 y# V# B
end
2 W( \0 c7 |& X& A4 j) f+ ^$ L5 Pend& A8 z) r6 g" ^( k5 u, w
- N. i3 H5 i/ F% b( Nbegin P_pick3 arriving4 V) C% A7 Q0 _2 J# c- y8 M2 A
set A_i to 21$ ~& C+ U9 U, b
move into Q_induct30 G( a& d, ~! v
move into pickaisle.induct3
1 [: z: B9 ^" r& J# D while A_i<=30 do begin, u- w# p& |- F! S
travel to pickaisle.con(A_i)" C/ Z1 ? f: M$ G- T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* G/ D1 y2 c1 a, I* ?) e else wait for 10 sec
; g; }+ e- c) o7 K5 b if A_i=A_leave then send to die
( X3 g V8 R" U" E else inc A_i by 1; b* X( a( u9 F" [. u
end
' Q' C) x4 c& N2 Cend |
最佳答案
查看完整内容
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,其它按你的 ...
|