|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ e( F d# L" g6 O" X. U- _2 A: J
8 t; z0 g1 w6 ?: i( N) n我的问题是,在每个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中的数值,不知道会不会有什么不妥。; k9 m4 i0 g6 |
% N7 N- y8 P9 _3 |9 a' p0 K; K% J6 k% R
begin P_read arriving
7 k: J, ~( p/ t) s O while 1=1 do begin w+ H& B0 ` B7 i# r$ I R: N- J
read A_tote from "data.txt" with delimiter "\n"
1 H1 T" J( g( n- ]( ?- ~6 o read A_time from "data.txt" with delimiter "\n"3 }! Q1 \6 P7 D
read A_leave from "data.txt" with delimiter "\n"
, c4 M9 U/ n# n8 C6 v. X j read A_picks from "data.txt" with delimiter "\n"
2 w) ?: [0 ?* P8 r set load type to A_tote
4 G! _# k- n8 ]; b, ]& T& g if A_tote="tote 1" then set A_induct to 1, H: K2 e- P, x5 r
else if A_tote="tote 2" then set A_induct to 22 d4 F3 b3 u5 M' C, y
else set A_induct to 3
6 f! L7 V2 I w) Q! z3 I set A_i to 0) M9 v+ J% U2 Y1 ]
clone 1 load to P_induction% m' \+ u1 S6 L e: n1 v
wait for A_time sec; x9 O9 I) ^# z3 F7 q
end% N K1 ?6 G" Q3 ~: |3 D/ N
end
& Q, A! _8 U* G# t: R( |7 _9 K3 t g. u
begin P_induction arriving* ?- q7 [6 p/ l% p( a% L
if A_induct=1 then clone 1 load to P_pick1
3 \- n8 L. R6 D+ w9 Z else if A_induct=2 then clone 1 load to P_pick2% d1 _4 i7 h! Y
else clone 1 load to P_pick3
6 Z$ C& ^" ^" Q9 gend. X. Z& v. M. U0 ^
5 o5 {/ _4 ?) E. g' Y. H$ Xbegin P_pick1 arriving$ u- l' k1 f4 ~1 J2 z# C
set A_i to 1
( T6 O9 s, K; x move into Q_induct1. c' H5 O, a9 ~; D: d
move into pickaisle.induct1& H4 _. J" p8 x: f! F& v) E* k
while A_i<=30 do begin
' E' a+ }* c& u travel to pickaisle.con(A_i)4 Z( V2 ^5 P7 X, o _: j
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
Q: H/ ?# K8 r" v" m else wait for 10 sec
8 f5 Y/ m. a% O: f if A_i=A_leave then send to die
: W" t5 g. I: s2 I2 }% m: T else inc A_i by 1
/ _+ I$ _0 H( c/ g7 Y8 \ J" k end
3 }; B) r6 e2 @end
3 @) a, p0 ^( `1 S3 C) V
+ K2 Y8 O% D# R* O* hbegin P_pick2 arriving
" s2 u% f- o0 m! X3 z set A_i to 11" j* m0 E% b0 N& f
move into Q_induct2. z, d/ a' Q/ v
move into pickaisle.induct2
" o$ p8 x0 w/ @ while A_i<=30 do begin
B4 R0 v- f) s travel to pickaisle.con(A_i)
& T9 u& \2 _; n. J7 N& J6 z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 S3 g5 V5 }& E* c4 ]5 w8 `/ q
else wait for 10 sec( |: h; T5 J2 W6 i6 S2 K% j( v
if A_i=A_leave then send to die* A/ A: V+ i! x# i! J" k
else inc A_i by 1* x, t( e O- p! z! ^& s# L, B$ @
end9 x0 x. S, ]% |1 R6 o- i8 v* Z
end
]; U6 J0 F1 Z
% R* b- f! T0 a% ?: sbegin P_pick3 arriving
( m" c0 O% J! r7 C! J( X; h set A_i to 21' [. g! j: c' b! r/ \
move into Q_induct3
4 K q# i: U* v" G7 [+ V move into pickaisle.induct3
7 Z$ u8 u! l! u) j5 R2 G; N while A_i<=30 do begin
7 {3 M: M9 [$ ]+ R travel to pickaisle.con(A_i) a# ?9 Y ~; U! v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: f( M+ C% I* o9 q else wait for 10 sec
7 Y( ^# N! s7 l/ @' @. S if A_i=A_leave then send to die
; H C5 \# d4 N, f else inc A_i by 19 C, B: n4 H7 [) |) h# B% A
end
( r5 Y' O' j6 A9 B5 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,其它按你的 ...
|