|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ w+ e) @( ]) w) j
# i: D0 K) Y, D: Y我的问题是,在每个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中的数值,不知道会不会有什么不妥。# P3 t. Z$ j3 h: k' ~9 V _
* t* i$ s1 l7 L" B; X, Jbegin P_read arriving
% q" G0 |" F- m5 { while 1=1 do begin# Z, W- _" h5 Y- _' S: k
read A_tote from "data.txt" with delimiter "\n"% D3 l$ T# X) e" W+ m
read A_time from "data.txt" with delimiter "\n"! V" G! ~3 H& C% W7 F
read A_leave from "data.txt" with delimiter "\n"
& o) u R6 g* e! c9 M: H d read A_picks from "data.txt" with delimiter "\n"6 x) b7 m; J. U, c7 L2 B9 r. }
set load type to A_tote
3 d% a+ U( S. U: m( n$ Y! M if A_tote="tote 1" then set A_induct to 1# D, N8 ]) C- X0 _
else if A_tote="tote 2" then set A_induct to 21 h' @& }/ n# q
else set A_induct to 3
6 n( N3 u! I0 k, n% S! d8 q set A_i to 0# e% M* S" O3 E5 K3 g
clone 1 load to P_induction
- X+ t* J# B2 R( N9 L wait for A_time sec
) J' j) D: |" [% P end
* @" d* a; |2 Pend
+ }# p# M- @/ h9 C5 D ]: L7 f4 S }
% n; a' c3 X0 I" ~8 V* D) N0 Y fbegin P_induction arriving
& q% p I, r* J) N4 D7 R if A_induct=1 then clone 1 load to P_pick1; M7 N% }- Q( d3 p: d- a2 j' x, L b
else if A_induct=2 then clone 1 load to P_pick2
+ {/ @; {0 f4 w8 i' @) l2 w3 k# Q else clone 1 load to P_pick3! k6 P% }# m5 W$ W" u+ h" W
end
! {4 B2 z$ ]4 b$ w& @ } q t4 k( H3 Q( e7 e
begin P_pick1 arriving
7 V+ P c1 h4 i, I9 n ^) Z set A_i to 1
; G4 s* B$ f. Y* Q8 k6 o move into Q_induct1; n; G* {8 `4 P, s; S
move into pickaisle.induct1
* P. I# F% z" \/ g" Z while A_i<=30 do begin2 Q' F! D1 _4 S$ d
travel to pickaisle.con(A_i)$ |. H# \$ M8 o8 r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, x' Z3 u' U' Q" R7 f% M) i else wait for 10 sec
) g" [! d$ w5 x if A_i=A_leave then send to die
3 a+ B& k% g6 T" w- y else inc A_i by 1
2 y0 T7 O8 o+ o* X8 B1 M+ s end
6 f# n2 f. x" F) s) J9 G& W* Dend
% E/ ?3 p R; J( J* [3 Y7 y8 B9 k1 m/ z* u
begin P_pick2 arriving
- Y1 V* f( _3 I5 N7 `/ s! s set A_i to 11
* [2 ^9 ?# g1 t9 G! L& ] move into Q_induct2
, v; I4 r& j4 ] move into pickaisle.induct2) ]' o" n( R# h) ?# ~
while A_i<=30 do begin& ~# ^& t* t: g; x
travel to pickaisle.con(A_i)% o1 |3 @$ G7 B" X; L) F7 M- z' \+ L, C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 ?- }6 K# i; l. a else wait for 10 sec
( y% y; K9 B( s' Y$ @3 d' o. B if A_i=A_leave then send to die* A: s( p& t1 M- R' m4 E. `
else inc A_i by 1
$ {1 Y- f6 s' J end1 O9 n2 Q# r- D7 T8 N8 @( o& @
end# y) i5 \" H% Y
7 a. V l h/ H0 c. _$ i% C" ?begin P_pick3 arriving
; k; O4 I) R: c# b set A_i to 21
5 w/ I; x i t- b8 F0 [ move into Q_induct3
* _$ f* r: Q# X6 T" Y4 ` move into pickaisle.induct3
0 U: y9 K7 L7 B1 f- R while A_i<=30 do begin; L3 E3 U9 x* Z1 c
travel to pickaisle.con(A_i)
) Q9 I: h0 A$ \0 n: G# z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( h9 z7 X3 F: h. z' J# Z h! u7 @: I else wait for 10 sec. ~% x( E7 v, H* L
if A_i=A_leave then send to die
$ i6 Z0 K6 J) {8 j" ~; J0 D: g* w else inc A_i by 19 i( Z& Z- V. I/ H7 c
end$ N J$ d: c: @$ }8 o$ b4 C
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,其它按你的 ...
|