|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: w9 J1 R4 l, {( t
0 e& B6 p+ f" {( D6 \0 L
我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ O F8 e8 ]/ m
1 M4 Z( m9 k: \4 |begin P_read arriving
q- y" r0 ?# r( Q, d: J; | while 1=1 do begin: x+ g; d) h2 ?- w$ x* Y, u
read A_tote from "data.txt" with delimiter "\n"9 d; @; d( H a6 @1 V( h
read A_time from "data.txt" with delimiter "\n"
2 e3 W/ U, j n read A_leave from "data.txt" with delimiter "\n"
, Z) d& k7 J$ v: | read A_picks from "data.txt" with delimiter "\n"! J$ M7 w4 u/ U6 y
set load type to A_tote& b9 k0 a3 q. p% s. J0 ?( q3 {3 c
if A_tote="tote 1" then set A_induct to 15 _) d7 z3 j ^9 o/ j
else if A_tote="tote 2" then set A_induct to 2. b) @. x: V' @" A1 v
else set A_induct to 3 v9 i4 Y( b$ `- W0 R: b
set A_i to 03 T; o6 S. I6 [2 I/ r, W' J& K9 s
clone 1 load to P_induction
: o! ~7 e3 u G; Q% H wait for A_time sec. `7 J; [7 K+ B4 [3 Q: Z. S
end" [- C/ b0 f3 A( ~% k: Y: P% [9 c8 J
end
% R( C d. D4 x* \7 b- q6 A; b9 u: z- i$ s+ c+ a/ [
begin P_induction arriving' t- [1 f4 r* S& R% k
if A_induct=1 then clone 1 load to P_pick15 x9 K- K [: t4 S0 L, L
else if A_induct=2 then clone 1 load to P_pick2$ A8 u4 S$ W$ T& Y' B8 J0 r; I
else clone 1 load to P_pick30 O+ p' r% r4 [
end- \4 ?" |0 D5 A
8 v8 a( P3 n' B
begin P_pick1 arriving
' C) ]4 L6 j; X" I set A_i to 18 d* `- O3 _6 Z6 z6 v0 t
move into Q_induct1* h8 z! s& l1 ^3 S) K: D, W" E1 p
move into pickaisle.induct12 y, _: L9 }5 a0 f+ i7 T
while A_i<=30 do begin
- ^$ I r4 c# k" S% h, K travel to pickaisle.con(A_i)
0 o K* O& f0 r: k1 l if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 Z8 d6 L p7 z1 h
else wait for 10 sec" o% x! f- p: D9 j
if A_i=A_leave then send to die
& v, [2 h" b0 Q0 s else inc A_i by 1+ {5 O+ E- o8 C5 ?7 g
end
3 y k- B$ V# p7 T pend) A6 \5 c! C: `+ `0 a
( w# g/ e9 \( \+ b! u
begin P_pick2 arriving& e) d. H6 Q9 X, |
set A_i to 11
* d, k, Z8 Y# k' T3 Q/ k4 J, n move into Q_induct28 P1 K( p: U$ J9 C, V
move into pickaisle.induct2# }9 y: N6 l. l x. u7 g) A( r, r4 k
while A_i<=30 do begin# i' W' l0 A% H% P* R# w+ g
travel to pickaisle.con(A_i)# v0 m+ s: q6 P Z- w8 m+ ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. `+ Z) E( s* C; \! { else wait for 10 sec
0 o1 ?4 @$ z5 c- j6 y4 q! O if A_i=A_leave then send to die- b8 h$ Q0 C) a3 a
else inc A_i by 1
' G% c0 v9 S# b! r4 k! `( N end2 H" i9 R! v( |" ?. D8 N, M$ Y
end: G- ]1 C- y( ~
+ s u) w0 |# Z9 Y/ Y
begin P_pick3 arriving$ b2 C. R) m5 z- n' {, @5 j+ }% k
set A_i to 217 P) w/ \6 X6 ?( E! L$ x+ J
move into Q_induct3& n4 S7 R9 T7 [) b/ U7 G6 _
move into pickaisle.induct38 p, V& j! D. T; a
while A_i<=30 do begin
6 ~2 u8 O0 L! Q. S$ f+ J- V travel to pickaisle.con(A_i)* V3 ?# x' O% p1 Z, i6 X
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. C- \) ^* o+ B! D: V* T% ^, O+ }, Q else wait for 10 sec# P0 X1 Q% \ H ]5 f
if A_i=A_leave then send to die9 Z& j& t; D5 P, }
else inc A_i by 1
n( G* w, L4 C- f9 x end
( ]6 f8 P5 |# x' o/ vend |
最佳答案
查看完整内容
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,其它按你的 ...
|