|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 k* I5 J& N: U" x* |! ]6 `7 y4 |
8 v) u9 N: a) \4 G' h
我的问题是,在每个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中的数值,不知道会不会有什么不妥。; q5 L% [" h* c P7 ~* } \
: F" _& Y5 `' r$ r+ u+ z% W0 j
begin P_read arriving! a; G8 J, }4 D& _
while 1=1 do begin: ~- D, x0 W3 [% y0 ~* {% F! H/ C6 c
read A_tote from "data.txt" with delimiter "\n"
: }: p0 m9 J. u+ { read A_time from "data.txt" with delimiter "\n" A0 w: o0 \) C; m, g
read A_leave from "data.txt" with delimiter "\n"
9 l4 o" T' f& d; y read A_picks from "data.txt" with delimiter "\n"
- z( e( K; Z4 N; r F ] set load type to A_tote. J1 ?9 g8 ~; c
if A_tote="tote 1" then set A_induct to 1- P! ?' q% S1 j) S0 y' I% o+ m, E
else if A_tote="tote 2" then set A_induct to 2- ?/ M0 [; _" B7 L* x2 E& j: [! E
else set A_induct to 3 8 ~' f+ @8 f4 }& X* o
set A_i to 0
0 U# R3 X+ W3 _8 j clone 1 load to P_induction; V6 U- E% a, s( D8 B" S
wait for A_time sec
* M$ H: w( V! e( S: ~- F$ Y7 G end) \% S4 U+ k. a# o, J8 g6 ]
end# k9 d8 k H- Y, k9 H
. [1 d7 ?+ D- p
begin P_induction arriving) d; g7 f3 ^- x9 L
if A_induct=1 then clone 1 load to P_pick1& @- t. v& @! L" B* O- k0 V b6 R
else if A_induct=2 then clone 1 load to P_pick2, I8 a$ _4 ^7 ^ ]$ _% E( v d
else clone 1 load to P_pick3
; z+ i Q6 G8 _+ v& `9 H; wend
8 M% V! |, u1 n* `6 F$ `' F+ }( O7 C9 P5 X, ?3 @6 X
begin P_pick1 arriving
9 m* |- \7 p! e9 B1 C0 K set A_i to 19 y* t/ @" ]. W- ~7 L& w- X
move into Q_induct13 o' J. N0 _, }8 r
move into pickaisle.induct1
4 y Q3 `+ \6 a! V while A_i<=30 do begin
( M0 }. G! c. b! A# g travel to pickaisle.con(A_i)
/ U5 u. U3 i9 V- c) d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ w0 ~) J$ g+ H& ^" Z2 k4 b
else wait for 10 sec
' `6 Y+ k% p, |$ t if A_i=A_leave then send to die
- u. p s# F2 _' j else inc A_i by 1; P, S; N: l5 A
end7 _% o: {+ m& x# S
end
/ T- L- Q: y% l! D% G: B6 Z; n0 a
- m5 V# r7 S7 g# b7 B4 Ubegin P_pick2 arriving- Y) S8 ~$ [& ~. @1 B9 t
set A_i to 11
: m) l' B% ~ k$ V move into Q_induct2$ @) e R6 Y. T4 X- U$ {/ I
move into pickaisle.induct2
. I$ ?2 _! z8 r5 F while A_i<=30 do begin0 z* F4 R9 h; A5 \+ U3 Z7 |
travel to pickaisle.con(A_i)
+ g. G) ^" i; v# C: l if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# B# Y, x. i; G& z4 F! |. _ else wait for 10 sec
6 D+ g0 o) A) f1 L+ @& y: L6 b if A_i=A_leave then send to die: O9 I2 k6 R2 u D, ]4 A$ E
else inc A_i by 1
3 X/ S5 I4 G! Z' @. p: T end
# |, B7 d) [0 ~0 f8 hend2 z s1 e# u# H) {2 [1 ]
0 t+ P3 R7 a: ]- Ybegin P_pick3 arriving
9 L+ D; G! h/ e! _3 R. m set A_i to 217 s1 X+ w+ I0 B
move into Q_induct3
6 V6 E( P- k, a* } move into pickaisle.induct39 B7 [$ P& I) }' V/ N
while A_i<=30 do begin
9 |; {9 \$ n4 Q \( K: S7 D travel to pickaisle.con(A_i)/ X* u& j0 F9 K
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 W: e. u0 A) v/ p else wait for 10 sec
, x0 W: X' v9 u if A_i=A_leave then send to die
0 S; O+ y7 M) ^ else inc A_i by 1
( `8 a9 y, t8 N1 Z/ ^ end
4 z! S8 d7 n" O- 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,其它按你的 ...
|