|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, q1 n. B' Q- R2 g# S0 z1 T% a: U; O+ 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中的数值,不知道会不会有什么不妥。' x% \6 z! o1 J4 i6 f0 q: H/ Z
; R8 Z1 U) h" ^
begin P_read arriving
1 h" _3 _) F% @9 f8 t while 1=1 do begin. H* l' T; s/ H2 C
read A_tote from "data.txt" with delimiter "\n"
6 X) R1 W2 b$ \% p% p7 W read A_time from "data.txt" with delimiter "\n"
3 A: D+ P9 T( c read A_leave from "data.txt" with delimiter "\n"# R: r6 U" H) _' ~$ n0 V1 q
read A_picks from "data.txt" with delimiter "\n"" O7 i. r* h9 V. [8 x/ N
set load type to A_tote5 {' L% G( t# Q' O* w& b/ c1 P& G
if A_tote="tote 1" then set A_induct to 1
' c5 j' T& X0 y1 B- _, O1 b* F else if A_tote="tote 2" then set A_induct to 20 Q. T$ m( O$ P
else set A_induct to 3 . ^- I7 ?$ b/ z$ R/ c3 w f8 X
set A_i to 0
; l9 J0 u; r& r1 a6 W/ |' `' [; r clone 1 load to P_induction. ]8 F( N8 w* P/ J, K
wait for A_time sec2 W' d5 c& R: A1 S- W
end# k6 o& {# B, d) w$ i
end" j7 Y8 z% j6 t6 N
G" }4 L! E' }( ]' r! x5 m9 \* qbegin P_induction arriving1 M' B4 Q% M. ]! Q2 Q% S! K
if A_induct=1 then clone 1 load to P_pick18 g& p: E0 s% }# _% m; q) o: n
else if A_induct=2 then clone 1 load to P_pick2
+ {6 K0 F9 I4 j7 h9 t. t( k else clone 1 load to P_pick3
7 c+ v' {, L5 B D1 Q* x' m% Tend
: B; p+ Z. P; B, |( W3 W4 {7 L" o. G2 n" n- g0 a( V/ d
begin P_pick1 arriving
, _% M! r$ Y2 q( z f8 Y0 T set A_i to 18 h3 R, v2 ?) \/ E4 G) H1 d
move into Q_induct18 o, @2 ^7 w; U" U
move into pickaisle.induct1
- M& q0 M/ {/ k, I6 Q- o! y while A_i<=30 do begin
* C# S$ |# Z* k2 e$ C* d4 T! g; _/ s; I travel to pickaisle.con(A_i)8 A" z2 ]9 Q6 M. V: v' n" R" t$ U
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! V9 E$ B# k5 O) _7 ^4 O/ P else wait for 10 sec
) L8 |0 }* c7 h7 [ if A_i=A_leave then send to die
2 b; n9 n& b4 Y else inc A_i by 1
5 s; K2 b' H% N4 D end
9 F! `% \- i( R1 G" H; rend
7 h2 x- B- O- v' q3 d* G z: z# u: F" D/ T( p5 U$ v
begin P_pick2 arriving6 @2 Q% A0 ~5 E4 g; n
set A_i to 11; T1 c+ X/ J5 N" q) J
move into Q_induct2/ F( @8 s% g) A9 M
move into pickaisle.induct28 Y" d2 L% g( G- o
while A_i<=30 do begin
4 U1 w. X: q: ^! ^9 j) n+ s0 s* Q travel to pickaisle.con(A_i)7 _, B, S4 X% C9 H0 ~: Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' M+ c2 O1 h, u* g0 \ else wait for 10 sec s F! w* F6 f: L) L" @# q
if A_i=A_leave then send to die
" p( X( c5 b* l' {$ G0 ? else inc A_i by 1+ ]# E; u* _2 W4 n/ A' U
end
) U5 q% x v# Qend
* F* k4 u- [5 h0 i4 W; [: U
+ z9 l5 p+ l* H6 @; xbegin P_pick3 arriving
1 E' \7 {4 e7 ~ set A_i to 21
3 R- N# `6 d) ]" R( b1 B) d# T6 e* J move into Q_induct3
s- q' y& \) Y8 \* W move into pickaisle.induct3
+ j* S# C0 F6 i8 O, R! W0 g( P* d while A_i<=30 do begin
5 }& E+ i) {2 t6 v: g0 o travel to pickaisle.con(A_i)- i* [5 o3 s7 W8 X! ]. [! \1 ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- H U7 j1 o6 R) p
else wait for 10 sec0 G& i2 G' b& V/ o0 L* f
if A_i=A_leave then send to die
- m! c$ b: `' x$ B+ ~+ @ else inc A_i by 1
) Z2 z4 M$ l4 w% r: N end2 o5 U; M* d8 Y& g- @8 i) _
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,其它按你的 ...
|