|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% p8 K2 G( G* o! b8 o
/ {( ?; @: _$ u# j我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% y2 Z" `7 s. I3 E; y; m3 y) B/ k; p# |6 T2 {
begin P_read arriving
, a; Q" X& L" k+ H7 H. ] D while 1=1 do begin
) k) F3 P# U( U/ Q3 ?% r read A_tote from "data.txt" with delimiter "\n"
+ ^0 H1 A! j! \1 K4 @. d read A_time from "data.txt" with delimiter "\n"
: ]5 B( r: C" y/ q6 s( S read A_leave from "data.txt" with delimiter "\n"# `7 x7 `9 r$ a$ y1 z/ i6 ?9 j3 d
read A_picks from "data.txt" with delimiter "\n"
. P% b+ g, x8 t$ B) j& [ set load type to A_tote9 Z7 i0 |: e( C' L- T
if A_tote="tote 1" then set A_induct to 1
, q. B" g: S: ?/ P; X else if A_tote="tote 2" then set A_induct to 2
3 c- C1 e' Q5 O9 d1 @# G, q else set A_induct to 3
( S- J; j- L/ [9 o3 P5 `. D% ~ set A_i to 0) s1 p- ]! m6 {$ V6 h2 Z
clone 1 load to P_induction
" V9 C* _& R. O' `; t% L wait for A_time sec
) ?2 {& \8 g1 x end( o* V# W3 ^4 o6 g
end
3 n' I* ^+ `- C$ L1 N, q: f2 g% H2 m/ q6 a- i- L
begin P_induction arriving+ G8 y0 ^! `5 m( w. I+ Z( ]) t4 v$ b
if A_induct=1 then clone 1 load to P_pick1( @/ ?3 e6 p/ k, D9 l+ B
else if A_induct=2 then clone 1 load to P_pick2
8 m: q& O2 n( a" |' _4 X1 {& d else clone 1 load to P_pick3# _. p6 }6 z2 q( ~# o6 q1 f+ O% X
end
% X6 G! R1 T- N; `4 l" _5 r& | t, g) ]. p5 R
begin P_pick1 arriving
0 a: Q0 b( _; g( ` set A_i to 1. ~2 {% k: v* Q1 H/ B/ T( V
move into Q_induct1
0 ~8 f$ ?6 [% J# C4 C, b move into pickaisle.induct15 m4 U T: [; J" U5 d3 |5 F
while A_i<=30 do begin8 V% k: p$ o$ W. }+ A; Y2 B o# C( c
travel to pickaisle.con(A_i)
: ^8 n5 N! y m8 ~, | if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" R2 ]! k4 n3 U, B& _" @% z
else wait for 10 sec
- O- ~) e" \& z# @: v if A_i=A_leave then send to die
1 D- l& _9 \/ B! x5 i. S$ S else inc A_i by 18 b% X6 H5 G$ W3 A
end, L3 z" f8 Y4 e5 A( c: j% ~' V
end+ V- P, J, j: G9 V
7 e, z- T4 v& {) J b- U
begin P_pick2 arriving& l. X: e& e/ Y' P4 P
set A_i to 11
' Y+ b! q V e+ R1 j move into Q_induct22 f1 h1 W1 u8 M' v: K! s
move into pickaisle.induct2
- A2 d# O- ~* L) G8 j; ?6 M while A_i<=30 do begin6 h v" u. Q1 a3 {
travel to pickaisle.con(A_i)" z u( N3 T# o. g2 S. ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ~( b( [+ p6 m7 v" f
else wait for 10 sec M7 K. o) t& K5 z* l+ j2 m
if A_i=A_leave then send to die
4 o6 N* Y9 S8 F+ Y5 a5 n# \ else inc A_i by 10 ?# {( q1 I/ n+ U- I s
end
1 G; W( |2 k0 c. `8 k9 X0 hend+ A. b& i7 e1 `1 c: z
/ G5 h- F' V2 r# S! ?8 C
begin P_pick3 arriving8 @; \5 J5 Y$ O
set A_i to 21
- U# E: ]% Z, y1 W# x7 |" a2 F. V move into Q_induct3
0 }, `& L" L$ n# {; ]& M move into pickaisle.induct3
) S9 J9 ?8 U9 P0 _7 b0 o& J while A_i<=30 do begin: u+ V$ ]2 C# \$ M4 Q# L" g$ Y* U
travel to pickaisle.con(A_i)
7 g/ P1 G9 A0 S% J; m; r$ E if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& l1 q/ {1 i% h' e$ U& V
else wait for 10 sec
f( F$ I6 `; s% h7 w, t) T if A_i=A_leave then send to die
2 s% w" _$ V# { else inc A_i by 1
% C( x4 W) e* B" M, y9 o. X0 m end
9 m' r4 o7 f8 f$ y8 |7 X2 Y1 u- pend |
最佳答案
查看完整内容
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,其它按你的 ...
|