|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 `4 d/ z1 i+ u5 q- F" N# m- W0 L
v+ w( t1 ]2 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中的数值,不知道会不会有什么不妥。
2 @3 u3 p5 b. A( ` h6 G: q( e) Y% O F z
begin P_read arriving
! g, z& I. u/ O- n/ E) J) W while 1=1 do begin3 a! l/ _1 i" a( `0 H7 l
read A_tote from "data.txt" with delimiter "\n"
( U! N& K1 r( } read A_time from "data.txt" with delimiter "\n"
" g/ r# V2 Z6 M5 R2 e3 c6 @" i1 u read A_leave from "data.txt" with delimiter "\n"
" u% U2 i( K! L! I2 f( s read A_picks from "data.txt" with delimiter "\n"& k# \8 ?/ C- s
set load type to A_tote
# V6 y8 F1 j% r if A_tote="tote 1" then set A_induct to 1
: a) |" a: r9 [& `" ~) z* N5 V else if A_tote="tote 2" then set A_induct to 2
6 `- M( J7 u) g: N8 {) J6 u7 L( w else set A_induct to 3 $ N' J1 O" S" z5 G9 H# r
set A_i to 0
4 v p- v* z) `" Q0 B& F clone 1 load to P_induction4 P5 w5 r G! D( ?' R6 S# Y1 N
wait for A_time sec
8 ^# Y' R3 j: l( w0 {* |1 T# v- F end
5 j8 o9 `9 j g, Y. q* p* nend G% w, L2 l- k* B) t0 j
5 C9 Q: Q, L+ O) v. @
begin P_induction arriving$ M" L$ l5 L# ]1 p [2 F7 B5 t
if A_induct=1 then clone 1 load to P_pick1
! h: s, _! `2 D) c2 _8 ^ else if A_induct=2 then clone 1 load to P_pick2, ~. A% E7 p% C; ]9 B
else clone 1 load to P_pick35 U( }9 t" `9 S, Y
end
M* ] F, {9 ]& }. g, {3 a
$ ~, L- Z; I- m8 R! ~6 Bbegin P_pick1 arriving
" f9 T* x+ ~& ~3 \ set A_i to 1
+ m0 i2 }! y3 R8 U/ V move into Q_induct17 k* _- ^# }4 ]1 X3 t
move into pickaisle.induct1
3 ~+ o7 L8 V: i while A_i<=30 do begin
! h3 K" Z/ R0 d5 i travel to pickaisle.con(A_i)
4 G; ^1 _* f1 n. a: G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 i8 c) H# S& k1 \( j# D$ v
else wait for 10 sec
& X2 }/ E% c3 V; d( U if A_i=A_leave then send to die1 N/ O$ C( |) q3 n! M: z7 P) d
else inc A_i by 1& K/ N0 |0 {1 |5 ?+ q: f
end
8 h8 @0 O P" a7 J, l @% d, w, ^end( V0 R% H w, o" m
0 H9 ]2 [9 ]8 W/ a8 g0 {$ cbegin P_pick2 arriving$ Y( B3 O7 D* y8 Z9 E! P
set A_i to 11& W. n7 l. `/ ]1 `" }
move into Q_induct2% j' Z( u& H& e6 ~% f: M) G
move into pickaisle.induct2
8 h! k) w! l# L; ~2 O$ @- v while A_i<=30 do begin
0 ]% x9 ~/ q0 T travel to pickaisle.con(A_i)6 W9 `6 U) K6 q1 k# @) e1 @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ ~0 L) N C9 ~" r! \2 h5 T9 o else wait for 10 sec
3 [9 |/ Q2 d1 o) |$ Q" n if A_i=A_leave then send to die
0 [+ V3 R$ V7 |3 f) v8 U1 ?# K else inc A_i by 1; n1 h; e$ c5 {
end
& Y* Q I& w9 V; Qend
) S+ _% Y* F% R5 u& r
: Y% h. K& ^2 C( |- h9 fbegin P_pick3 arriving
" S- J! X' T3 l0 C& ~* Q# f$ q set A_i to 214 n: G |! f8 m
move into Q_induct3
/ h* u" v0 H3 a5 B+ V$ D* J y move into pickaisle.induct3/ c& B2 b- B/ d1 S
while A_i<=30 do begin
# `" p2 B5 L2 q7 m9 ^7 Y travel to pickaisle.con(A_i)
9 ^0 g" W, i5 ^: o b. ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 z ?/ ?. f r* P& G else wait for 10 sec- E' p0 a, `1 S. v0 s8 n
if A_i=A_leave then send to die
( ~5 w- u0 A6 ~& w+ V else inc A_i by 1
; p0 g- H4 v, ]1 ^% m. | end3 Y' ^0 z3 ]' ?& d5 @9 \# 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,其它按你的 ...
|