|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 S; y9 l$ M& D% c' C s
# f) z9 D4 m8 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中的数值,不知道会不会有什么不妥。5 E6 i0 v( O1 @6 |8 c. ^% r
& |) V- ]7 A$ d# r I* t+ y
begin P_read arriving7 L8 ?" @1 f% ^% `* Y. y1 M
while 1=1 do begin
" w. h' b: C: u9 G3 _! R: A8 p read A_tote from "data.txt" with delimiter "\n"( w: ]) q4 S2 G6 g! R
read A_time from "data.txt" with delimiter "\n"# T9 U3 R/ n! I$ O
read A_leave from "data.txt" with delimiter "\n"! v3 t V. i* K* A0 w6 F
read A_picks from "data.txt" with delimiter "\n"! g$ I- o5 v& |4 }/ ?( X6 ~
set load type to A_tote3 N. p; \8 p$ d( G3 q, H0 | s) D
if A_tote="tote 1" then set A_induct to 1
# M* w) _: q& s( u; x else if A_tote="tote 2" then set A_induct to 2
; \; v: t" Y; t else set A_induct to 3
0 q# U0 N7 f) A5 S) c5 [% h set A_i to 0
5 F" S* y9 R/ Y# u/ _ clone 1 load to P_induction8 t1 P- }6 J- g8 }; O: Q$ u
wait for A_time sec
4 M; V* W1 h/ @) l9 v4 _& o end
# R0 S/ ]. I. ~/ ^& Q& v' \! T; Cend, v- f; h" L' _ |
C& z1 z( F2 H& Hbegin P_induction arriving
5 v4 w3 X. Z: s( n6 c8 K4 s if A_induct=1 then clone 1 load to P_pick17 ~+ ]1 U! E# \! t
else if A_induct=2 then clone 1 load to P_pick2& Q8 {/ j; {% [7 ] i: O
else clone 1 load to P_pick3
1 [9 C* Q$ C r0 lend) q+ z; V. \# D9 V, W- ^1 L
5 M9 i F; D; O7 B+ p
begin P_pick1 arriving
8 v( ^# j9 |( T7 {2 {5 L' O- m8 T9 | set A_i to 12 A) w- d; B4 c, t7 c
move into Q_induct1
, C: X5 W$ U7 n# N move into pickaisle.induct1
5 k1 u: }# m% Z( z, Q6 [( S* N+ ^2 d while A_i<=30 do begin& H+ K- b h# F m. ]8 J( ]; E
travel to pickaisle.con(A_i)
1 _) m+ @/ [) ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& x6 f! S$ B/ H* C% Z1 Q
else wait for 10 sec( A" U7 R9 P w- o
if A_i=A_leave then send to die
9 D; j" s. Q, E else inc A_i by 16 b) ^9 I1 ]- w( F/ g6 o% G5 t
end
$ c) M' {! M3 R* l3 B8 d9 ~end
! e$ e; I/ z( @ @" D8 f+ V5 C1 o1 V) ?) d
begin P_pick2 arriving% ?# S/ }5 {1 B& w
set A_i to 11
a* Y8 } \) u" X8 e move into Q_induct2
( b+ `+ E. F0 C move into pickaisle.induct25 s* ?: d2 |# K0 j- g) R& v
while A_i<=30 do begin, I# ~3 G f, f/ M ]" m; }! i# `9 w& F
travel to pickaisle.con(A_i)
! ^' p, L/ V! N" L! y/ f% ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ ^- r0 G0 l4 B: i. M
else wait for 10 sec
% O3 `" i: {5 I if A_i=A_leave then send to die8 g' c6 B6 s7 S" X( c+ T
else inc A_i by 1
; I* t. j! }* Q0 v end
' K; Y3 {8 r r4 U8 kend
6 i2 X3 z; K; u- L- y6 i2 R& q$ V) C8 `
begin P_pick3 arriving
2 J8 G- R3 B8 \; ? set A_i to 21
) [4 d, T8 U3 @: L+ [/ }8 q move into Q_induct33 ?$ Y" U$ j& Y
move into pickaisle.induct3& A% H9 |) ^% _( b
while A_i<=30 do begin
, Q" K+ w: W5 i; D7 t7 p4 c travel to pickaisle.con(A_i)
0 i# F, g" [0 _0 @) v) S) Y& C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 ]) R% @) D# Q else wait for 10 sec
7 R: M; f* R% l if A_i=A_leave then send to die& e" }' M0 q- f% ^0 P. }) J
else inc A_i by 1+ s9 }" r* z, A; r- `) E
end
% A) j7 X. M' k+ x8 F7 zend |
最佳答案
查看完整内容
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,其它按你的 ...
|