|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ q$ V3 ~( B7 d
/ }- K7 L* M# V我的问题是,在每个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中的数值,不知道会不会有什么不妥。, Q ^" k2 d: k) ]
. ^8 u7 W, y+ r& V7 Cbegin P_read arriving
% X% b/ i7 `& @7 K4 ?: ~( O6 m; i8 [ while 1=1 do begin6 |# [% L# L- k7 P. }) ^+ L
read A_tote from "data.txt" with delimiter "\n"
- w* M j, U; T5 i1 c read A_time from "data.txt" with delimiter "\n"5 y7 Y4 G7 x7 k
read A_leave from "data.txt" with delimiter "\n"
4 @( V$ x' p( Z3 D& K read A_picks from "data.txt" with delimiter "\n"
+ B1 z3 f1 m! s" y; { set load type to A_tote9 I: Z4 H0 R" ]0 S: ?; X' O
if A_tote="tote 1" then set A_induct to 19 q1 ]& U8 ` O+ ?6 l! _. P, N
else if A_tote="tote 2" then set A_induct to 2
: b1 p0 J/ c( v( q2 f else set A_induct to 3
0 t1 g* X# r# N. T! J set A_i to 06 M0 \" A0 l5 `/ p; `# `, L
clone 1 load to P_induction8 [0 D' S, h" m0 x5 J& c
wait for A_time sec/ M8 U, g( N1 z0 \! `' r% {% D& V
end
$ P% U& K8 a( cend ~" z# J* y7 B$ I4 ?
5 m2 z" }" b1 z$ N- R6 w$ ^begin P_induction arriving* {4 k/ A2 u( s: `; z
if A_induct=1 then clone 1 load to P_pick1
# \: n' F: q! U9 H0 }7 D else if A_induct=2 then clone 1 load to P_pick2
0 V( a/ ~; @' g' H1 |* k else clone 1 load to P_pick3
* H9 B$ N* u7 i; w( f+ _5 {end+ V) c+ `+ m" g( z. C. u
, |! {* Q& o$ h0 O# |' w5 |. Sbegin P_pick1 arriving/ \& i+ b W. u4 k; N
set A_i to 12 a, {8 O& f, U
move into Q_induct1. B: ^7 V$ p& d2 W
move into pickaisle.induct1
5 m. q, j* Y) L' |% H/ ~ while A_i<=30 do begin5 J9 H& z* O# K
travel to pickaisle.con(A_i)
7 m' ]) U- _; i8 b) u# |2 k' E if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. x n+ X* F8 ^8 H1 c
else wait for 10 sec
) _& }, ^0 h3 O, @' Z4 x; x8 u- J if A_i=A_leave then send to die
) |# L2 V+ ^$ {' U* a! i# T* L else inc A_i by 1
! A5 l4 L# @( y8 \ e8 k- k9 M end$ v t3 K# j" g: t
end! A0 V( P& ] H
- Z% \- n2 Z/ e6 k
begin P_pick2 arriving
) T/ d3 x, j9 |3 f: l set A_i to 11 B5 J6 D. Q8 G/ U
move into Q_induct2& V9 O3 i1 |, p
move into pickaisle.induct2& \5 J8 k2 A% X
while A_i<=30 do begin4 F, Y( _% Z3 U, N
travel to pickaisle.con(A_i)9 j0 a' B$ u0 D1 e+ X
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 R# o* |8 I9 p5 P `0 r
else wait for 10 sec
A* a: s" L: ~ if A_i=A_leave then send to die \7 e1 ^# x; A
else inc A_i by 1
+ N- U8 W3 j9 M& Y9 K end V. D+ I) B3 K) ?5 N' f0 n
end6 s+ ^8 K% u1 R$ z' Y0 k4 X
# E# O' R& p0 w4 X; gbegin P_pick3 arriving
! u2 t* I0 @: W set A_i to 21( w! ^3 a) _8 n" V, E
move into Q_induct3
* ]6 _7 ?0 {; f5 Q7 h move into pickaisle.induct3
& U( S/ h! d: U) z$ n& ` while A_i<=30 do begin
6 a$ |& s0 T4 d; C8 ~" P! X4 t travel to pickaisle.con(A_i)- N) P7 n- E6 T# P4 X
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" F: |* M9 J3 G1 l1 ~ else wait for 10 sec$ _3 n4 f& g+ B$ R7 x
if A_i=A_leave then send to die- x6 M9 O) r; U+ o, S' J( v
else inc A_i by 1, p8 ?- |8 K9 _, w# [/ A
end) l ? J9 ^7 {4 y# S2 }
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,其它按你的 ...
|