|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 Q! J# O' ~8 U) v* I& `* w1 f5 Q8 U0 I- S7 l( K. \1 o" v: 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中的数值,不知道会不会有什么不妥。+ {; }- K0 ]3 l4 k3 P! W5 l
. W1 A4 U1 q1 n' n' _+ t# \
begin P_read arriving
( l8 L* F, z! ]: _# |0 _( V0 [ while 1=1 do begin
, R" x g5 ?1 m, L: | read A_tote from "data.txt" with delimiter "\n"- ~) B U, l; R% X
read A_time from "data.txt" with delimiter "\n"
/ c- g9 k" }6 {- t e read A_leave from "data.txt" with delimiter "\n": Z$ O" S9 P- R+ }" G
read A_picks from "data.txt" with delimiter "\n"6 Z( }! y, Q* b
set load type to A_tote
( s" m9 i% O5 f7 ^* { P* z% o if A_tote="tote 1" then set A_induct to 18 D- ?7 v/ }+ S& {: _, m
else if A_tote="tote 2" then set A_induct to 23 G8 ^1 u$ E- Q" a. s
else set A_induct to 3 ; [' _" p8 H8 }( F6 P- Y! a
set A_i to 0
2 ]4 E% j3 U1 ^+ B4 \3 G/ X& X clone 1 load to P_induction
$ ]. f& R5 M8 h* L# z9 `3 ^/ d wait for A_time sec, U% ?/ i0 ?" n7 m
end3 E; Y$ e4 X# W$ c
end
* i! ~$ H- t+ C Q- D; s. c/ Q. W8 b- R3 s9 H" n
begin P_induction arriving
: m8 ~8 W# [ j" e if A_induct=1 then clone 1 load to P_pick1- E8 m* B. k# S% D( g9 X
else if A_induct=2 then clone 1 load to P_pick2) R4 I/ Y( V5 x+ D# u @+ I
else clone 1 load to P_pick37 i0 C9 x6 F' _2 o- s9 I
end
4 w2 {8 }5 U" ?2 Y1 x4 N) P3 ~/ m! \7 M: S
begin P_pick1 arriving& `4 F. L! ^( L/ ]
set A_i to 1
/ K7 V$ [, v C* z3 J/ f move into Q_induct1% S! a/ m$ t. H& [+ J
move into pickaisle.induct1
* q: \6 U) q: T9 q while A_i<=30 do begin
7 N: X1 Y ]( _$ A6 W1 q% _ travel to pickaisle.con(A_i)
( S8 U; g* V7 _. l+ m. ? if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ \+ o7 r% e6 @6 H
else wait for 10 sec
8 ^# o: H: V! R$ \: {& r8 J3 H if A_i=A_leave then send to die
0 |4 w7 N( q( k0 b" T else inc A_i by 1% Z( f; ^! F9 q4 N
end
9 u. _: C1 @3 ] q8 E% K6 L: |end
4 W; c5 h9 @7 o4 y' Z7 \. y; h1 D0 b/ B9 F
begin P_pick2 arriving
& M( N, J( r0 P- r( ?! Q: Z% n$ { set A_i to 11$ t! ^( \5 K2 h5 F# ^, j
move into Q_induct2
; `# v6 |7 d2 Q move into pickaisle.induct2. p4 n4 {, q$ H6 H: J m# q
while A_i<=30 do begin/ n0 E+ V( X9 a+ U4 O* Q! ?& \
travel to pickaisle.con(A_i)" B7 u, r) f5 N% m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ N+ n6 }. _, [! k8 J else wait for 10 sec3 k: q3 J6 r! w( x6 p7 `: E
if A_i=A_leave then send to die
* S8 U, f2 a/ D* N& J0 s* T$ Y else inc A_i by 15 F3 z! a6 K! \9 Y6 v, o! A
end
! h. C6 }3 j) @0 Uend3 F# L0 x8 w+ {5 \3 j: |; ^
$ e2 Q5 H* v9 F/ F0 ibegin P_pick3 arriving t8 }) b2 ?2 }# p, m
set A_i to 21
% M) C8 W2 ]1 \0 ` move into Q_induct3" B1 v& F! S+ L9 M
move into pickaisle.induct3
h& `5 z) f! e- z while A_i<=30 do begin/ Y! o5 p. O+ n- q
travel to pickaisle.con(A_i); n# l, g' t c' g" w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 O( L- y6 o/ l9 w3 n else wait for 10 sec
. h Y; y; @2 B, ^ if A_i=A_leave then send to die
8 U. C0 J4 U4 {1 y$ }' M6 s else inc A_i by 1
" a6 Z: I4 Q" e$ i end/ T g5 o9 ?# h
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,其它按你的 ...
|