|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 w6 \) I. r/ M0 b% M4 F7 B
7 `% h$ }, {- `8 w
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 l0 D& ~' e; [2 x/ e5 b3 g1 W- J( G5 Y' o) [6 W1 O
begin P_read arriving
1 I# t' s9 ~, y) w E2 z* t while 1=1 do begin% i! n+ k K& x% h# P) c$ |5 I
read A_tote from "data.txt" with delimiter "\n"( L2 {0 U+ ^" J! g; L
read A_time from "data.txt" with delimiter "\n"
" ^5 Y- e8 ~) s7 } read A_leave from "data.txt" with delimiter "\n"; [0 U9 [& {; M, g* L4 W# f J
read A_picks from "data.txt" with delimiter "\n"8 B& m) }% d) U
set load type to A_tote
: [- j% ]- @- z- m- A- K9 B8 t2 K: f if A_tote="tote 1" then set A_induct to 1
( b$ o6 a7 w3 P) e7 a else if A_tote="tote 2" then set A_induct to 27 L; Z2 i$ R( v; Y' \
else set A_induct to 3 + A$ n9 U/ D- Q. F
set A_i to 0
0 C. o0 l3 O( g7 y6 E$ H clone 1 load to P_induction
/ M" k o7 O! X L wait for A_time sec
: I6 C4 T& ?5 _! G+ L5 q. w5 r end
, L/ b. t& b9 A" n2 w8 P0 c' _4 zend
: L/ J! H) ]8 T* \" g" N* C" C/ j2 |7 k: E0 y
begin P_induction arriving
Y$ M, q4 q5 {* H; A if A_induct=1 then clone 1 load to P_pick1
) c& h" L% O% ~* q6 {( u else if A_induct=2 then clone 1 load to P_pick2
; e: g" o# D) l. M# G2 Y) U else clone 1 load to P_pick3
( w1 c1 x& H0 K* w% V/ N; X7 yend
8 Q) M _! U. N' O! @4 X
, O. O n5 V* hbegin P_pick1 arriving, `+ Y K, \$ a l+ k+ Q+ N2 { w
set A_i to 1
0 m" {/ M6 l' s3 x( C3 R6 e move into Q_induct1
* K+ E! s8 H: V6 ~+ t3 b" t move into pickaisle.induct1, ?* Q2 R7 t) Z" _
while A_i<=30 do begin% G e) p* g% W: ~
travel to pickaisle.con(A_i)
) x% b B' ~- z! p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ r0 ` K z! S* {5 E
else wait for 10 sec) f. I1 t! [5 V
if A_i=A_leave then send to die- I$ ~% O; H ^9 h J4 n" V _
else inc A_i by 16 ?( k" ^1 B& i& C0 ^9 B' W
end1 |: _, ^8 w) C7 `
end4 e% @0 \+ t/ p2 u4 T
4 K+ V7 q" Z4 pbegin P_pick2 arriving3 d5 ^8 }; y+ J1 o2 ^# `
set A_i to 11
5 g# L( r& U2 \, X move into Q_induct2% T3 D( t C6 J) r4 o( R* g3 `
move into pickaisle.induct22 a/ i6 u! D6 K8 G
while A_i<=30 do begin( t$ ]% e) @) `9 z L
travel to pickaisle.con(A_i)0 ^- y4 f0 H! f( J0 B9 d
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 A# @* W; q" h- W
else wait for 10 sec
/ Q2 d% _0 v: I' `8 m if A_i=A_leave then send to die }) h) R. K" s
else inc A_i by 1
' z/ t$ v0 o, Q end G3 `+ P7 x1 b! X
end
& T2 v2 N6 z/ U: Y3 ~+ ~) G2 v! Z) s2 |( P, p: I4 o# H" x" v3 e7 P
begin P_pick3 arriving
. J) Q4 \+ |$ a. O8 U" q# H) Z0 j) v3 h set A_i to 21
4 V5 E# n% s; N6 b$ Q- \! v. {$ [) H move into Q_induct3
$ h$ [0 x4 s2 ?# k& J, k move into pickaisle.induct31 `; A( K) O1 M" U* x1 z
while A_i<=30 do begin# j1 R/ k$ k8 j/ ]8 r- B6 w2 ]
travel to pickaisle.con(A_i), G- l1 [4 V2 ] j/ e6 L- k* H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: v: @; ]8 R7 h: O+ { else wait for 10 sec
3 E2 E/ E! w, ^( Q: j3 I7 E if A_i=A_leave then send to die
. }2 [' C7 {$ c: b7 B; c else inc A_i by 12 m1 Q/ b/ j' C
end
- P9 g& ?, w ]0 S' _) ?: j, Bend |
最佳答案
查看完整内容
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,其它按你的 ...
|