|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# i1 A2 Y: L& v3 C! t* `$ V
+ K7 c+ K2 P |% w# Z9 Q7 a7 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中的数值,不知道会不会有什么不妥。) Z! q6 L) e% y( t
/ e1 Y' Y1 J$ X6 ybegin P_read arriving e# h/ v' v% V
while 1=1 do begin
: M1 u ~$ T A. y, ? read A_tote from "data.txt" with delimiter "\n"
4 h" \* u0 x4 W' b$ n read A_time from "data.txt" with delimiter "\n"7 b! H* A3 H9 k6 h0 R
read A_leave from "data.txt" with delimiter "\n"
5 A$ N' J$ Y T+ P& B5 m0 A read A_picks from "data.txt" with delimiter "\n"
0 U: a5 K i& j# { set load type to A_tote
- T" I( b# \" m4 T1 d if A_tote="tote 1" then set A_induct to 1- w5 Q1 @( _$ L
else if A_tote="tote 2" then set A_induct to 2
# Y5 |* D! k* F1 q: l" t/ ` else set A_induct to 3 4 r2 [$ G5 o& d) L
set A_i to 0 ]; ?: f d4 u7 F9 ~0 t4 G
clone 1 load to P_induction' b/ _0 L/ H: n+ C9 k9 X. P
wait for A_time sec9 D" [% I) L. [$ I1 t a
end6 @! K% r+ ` W9 n9 G: k
end; N/ [/ T' H" ~% u+ @1 Z4 R: D
$ d0 }6 B/ ] H, l) O
begin P_induction arriving% F3 V& }$ ~( s) s ^, F2 P
if A_induct=1 then clone 1 load to P_pick1( [+ E% }3 g- E, r; \
else if A_induct=2 then clone 1 load to P_pick2
7 C( k6 w! x( |) D. ]: A( \ else clone 1 load to P_pick34 e4 ?+ u+ Z) ?, n _
end) K, M5 |* q& ]: m0 V
1 w& p' V& K ?, c M/ l) g
begin P_pick1 arriving
) e5 ?0 I8 F0 b y set A_i to 1
1 m" m# o1 R) z' `3 } move into Q_induct11 b% U$ R/ N2 Z$ W; {) z5 v
move into pickaisle.induct1! x8 F" N0 O0 O1 |9 w9 T% G+ L
while A_i<=30 do begin
% N+ \9 F7 Q0 i% n7 X# n$ I travel to pickaisle.con(A_i)
# d* V! L* G, G" ]3 Y4 \+ O% V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% r& f* ?9 I, R# f; W$ S& n
else wait for 10 sec
/ L( t& i& B) W4 s6 Y if A_i=A_leave then send to die
5 C4 f+ I2 w* p0 B8 `% _( } else inc A_i by 1+ t5 O/ n/ k! }
end% G" W; Z. z! D3 ~' X0 Y' \* \- z
end
0 w( o9 }7 M& W5 E$ `7 T
1 g6 q- }, {4 I* Ebegin P_pick2 arriving8 O/ ~0 _" O" O: Z% z
set A_i to 11
, L; {1 ^3 L& |9 S T move into Q_induct2; x8 B, F; P! T- d
move into pickaisle.induct24 q4 q" F }% }) R6 a! Z f
while A_i<=30 do begin
) M/ w" k+ ?/ M7 X) n j$ @ travel to pickaisle.con(A_i)( L+ w) V! I2 L, F$ v* `! `" @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ e) Y1 e! `+ }* p/ r
else wait for 10 sec5 c. U" B5 u% p7 L8 y" m% i8 [0 T
if A_i=A_leave then send to die$ n# W# X' x# u4 B7 B( y9 f$ R
else inc A_i by 1
H: N* d! ^/ r; D end
% M9 ?5 ^# j; Cend4 g9 k- t. u5 G) F. y# V
) ^9 b9 t+ z$ f1 Y- F0 i$ `2 Sbegin P_pick3 arriving
) x# I: _9 ^" U* T& V8 W set A_i to 217 a/ ~+ ?& v" v5 A2 e
move into Q_induct3
" ?5 _( K7 d+ B move into pickaisle.induct3
# |: W2 Z/ R5 d. T2 q* @6 ?. m while A_i<=30 do begin$ f2 d8 G; y- _% s, ]' k
travel to pickaisle.con(A_i)
# Z' A V. s5 K* G2 d( W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 ^% d$ @- O$ Z( L
else wait for 10 sec( o/ q2 p( k E* h
if A_i=A_leave then send to die, a# ] d4 G0 V' v: b" C* E
else inc A_i by 1
. m6 w1 I8 b5 `: g* r) z7 s# U end
+ l- `# B( d1 P# u/ X7 V( u% j4 s" zend |
最佳答案
查看完整内容
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,其它按你的 ...
|