|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 g7 e j9 R/ x. ^0 }/ y5 m# N# S) U" E
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ }- K1 P7 B5 s7 S
* J3 c" ^# t5 Q" Sbegin P_read arriving9 H( u$ n2 h, x" A
while 1=1 do begin
3 `7 G% }. Z9 [% Z0 n read A_tote from "data.txt" with delimiter "\n"+ y& }5 z( a4 c; Q& m! v1 J
read A_time from "data.txt" with delimiter "\n"
) Z" m5 s' c% k2 C7 a read A_leave from "data.txt" with delimiter "\n"
2 Q5 v# l6 O/ ~6 p read A_picks from "data.txt" with delimiter "\n"
+ u% ?' P) V3 y+ ~$ D9 R set load type to A_tote
. r3 x% j* z; ^9 Y2 Q/ v: a* B if A_tote="tote 1" then set A_induct to 1- k% R [* P4 ]
else if A_tote="tote 2" then set A_induct to 2% }( ?9 G. U1 S' x
else set A_induct to 3
* ~/ q6 P" I: v0 T8 C$ { set A_i to 0" q5 c1 v c$ X% h* g' h v0 t; B
clone 1 load to P_induction
0 A! M4 b4 K& ~% C8 ^ wait for A_time sec
b$ B# _5 q1 {, t' r9 @ end" l3 Q0 Z+ k7 ^1 Y! v# @$ `
end% ]0 J# b4 D9 s7 _
9 T2 t0 q8 p4 l- I) e" r
begin P_induction arriving
: H F5 Z u6 X6 e" o3 F" | if A_induct=1 then clone 1 load to P_pick1" U) G5 ~( \- c& C2 ]/ g
else if A_induct=2 then clone 1 load to P_pick2
7 u* U& `0 o8 k6 L: L A else clone 1 load to P_pick3- V3 D$ X0 S. y4 Z% z/ C! \- e
end
( Q& p- v! ]8 E0 J9 C2 t; _( _
- i" a0 k# }! Q0 vbegin P_pick1 arriving4 _: S7 p8 ~- O/ d; A$ b3 _8 C9 d
set A_i to 1
, [6 _# y Z; E5 t! }4 A move into Q_induct1- L; h2 n$ w6 b" x( z) W$ ^
move into pickaisle.induct1
: s8 ]6 N" @% S. R7 B- u while A_i<=30 do begin. }6 O6 W8 b0 \! W8 q2 [
travel to pickaisle.con(A_i)
. r& s0 Q! B5 `- Q% _5 f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) O. G4 I1 i* |; M else wait for 10 sec7 c C8 x% b; _
if A_i=A_leave then send to die
8 e5 _( W9 `) ^ else inc A_i by 1
7 z4 { e7 \& a: o end. {% U0 H) A& h5 r+ R3 q
end
, d: P5 b8 [2 F1 l2 M: l3 V7 @
0 m1 x& N* L( c& t& Pbegin P_pick2 arriving" `. a$ |) S+ t# s
set A_i to 11
: J; W5 x& E Y6 n move into Q_induct2% p0 \% o$ V% g& q$ }7 f
move into pickaisle.induct2
5 p- k! P1 w" ^* V, X6 x8 I4 X while A_i<=30 do begin& ?3 t) q7 N6 x# V$ e; O
travel to pickaisle.con(A_i)+ a- \0 S7 e$ w, E9 ?! c+ P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; K( u; v1 R# k
else wait for 10 sec& f" M* X) v9 T; W5 N' i
if A_i=A_leave then send to die
+ r$ Z, K, `# y else inc A_i by 1' w$ N8 c+ I. ~0 u- t6 P% T- e% k: V
end% p2 p# Q* M7 A( g8 U% J
end4 u' R9 T: P+ }9 I L- Q* C
2 ~. y. k1 P' u8 F0 N* l- e: ^& T$ N+ h" D
begin P_pick3 arriving
{1 Y2 J( s& @2 P% ?- ~1 ? set A_i to 21, q+ [! z; i! a2 M/ [
move into Q_induct3
3 u6 \, U& C d z' A move into pickaisle.induct3' W# c3 ]0 K9 i* M4 t0 c
while A_i<=30 do begin
5 D1 d: d. M& w& t5 X3 Q& v travel to pickaisle.con(A_i)
$ \0 P+ F) v- Q! u6 j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 J, h$ {+ D8 F# l6 D
else wait for 10 sec
6 a8 @3 ]8 E0 s! Q) |( C# Y if A_i=A_leave then send to die* m1 z+ y8 W* L2 P& G9 j
else inc A_i by 1
2 l: L/ G" o7 z( h4 o! t! O! ~ ~ end* {. b3 X0 S# ]2 I: B- u
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,其它按你的 ...
|