|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( P4 S6 n @( @1 p8 g3 d5 z3 g% k7 |
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ h, z6 P0 _5 X- x
! I8 g0 V( ]& k& [" V' r
begin P_read arriving
8 d% M( n( u4 n" ^1 O9 C* G while 1=1 do begin
, l" R" y( C) x8 o$ M: b+ c read A_tote from "data.txt" with delimiter "\n" m4 b" l8 E$ D' ]
read A_time from "data.txt" with delimiter "\n"5 @. O& B# M5 ^0 V; Q+ R. u
read A_leave from "data.txt" with delimiter "\n"- D6 ]( f0 }+ w. ]+ X9 R) I
read A_picks from "data.txt" with delimiter "\n"
, {' ^- I1 f f) [- A8 E6 i set load type to A_tote
( M0 A/ Y0 X; b! I! { if A_tote="tote 1" then set A_induct to 1( D+ g1 y( B( V3 Q- r
else if A_tote="tote 2" then set A_induct to 2! ?* v0 ?! Z+ e4 M/ ?) `1 I* A
else set A_induct to 3
0 h4 {+ c% I8 u, o3 H' B set A_i to 0
v2 E7 ]5 I) M3 y1 y: ` clone 1 load to P_induction: w; T* M* I* y9 Q# Y+ n' \" X
wait for A_time sec+ N6 U0 H. x7 ]. s
end' t D2 X# t+ D3 Z+ D. J
end4 I9 X* B9 J a6 I) n
+ ~1 P# j( S( \. p) D9 @7 U: [begin P_induction arriving3 v8 C+ R+ j5 ?- \/ D( Y0 V; r
if A_induct=1 then clone 1 load to P_pick1( M3 d' W3 ^' j4 e* n# t
else if A_induct=2 then clone 1 load to P_pick2
. K6 P8 Z% t7 _2 Q else clone 1 load to P_pick3$ t9 Z* @! x+ M3 n$ t q. v
end
5 i# ^) ^; w% O" l2 k. s) Q. q1 v$ [ z( |% v; }; U6 ~6 V
begin P_pick1 arriving+ I2 _$ h; W, ?. {$ N( [, |. }( [
set A_i to 1
$ T% L9 B* c4 U' c. _; h move into Q_induct1$ m, P, G5 t: P
move into pickaisle.induct1
1 X* Z! g. {; p- B/ Z while A_i<=30 do begin
5 V, a2 c2 u0 `: o6 x travel to pickaisle.con(A_i)- {- Y# @( J8 S- t9 q0 ? k7 ], ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 h; C+ ~( L; |- p' }4 E else wait for 10 sec$ t* @" G: V; p, ^
if A_i=A_leave then send to die
2 j# P5 i8 i# F/ ~- Y4 h else inc A_i by 1( f3 e, N, N d- e0 ^
end
' ~+ B! `3 }, s" Q% g F7 uend
" I) y0 _2 s9 N' m# C. @9 I& O# S w
begin P_pick2 arriving+ c; B& P: s2 C8 o( Q! H& B
set A_i to 11
" P% G# h3 w9 d4 h% [$ M move into Q_induct2
( k0 g; l; [ `! Y2 T3 ]5 | move into pickaisle.induct2& L- K% r/ b8 r& j0 w* s) c6 a
while A_i<=30 do begin
" l2 \3 e9 {/ ?4 C6 q m travel to pickaisle.con(A_i)
9 U- y, o0 K+ q4 h$ k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) l0 o3 @. F2 [: t$ S
else wait for 10 sec
' U V9 k7 _/ O/ i6 [2 g. s* X9 L if A_i=A_leave then send to die
& x& o: N. z# ~9 W3 y6 n else inc A_i by 1) R& t8 ?" U' V* _1 j- e- x, i" F% H
end8 W2 m: B0 |9 n+ R) S& j) a: O1 n* z
end
* ]* z+ N+ x- v! X# ^
$ `4 I" d2 f+ W9 Q0 y1 ybegin P_pick3 arriving
a% w5 u0 K" W+ Y6 c, x set A_i to 21/ ^+ q3 C/ u* H8 g o0 q
move into Q_induct38 m% {# g- B# z6 R8 t" v
move into pickaisle.induct38 N* V2 \4 N" i" A [+ O. }4 E
while A_i<=30 do begin
: |6 P1 S% m: T. [- h travel to pickaisle.con(A_i), H1 X; I7 E! Z: f" I* t
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% h) w7 q$ O, a5 |8 {
else wait for 10 sec$ _# M7 l- L$ o
if A_i=A_leave then send to die
+ b3 h+ t( K+ H: [ else inc A_i by 1/ L; q% o$ ]! k1 ^; w i
end
4 T# ]/ x5 p. K1 r/ Bend |
最佳答案
查看完整内容
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,其它按你的 ...
|