|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 j2 Q9 P5 p/ @7 t$ _ j+ p9 n( a
- l0 h! _' o" d* P8 R, G+ f
我的问题是,在每个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中的数值,不知道会不会有什么不妥。; k. i. \9 J; V8 M% {9 n% H
; {! u8 i% Z9 z2 X2 u( I( Cbegin P_read arriving
8 ^, g' p! |& {! A while 1=1 do begin' r0 t8 f' W8 ~" E
read A_tote from "data.txt" with delimiter "\n"$ p9 M( s0 l; [' S: L
read A_time from "data.txt" with delimiter "\n"
" d1 u5 v* h0 u' k T8 R4 D read A_leave from "data.txt" with delimiter "\n" E0 P2 z& L& ?. m# N+ P
read A_picks from "data.txt" with delimiter "\n"8 ?- ~# }+ j1 p/ ^4 ^# S
set load type to A_tote8 x2 e, D; ^% T) W' {
if A_tote="tote 1" then set A_induct to 15 A9 i8 W9 Y) w# n' V
else if A_tote="tote 2" then set A_induct to 29 Y8 O3 h4 N1 o$ A% M1 Q5 u
else set A_induct to 3
; q1 A4 ]# f0 r5 r7 h" w set A_i to 0
8 m: b2 N+ d$ y* `2 |% V clone 1 load to P_induction, i( C, S$ v+ g1 V2 W7 ?
wait for A_time sec
' D4 o. L. z3 n; {9 O8 c2 ?$ ^0 ] end
1 ^# i7 N, K: |1 Xend
6 `2 X2 U$ H6 l7 D( Q8 k% G2 V4 @+ S2 g" @4 R
begin P_induction arriving% v% j1 M+ l. ~9 `; }
if A_induct=1 then clone 1 load to P_pick11 d2 v. `% s: z# b, [
else if A_induct=2 then clone 1 load to P_pick2/ F; n+ b9 T/ P% U3 t- i8 |, u# }
else clone 1 load to P_pick3
* S8 B" p# y. {8 l+ v9 cend& r% b% h8 `! n; g! x7 |
7 |' b' j% _( N4 v' Mbegin P_pick1 arriving$ K# Z- a0 ~" f ?4 [
set A_i to 1
. ]2 B( z2 I/ p6 C( T$ j7 E move into Q_induct1
+ S: F& p$ F& g3 R% b. n move into pickaisle.induct1# i* w( r4 l' ^1 X4 X% x) A% D) e
while A_i<=30 do begin7 U2 T7 f, M' O8 y& r
travel to pickaisle.con(A_i)2 S* R% C8 x- W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 P" X) U% V* c h( ?. z else wait for 10 sec
+ k. l8 G, e& Z( C. w& T if A_i=A_leave then send to die
- h! e# c# \+ x/ u" M else inc A_i by 1; @& ]5 u7 q2 T0 O
end
3 f9 f: c5 ^+ \7 dend
$ f4 q! X- J4 u/ Y$ w! J) m9 g" S3 C1 |( ^
begin P_pick2 arriving# {3 z% ?( @2 B4 P
set A_i to 11
7 _# @9 t) R- g5 b$ \; X move into Q_induct2$ k. V% C4 c n/ n0 L
move into pickaisle.induct2% }, J3 u" A! s1 U9 \5 a
while A_i<=30 do begin
% |; h! u. K$ H# @3 x" S travel to pickaisle.con(A_i)2 O3 _( N7 R0 j* s" m7 D2 m3 O& P# I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 n7 J2 l: v) \* R$ X: b else wait for 10 sec
: h" _0 ~# D' C) L9 K( m if A_i=A_leave then send to die
, ^. W* x0 U1 b! Z) J' W4 K; R else inc A_i by 1
2 n4 g0 z8 Q7 z4 z end
2 m8 Q) ]; S6 W: V# jend6 _0 b$ e* `# k% a, U2 a3 p
' h) o( l; b2 m6 Y: t- n) a! z. M/ E$ ]begin P_pick3 arriving3 s! P9 c. m- L a6 u
set A_i to 21
7 G* h7 c; p3 Y% W6 { move into Q_induct3
W% y/ n5 }+ R! O+ c; ~0 T4 Z/ F* l move into pickaisle.induct3
+ b3 k5 v8 @! O* { while A_i<=30 do begin- V; r$ t1 b7 X& I2 h
travel to pickaisle.con(A_i)
# x+ E2 c# y6 ~; O/ p( A3 o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, F; X! b' h1 f. ?
else wait for 10 sec1 F4 p0 j1 {/ U% e6 `1 [8 q
if A_i=A_leave then send to die" r3 ]9 \' q N2 G! V/ B
else inc A_i by 1( ]6 O8 M4 O; V: o. w
end
5 Y) Y d* J9 y) Q) wend |
最佳答案
查看完整内容
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,其它按你的 ...
|