|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) B, M: m3 e- ~* r& w
: s) c- k* Q: l
我的问题是,在每个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中的数值,不知道会不会有什么不妥。 z. T6 U4 b, m$ {6 }; f# B( i' v$ ^
* @1 G/ B2 G2 e$ f8 r8 Z4 H3 Jbegin P_read arriving5 K$ S+ v- O0 W7 ?, O2 U
while 1=1 do begin- b6 E( H9 V# f8 x7 @0 b
read A_tote from "data.txt" with delimiter "\n"7 j2 K7 o% p& Z8 i6 ]. ?
read A_time from "data.txt" with delimiter "\n"
( I0 h' d# Q& J4 r' d" i; D9 j read A_leave from "data.txt" with delimiter "\n"5 B* D( I" M- R6 F! J' n. U
read A_picks from "data.txt" with delimiter "\n"0 A5 x1 s5 x% O9 b& x; b
set load type to A_tote
[) F2 z1 K+ g4 \" F& Q1 e: [- X if A_tote="tote 1" then set A_induct to 1
7 Z5 z" I T6 \- j2 v. ]' Z else if A_tote="tote 2" then set A_induct to 2
+ G7 G) Y6 h1 H+ B6 @; C B& | else set A_induct to 3
& D8 O5 o1 N2 R) E2 e4 q% N5 w set A_i to 0- s2 ?; U6 `, r! z% Q5 \: c' _
clone 1 load to P_induction( v1 W% l- @0 `6 X; e. ]- C, X
wait for A_time sec% F- V! a' E9 i* z, _+ ?
end" L5 U1 J5 {* H1 m7 a
end1 o$ ?$ m, j1 o& G
+ \9 Q4 Z5 N+ P& ubegin P_induction arriving
4 B4 E) v9 n( Z if A_induct=1 then clone 1 load to P_pick1; y8 ?$ V; S, u& B( y* I9 A
else if A_induct=2 then clone 1 load to P_pick2
5 V8 |, |; t0 @0 A; b" A- ], {/ Q else clone 1 load to P_pick3
! m& c6 w4 L/ cend+ m- g2 ]" y8 j
" _* G# `3 ~# a. Sbegin P_pick1 arriving
1 V/ P8 w ]; L6 N# V0 q set A_i to 1
1 y2 A( Q) ^. I4 A& x$ A move into Q_induct1+ C0 x: p2 [7 |7 p8 S+ E6 `
move into pickaisle.induct1
6 U" l' v- y Y% a8 \ while A_i<=30 do begin
. n; c y4 s d! A' c2 ~# ~; h travel to pickaisle.con(A_i)
" z+ [ t8 V5 b/ | ?8 s; {0 X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 i& {( q6 {( l' z- t( Z" Q
else wait for 10 sec/ V% E/ L' Z$ w
if A_i=A_leave then send to die, k8 {; R. ~! m, l- P. p
else inc A_i by 1
4 L& W- k+ a! o end) d2 u& l& I8 M8 D
end* _) q1 _) u. j
# M5 q9 p/ P. \% U- Dbegin P_pick2 arriving
8 P& }1 T. D1 L: a2 X( _, d4 U set A_i to 11
# v# l8 ~4 L! l8 _ move into Q_induct2
7 T8 L! _' O* a2 D+ y5 B move into pickaisle.induct2
4 G ]0 z* i B$ U while A_i<=30 do begin/ I1 E4 [1 p% A8 e8 \2 Y8 m3 s+ x, J
travel to pickaisle.con(A_i)# T% j3 m* r; N2 _
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
i. D* j4 F" M else wait for 10 sec
( {% U8 K! A+ P/ E7 o+ [5 L if A_i=A_leave then send to die* w- G' s }5 H" y8 l( e! `
else inc A_i by 1
' n" E9 @3 D1 A, Q! m ]" n( K end
2 @ ^0 d' C9 @, G+ N$ P7 |0 Vend: h+ `! `; f3 q; N
: N, {. s: g1 v8 e
begin P_pick3 arriving( P4 c% U, K$ ~$ `) n
set A_i to 21
- t; A( r& j. ? move into Q_induct3
1 U4 y6 r0 t3 ] c1 a+ n7 o move into pickaisle.induct3% ^$ x B3 g( q! a. B9 p+ S
while A_i<=30 do begin
% i4 r8 q0 d2 [. B travel to pickaisle.con(A_i)! ^ p" l& @+ R0 y1 _' _# ^6 z, [* {
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 F* B* k# m' H' h else wait for 10 sec
1 g. `* g) Z& f3 ~8 G0 a1 K if A_i=A_leave then send to die
' ~/ J( Q" b# E! M- g else inc A_i by 1
* W# c) `$ v7 s; b( Q end
0 Y$ S6 B5 q) ], V. `6 g( g6 d. J6 Qend |
最佳答案
查看完整内容
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,其它按你的 ...
|