|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 K+ z; v2 v% y' S3 A
1 o) Y% H3 S: c. w; ~# _( I9 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中的数值,不知道会不会有什么不妥。
* y$ j4 e$ Y/ `. |5 w) r; t
2 a+ q# ~( v Sbegin P_read arriving6 g- e0 @9 F* Z) Z8 v
while 1=1 do begin
* |7 ]$ D: R7 O8 w! _" j read A_tote from "data.txt" with delimiter "\n"
7 ^9 D, C" P7 J& P4 H read A_time from "data.txt" with delimiter "\n"
: {( [' R7 Q e v& e$ N; a, n read A_leave from "data.txt" with delimiter "\n"
7 H" l3 u9 T" U* `# d, Q5 _% H read A_picks from "data.txt" with delimiter "\n"
4 {0 l+ G7 n8 }# j9 m set load type to A_tote5 T/ L6 U& W4 w3 e
if A_tote="tote 1" then set A_induct to 1( y! T- O& @5 B5 b8 h$ x
else if A_tote="tote 2" then set A_induct to 2! {# m8 Z- o7 z7 R* g: o% N
else set A_induct to 3
7 d( d/ L( c$ M i set A_i to 00 e% r4 S( ]2 N
clone 1 load to P_induction
1 K) G" r% o! h9 g+ [' L/ c0 b wait for A_time sec6 x; C" I2 H- ^4 ~ |/ a) g2 U
end
( q) Y) x; F2 r3 i( B Hend. b2 Z3 k! b7 N6 J
4 z* a. F7 u. o" h6 Q
begin P_induction arriving
x6 h9 I4 s# }4 a( | if A_induct=1 then clone 1 load to P_pick1
1 d% q. F0 u7 V/ @. c else if A_induct=2 then clone 1 load to P_pick2
& j! \% Q7 p1 q6 L2 L/ N/ i else clone 1 load to P_pick3, F1 b4 X3 N; {1 t6 J8 F
end7 }5 M; B% i$ Y- }. T. j' E; I
0 i8 q/ \9 S' s) v' e
begin P_pick1 arriving
3 t+ j! A6 B @0 d set A_i to 1
; e+ ?' W5 a, }. k- N move into Q_induct19 c5 p* \+ |9 W& |
move into pickaisle.induct1% ~# i8 b' ^' N2 ` |
while A_i<=30 do begin
- g6 w' Q9 w& r" f7 T" x5 W. r travel to pickaisle.con(A_i): z+ k- v% `2 O; e5 H1 r% y5 k
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ S o: G- O1 p2 o
else wait for 10 sec
5 K' [2 j2 s4 r6 a$ d& z$ l# x if A_i=A_leave then send to die
3 B2 h# }+ l2 ?; [ else inc A_i by 1( p4 w. i* {$ a/ Z+ }$ |" i
end o7 Q) y$ R3 l, n" R6 o# O4 |
end
+ y* P7 m9 Q6 C% P; h6 r- ^) ^! M: M5 x, [% l' `/ n# p
begin P_pick2 arriving
1 I5 c" |+ \# e y. W& x( { set A_i to 11
; }% i' O1 B2 {- R: P! i move into Q_induct2/ y w( n# a5 j3 m
move into pickaisle.induct2
& |# n# Z) n6 _6 V: x1 ^' u while A_i<=30 do begin
2 X, t$ D9 T8 B3 ]! o1 P8 u travel to pickaisle.con(A_i)
4 k6 ~" O" C( l! o0 l6 L9 }( H: D. N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ d/ ^+ w+ M- O0 Z0 m4 B else wait for 10 sec( a9 r! x/ Y( e, T1 H
if A_i=A_leave then send to die/ t5 G6 J% T& B- a' T
else inc A_i by 1
3 Q- [: r7 L( {5 i. {1 r7 b1 a end7 \- @; f; {0 t: w4 j
end
' N) L$ S7 C4 E: ] R& s
- [$ T. c* M2 `; J( w6 \0 jbegin P_pick3 arriving
$ s% _) u- ?, b: J' g- t set A_i to 21* L: ]3 L, c5 j: q
move into Q_induct3. n! M3 A: E, E& a0 P
move into pickaisle.induct3" [" I* q) |5 A' l, h8 ~
while A_i<=30 do begin
8 U) c+ {! ?7 }1 l travel to pickaisle.con(A_i)4 o5 @/ u+ M1 ?, W) [9 I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' {. L X0 p. N2 C
else wait for 10 sec6 F/ a W0 ]; k1 Q% G
if A_i=A_leave then send to die
! x5 ~+ P2 Q+ }3 R else inc A_i by 13 d! L" Y% T* _, l8 n5 G; r1 i
end
4 @+ }* N$ _$ X" G# cend |
最佳答案
查看完整内容
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,其它按你的 ...
|