|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 a9 [ k& M, q$ {- ~, H
* J4 s4 R( r, ?# M d
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& |$ m) _. O/ F$ I' q; S' F
5 V, ^) }! X+ Lbegin P_read arriving
+ w5 K0 V" ^1 A) |% y) [ while 1=1 do begin2 O. h: {9 S! E$ `8 [' P( t' U
read A_tote from "data.txt" with delimiter "\n"
5 q3 v: X9 T5 Y2 y( ]4 q6 i/ [% V read A_time from "data.txt" with delimiter "\n"2 d( e" b* ]; [ @& V0 F! {. J
read A_leave from "data.txt" with delimiter "\n"
7 I0 O( C% Z7 u f5 ` read A_picks from "data.txt" with delimiter "\n"/ o+ F5 U' O+ {4 f- M
set load type to A_tote
7 Z" k/ S9 T. [ if A_tote="tote 1" then set A_induct to 18 R5 M* M0 v. @+ o& D% t
else if A_tote="tote 2" then set A_induct to 2
. [0 K( N# g( ]0 E7 [" I else set A_induct to 3
2 t, L! g3 V& @ set A_i to 0
, e, j4 {! T1 w* z5 c clone 1 load to P_induction
+ [2 a8 N, k1 o8 a$ V% P wait for A_time sec
$ L. ~0 y8 k3 Y) i end6 Q* d7 Q# O7 @5 \- ^; S
end9 d( B, |8 b3 j3 e& c( {1 l
9 |, M9 I- U* s0 _begin P_induction arriving
7 d4 I7 P+ n" u1 ? if A_induct=1 then clone 1 load to P_pick1
- A3 [; Q3 l* @ else if A_induct=2 then clone 1 load to P_pick2
3 }9 K; R( J" B- a; i8 V$ { else clone 1 load to P_pick3
3 l- A7 q: y/ Y+ l+ v* i( D, pend. ^! }* Q8 R/ x! s' R8 W# o
: `4 u$ Y* x* i( R! _
begin P_pick1 arriving& c. B8 D- x( T0 C) v; c
set A_i to 1
; i; \) B3 s$ x move into Q_induct1+ j% h% G( x# H" d u3 j3 ]0 J
move into pickaisle.induct1: T: j4 g1 |: |6 H9 O0 _
while A_i<=30 do begin, C$ L0 Q: B; y( E1 C3 ^8 e
travel to pickaisle.con(A_i)
) J% G1 p4 C$ N( y5 S2 D+ A2 o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' p2 P0 G# U. g8 x7 O _ else wait for 10 sec
, m7 P |/ i. P! K- ^5 X' { if A_i=A_leave then send to die
# R h/ T/ a8 V5 y: s else inc A_i by 1' I! q& `) @$ W8 S# u0 u& J. F
end, j3 S1 p! O* Q2 v/ V3 V0 Y
end
) z2 f. {# D5 [. Z7 c5 x3 z9 v) M, k% h4 k
begin P_pick2 arriving
1 F4 _/ E! M; C- H& u! i" ?8 ]; y$ u set A_i to 11
8 a) E9 U$ I/ u move into Q_induct2
& e3 F5 n6 ~! [! i move into pickaisle.induct2+ C! v' M; s; z% i
while A_i<=30 do begin
8 W+ N9 ^1 k8 ~" ?, y" T7 r, p7 F travel to pickaisle.con(A_i)/ y4 N9 o# h( P1 v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( z4 V9 p3 h: n8 b else wait for 10 sec6 U* p- \- q1 W- U
if A_i=A_leave then send to die8 e$ |0 h4 G7 h5 P n6 \
else inc A_i by 1 V3 }1 c: Q! i( S6 u/ A
end
/ A5 b6 F: I4 _6 B# r# B8 eend) ?1 Q" H2 l0 P! d/ N( m2 u3 l
, f( O9 `0 v* [) \3 b, tbegin P_pick3 arriving% M6 r& [9 L( m4 r) i
set A_i to 21
) T- H2 _. n- n+ q move into Q_induct3
/ I% o3 Y! |. L7 p! ^0 X* a* p1 C move into pickaisle.induct3
' g/ Z4 K5 b6 c, |$ p7 V% _6 R4 R$ E( H. k while A_i<=30 do begin
6 v4 ]7 o3 C! o1 H travel to pickaisle.con(A_i)3 b9 ~3 F$ H$ B+ o- V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; K9 ]# O1 { |: j$ d else wait for 10 sec
3 Y7 f& l, Y4 D! f( Y' X( N/ I* x if A_i=A_leave then send to die' L) G$ x4 i3 i) x& z! D
else inc A_i by 1( T3 H0 g0 ?$ `/ E
end
( c4 z2 _; C! ~6 w4 T6 Oend |
最佳答案
查看完整内容
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,其它按你的 ...
|