|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 c$ E1 i3 W5 ~1 l \. K/ m
# ^ c& I+ B- i. @; y我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ Y3 Z' v9 u) I+ ?8 _& S
9 y' }4 t5 Z0 b" T) gbegin P_read arriving
( h$ G# L% n. H5 N) B4 w& H while 1=1 do begin
* {. t5 v- A& {8 y- S' S: u read A_tote from "data.txt" with delimiter "\n"
% d: v/ A0 A% p, _ read A_time from "data.txt" with delimiter "\n"
8 Z- J S, M9 j7 R: D; s read A_leave from "data.txt" with delimiter "\n"
4 c0 Z, L2 M# @1 g: A. u1 l! [( B read A_picks from "data.txt" with delimiter "\n"
* T0 k, g" U6 p1 d set load type to A_tote
! w2 Z1 s9 U; I& ?8 u- L. T+ M if A_tote="tote 1" then set A_induct to 11 ]/ G! j3 P) }" }! V
else if A_tote="tote 2" then set A_induct to 2! G; R0 t& O- z1 y$ S
else set A_induct to 3
6 ]7 z) @4 H1 V6 f' n& B! j set A_i to 0' X5 m) ~7 Y0 b$ I
clone 1 load to P_induction% `9 B4 S) D& r3 s) y o
wait for A_time sec
0 N E Y9 v+ P5 y( b end5 d0 J+ Q( J2 g% D
end
- T) I v& A4 o2 a
' A( |: N, ~7 S+ ]8 a5 rbegin P_induction arriving
- K5 y7 B! l/ W4 r& Q if A_induct=1 then clone 1 load to P_pick1
. O( G! E8 d7 B( P2 K else if A_induct=2 then clone 1 load to P_pick27 V4 P/ k/ d, y: X% ?( L6 n
else clone 1 load to P_pick3
( N! G0 I( S( u- }end: k& `. G+ N+ t7 X' v; V8 I
" A; J7 H5 E f7 r: V5 V' D: @
begin P_pick1 arriving3 }$ a( y: q0 T
set A_i to 1& E0 M4 ^; g( Z4 V0 i1 }
move into Q_induct12 ^* ?4 l4 h$ n$ ^5 ^' J% h& N V
move into pickaisle.induct1) V! ~4 `/ b$ q, _+ C. z. j
while A_i<=30 do begin
( r% I' {- T( V( ^ travel to pickaisle.con(A_i)* s# M* K8 z" }; Z6 e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 M& J: L7 U3 M else wait for 10 sec
# ^! G/ B3 S: `2 s( k if A_i=A_leave then send to die
8 v# `1 T, i0 T else inc A_i by 1
4 F: E. v* z) n3 w end0 T9 r" g) ^( r- c3 C
end6 Y0 ? Q6 _8 @3 a' C& p
6 {/ |- L, l5 e! s/ y% U
begin P_pick2 arriving
+ S: a3 H& ]0 [7 A, R; Z/ Q set A_i to 11
9 W! q+ y f% J) @ move into Q_induct2' {# u) O4 d7 q, l# x# G9 j3 v
move into pickaisle.induct2
+ D6 {8 c4 o& l: L1 V; _ while A_i<=30 do begin
9 ^0 @' ?1 F: f travel to pickaisle.con(A_i)
) K3 H- A A% N: d# Y' p7 Q! t h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% |* _0 I2 k+ j" T else wait for 10 sec
( t- T! ~' c8 u" P if A_i=A_leave then send to die
; ^5 k, i- G2 C% C2 d2 H3 I% k$ V else inc A_i by 1* Z( a' p) t0 B5 d
end6 G- X- o: c6 s
end
6 c$ W0 v6 d1 i$ }) z4 F$ y) G+ E* R# k9 J' z
begin P_pick3 arriving- |4 [5 n- f! ~7 Q& H
set A_i to 21, H3 m( R9 h7 y
move into Q_induct3
m1 T0 Y# f7 W. G9 @; r4 N move into pickaisle.induct3+ G5 R+ P4 u9 x3 O1 s, z% a) x
while A_i<=30 do begin
" T6 M* \$ B" o8 J9 h travel to pickaisle.con(A_i)1 x# y- w' ~5 X) X; W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* U4 `5 I7 M; f7 U/ z else wait for 10 sec
6 ^ O' D x5 A if A_i=A_leave then send to die- w4 s# \7 h( V5 H: w3 H
else inc A_i by 1
: B, Q* e% i' L& Z& E5 ` end* j( l' p, P: s/ @/ @$ L
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,其它按你的 ...
|