|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% }; X4 p' A( I
5 H; l9 j, ]) Q( @" `& z我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 A) E+ y0 D5 O
, F7 ]% r! ^ B9 B1 ~
begin P_read arriving2 K' w9 k0 r1 X9 B d0 r. g
while 1=1 do begin7 t3 ]2 [9 L( `- I
read A_tote from "data.txt" with delimiter "\n"% _/ a# F- @: x7 G
read A_time from "data.txt" with delimiter "\n"; ~; U) J) }5 d" Q: c
read A_leave from "data.txt" with delimiter "\n"
6 T+ V! ^; l! Z$ a; v# [# F- ? read A_picks from "data.txt" with delimiter "\n"
$ i( d& D( ?4 o2 H set load type to A_tote, L0 P' z4 H4 U4 Z, Q
if A_tote="tote 1" then set A_induct to 1
5 M K9 u2 u) x6 E else if A_tote="tote 2" then set A_induct to 2
0 C% y# B. E. g$ O/ `& B else set A_induct to 3
- F. e3 J) M* @/ E' u5 j+ q { set A_i to 0 _- T6 Y" T6 m; O
clone 1 load to P_induction
" ]& C$ B1 h& |2 J/ I/ U wait for A_time sec6 t# H4 W! r( t( A7 Q8 g
end. m' P" Q' [' P5 [" z) e( ?
end
1 A2 @+ X( { i; n. Q
/ a; k8 ?0 v3 y# m. r9 hbegin P_induction arriving
" p4 H6 \6 Q( w" G% q if A_induct=1 then clone 1 load to P_pick1
7 z- `# V% P2 F1 T else if A_induct=2 then clone 1 load to P_pick26 L7 R* H$ T1 o# D, J& x9 e% Q
else clone 1 load to P_pick3
0 i; h/ @' E* H! pend: \0 ]+ d: J) L
( r/ C9 k9 s7 u u) q* k6 f$ Ibegin P_pick1 arriving Q9 d- p; d3 c
set A_i to 1
% J/ @3 r3 D+ ` move into Q_induct17 R( _0 s. l9 H! W# `' f' c6 ~
move into pickaisle.induct1 Z. m+ V! h0 H% ~
while A_i<=30 do begin6 ^( z* E3 J0 n6 h- ]+ I1 n; l
travel to pickaisle.con(A_i)# v: e Y7 s4 y: p" c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, \+ v- I3 ]& w9 e1 v5 _ else wait for 10 sec2 P& R3 v; v% c
if A_i=A_leave then send to die
- Q5 f; l1 i7 J. k else inc A_i by 19 Y; p+ m4 Z) i% N; U9 b7 S2 M) I
end
- v, a5 W/ r, v Send
! a! P" O6 K. [5 n2 b
+ n- p: H% e5 d2 f2 cbegin P_pick2 arriving
# n7 F8 Y7 R; v set A_i to 11) g8 D; L, E; |
move into Q_induct20 }% l' t/ z. i' \# i8 ^
move into pickaisle.induct26 }) B7 `4 M: t; S7 @9 w& h
while A_i<=30 do begin1 |; M, x; Z1 X7 X# ~5 U
travel to pickaisle.con(A_i)
! ^4 U( c9 Y# F' a+ e$ _& N2 f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( o/ Y( x% I$ x* N7 B
else wait for 10 sec$ p- R: B% z0 r1 u# h
if A_i=A_leave then send to die
: O% U) q* P( b6 K3 R# M else inc A_i by 1
7 c& i6 y3 n$ {' Z; w end" j- B( ^+ x' p% H' y' m
end
- s& P* @( x$ X& `3 W4 n0 z& D! V8 f( L* r+ Q% ]
begin P_pick3 arriving. u" r% n! |; t
set A_i to 214 ]4 T/ H. p8 D/ @2 }2 u
move into Q_induct3
4 v* c4 N- A$ a. p move into pickaisle.induct3
/ l. G, C3 g( \1 F2 c while A_i<=30 do begin: l) o( I1 W' L' r( B: A' F" y
travel to pickaisle.con(A_i) L. E9 _) `* H# e# E0 U
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ [# G" G1 Y0 f
else wait for 10 sec
6 T, f& ?: Q5 f if A_i=A_leave then send to die( A: }$ G" k$ E; c, ?% u
else inc A_i by 1
- j% B& X! O3 N; O end
9 K5 V( D+ X5 L" h cend |
最佳答案
查看完整内容
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,其它按你的 ...
|