|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ ]7 d2 \$ v6 d4 J: f! Y& _2 X, e* u+ O3 Q" P+ x6 `- B t
我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 s$ r! O6 q) ]- M7 \: k: O
; |1 i" o( _4 Y% b
begin P_read arriving
. H8 m( U6 Z; e* w5 X while 1=1 do begin
6 f( ]5 L+ F8 T8 T5 d3 Z6 t; c read A_tote from "data.txt" with delimiter "\n"
0 R7 |, G/ o6 g% o. }( i read A_time from "data.txt" with delimiter "\n"
; `/ V$ {, ?, w7 v read A_leave from "data.txt" with delimiter "\n"' F9 n/ q& ]6 V8 y/ G: P
read A_picks from "data.txt" with delimiter "\n"
0 n' z8 e: e. b* P: f! h set load type to A_tote
9 I- ^" U; p X" w if A_tote="tote 1" then set A_induct to 12 h) B; h' M: }3 K6 V$ q& j
else if A_tote="tote 2" then set A_induct to 2
) w6 R% H6 T' U else set A_induct to 3 ( J/ }0 h8 m" F9 w n% l+ ]
set A_i to 05 _+ p7 O x8 K
clone 1 load to P_induction
/ H0 C5 O& b# y! c wait for A_time sec0 _" G2 x9 C0 L) x4 v9 B
end( K7 \+ B& J$ l& w
end, L$ u2 _" S3 ~1 H M. f' g
3 I% V8 S# {" u! e* v; T% y/ Z
begin P_induction arriving
! k& V) V; ~. ] B3 | if A_induct=1 then clone 1 load to P_pick1
! _. M" `2 Q" G$ q4 y" C else if A_induct=2 then clone 1 load to P_pick2
6 S- ?: W$ G! k* Q) L! L else clone 1 load to P_pick3+ L2 l0 f5 _4 p, U
end9 z- U) U4 O, y% e
5 Q5 A7 u( a, ~# B0 c2 @# a" I* vbegin P_pick1 arriving% I* p. B/ C9 B
set A_i to 1 U! v, y! Z T& e- a# [
move into Q_induct1& S% Q( j1 |5 {3 j
move into pickaisle.induct1
1 \8 y3 A: Y" n5 w while A_i<=30 do begin
) w- ]9 v! }/ x: t8 k" r$ M: X. c travel to pickaisle.con(A_i)6 h9 T: f L3 [( ` \/ n* @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ N3 i7 J2 a4 f5 U& n" N else wait for 10 sec
* U2 L( m* J: a* g) { if A_i=A_leave then send to die
+ K& N" p$ D) O7 |* \4 f+ c else inc A_i by 1
3 \; r& f% {9 X! f- Y; f8 H end% u, j! |8 u5 J; \9 L; G3 e u( q1 c
end
" T7 x- o% t" W) |+ C+ u4 w) t( Q! R
begin P_pick2 arriving
2 Y! e$ q- } n: E! n5 X6 x set A_i to 115 I( |" l/ }- m+ b7 @
move into Q_induct2
3 R8 H& K4 R, n* Q( e move into pickaisle.induct2
* B% m% S$ f/ _ while A_i<=30 do begin
" ]# F/ n$ b" i8 N5 Y% G travel to pickaisle.con(A_i), A9 Q( h+ n, T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! J6 R2 O- E* {! e; I else wait for 10 sec
1 j9 w, n6 C# P& N! }7 L if A_i=A_leave then send to die
& u" f& s: V6 U1 c3 s else inc A_i by 1 U; H+ d, d: A) S3 J5 }
end$ ^- ^% ~$ ]" K" b+ }- s% @) H
end
' h" M# K: o& U; Z- ?+ {. V- B2 s) m$ U! G: r" [: v
begin P_pick3 arriving0 a; D: d# z! D) a0 U. N
set A_i to 21
& I+ f: ]$ K( U* ]0 \4 C5 W& r% _6 e move into Q_induct33 y7 b) ]8 O) B: m g
move into pickaisle.induct36 b: ]% C& x9 s: N8 h8 O
while A_i<=30 do begin
1 q# r4 {- i. b. u. ~* R travel to pickaisle.con(A_i)/ g" n0 G. i$ a6 {
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 ]7 T. F/ ]# U' j6 K) S
else wait for 10 sec
( G- b: e- k# O# C if A_i=A_leave then send to die0 n/ e! H' [3 K
else inc A_i by 1
# N+ r% p _2 n7 @ end2 y8 G/ A; ~2 O0 O$ a) Q* n( a
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,其它按你的 ...
|