|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& e |- k9 I% ?3 m: C
( u2 a2 z* m' l: x; _" B. G N我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 W Q6 l. W' m1 b8 |3 \$ Q6 }- |
/ t% l% ]* ?4 N& \begin P_read arriving
$ e8 K9 b+ D% G6 n while 1=1 do begin
* I, W( x4 Y6 | read A_tote from "data.txt" with delimiter "\n"2 L2 U* R" F0 b% a
read A_time from "data.txt" with delimiter "\n"5 k, Q5 g! t7 _6 k: n4 D
read A_leave from "data.txt" with delimiter "\n"
5 |8 F5 m( O3 U* d9 a* Q& o3 T4 Y read A_picks from "data.txt" with delimiter "\n"$ _6 {0 w& V' d. C f+ `( j/ K
set load type to A_tote
( b3 T/ N' b) g3 ^3 S' s- r if A_tote="tote 1" then set A_induct to 14 ~- r0 K. I# R/ U
else if A_tote="tote 2" then set A_induct to 2# }+ k# c. S- Z' }0 L) y u( R
else set A_induct to 3 e. ~- y, C: E6 F
set A_i to 06 O# u! L; k& l$ \7 h+ Q
clone 1 load to P_induction
6 y. h' @0 V9 C# S wait for A_time sec
) Q; | [( v! g+ h end4 W* B; O+ G9 B4 C) r
end
; C. Y0 A. g1 T# R
- T) _9 u; n/ |" d" Obegin P_induction arriving; I+ j; J5 w" L/ \- c; A6 d
if A_induct=1 then clone 1 load to P_pick16 _! _. y( I1 i! _7 \
else if A_induct=2 then clone 1 load to P_pick23 I& W$ `# s0 ~+ t$ m* ~6 Z$ ]
else clone 1 load to P_pick39 B& k, ^, L4 A: E
end
) g7 f! l% u' P3 Y( H% A( V8 {2 r8 ^* ]. F. u0 d
begin P_pick1 arriving. i7 ^$ u# i1 y: _/ u6 L! g
set A_i to 1. g H* W' N6 V
move into Q_induct1
' k" m7 C& c- H: K; K( x3 K move into pickaisle.induct17 b" j9 C/ d d- t6 ` t# ~
while A_i<=30 do begin) G1 r4 L, @9 N! Q" s4 `8 |
travel to pickaisle.con(A_i)3 @9 [9 F+ H; A& w) \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) V4 d# o2 ~8 |. d4 P6 r else wait for 10 sec
3 K% m$ e3 z- N if A_i=A_leave then send to die
5 o& O$ T$ H1 g1 B. u else inc A_i by 1 F. ^0 b8 C) R, M
end
& k9 Q; e' ?6 N; `4 e# F* Kend
+ N7 a: w2 B2 ~# |! o) `, W5 L: h: A8 @
begin P_pick2 arriving
# _/ U5 L/ C4 ^" ?' l set A_i to 11
8 |" V$ M3 D" l7 A O move into Q_induct24 |' X; B, G9 d: N8 [7 e+ F. V0 _ {
move into pickaisle.induct2. |" B \9 ]7 p
while A_i<=30 do begin
1 u0 l+ }0 b( m" j travel to pickaisle.con(A_i)
: b; Z$ K8 n7 i. L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 y3 W; A' J* E" \0 e else wait for 10 sec
# _2 j- @* g, f$ m% R6 T! T* c' F if A_i=A_leave then send to die5 a/ ~- }5 J) e9 p& O5 ~& h
else inc A_i by 1
$ L& Q' E. m+ A- `; [2 e# E( y end
7 G) ^/ U1 V+ Cend
) _& v" z) l( @2 \9 P8 i
9 p' R% K$ @; ^1 ]begin P_pick3 arriving- O6 B' C+ f6 _; O/ M
set A_i to 21
6 z0 o# D" Q. K* b# [. T" \8 A move into Q_induct34 _/ y: S2 [; H3 V
move into pickaisle.induct3
X# g& G& M* d while A_i<=30 do begin) k0 m6 F# b2 N
travel to pickaisle.con(A_i)
& ^ R' v9 s* ?$ s* J if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' L$ R( _' }1 _" ^7 w2 H3 p0 u1 R else wait for 10 sec
* C, o$ {* U. Z2 P& [! i+ k if A_i=A_leave then send to die! V& }7 i9 H1 o* I' P
else inc A_i by 1
* ]1 n- y. Q* m" I* e: \: ~ end4 N/ v# }5 s, R! M0 \8 R6 ~2 z4 Q
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,其它按你的 ...
|