|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 e3 t, o2 _& _" Q9 O
* n# T/ x0 f' u' F1 X我的问题是,在每个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中的数值,不知道会不会有什么不妥。
0 F3 _5 w% [" g* c. B; f: B8 M* S3 g* r: S' i& Z* A
begin P_read arriving
1 Z& r# k7 o* q) F) C3 J while 1=1 do begin
) X$ `! R1 r, Z( f8 E6 I read A_tote from "data.txt" with delimiter "\n"
2 N k" R6 H6 K Q4 D! x read A_time from "data.txt" with delimiter "\n"
, Z9 {' M9 o+ v read A_leave from "data.txt" with delimiter "\n"0 X$ X- Y2 F) l
read A_picks from "data.txt" with delimiter "\n"- \9 N/ f5 t+ D% z* q: W
set load type to A_tote: }" ?- |; q! F: l& H ]; h
if A_tote="tote 1" then set A_induct to 1
: T- p- N& _( X8 @* `. Y else if A_tote="tote 2" then set A_induct to 2) `7 T7 y5 |( V t/ l4 G) S
else set A_induct to 3
. Y5 ^4 d) w4 V4 y' T+ }4 I set A_i to 04 N/ O3 H+ S9 ?5 y b
clone 1 load to P_induction3 m) G5 {2 [1 v
wait for A_time sec
& k, h. j: k& r end1 u! _+ B! M$ X, m4 e0 o0 q* K
end
3 b1 p( a( N! g# I; \& f1 u
/ u1 {3 H6 a$ r5 Pbegin P_induction arriving9 h) I/ q' V% O) O7 h0 Z, X
if A_induct=1 then clone 1 load to P_pick1$ g) d# X& C; H" o! ^( F% Y8 {
else if A_induct=2 then clone 1 load to P_pick2
6 T7 b' e/ m9 C9 p else clone 1 load to P_pick31 Q6 f3 C' L" C8 c) k6 m
end, X, c6 ~5 R; \& n& i O2 P7 }3 t
1 g5 A; }3 S5 K# {3 w. M$ Lbegin P_pick1 arriving
5 S# _' c7 X4 k& B set A_i to 14 @4 u: i5 U, L- e% j( a
move into Q_induct1
P7 [! `- z* s. P, f6 ^ move into pickaisle.induct1
# ~! X% M# W5 T& A- N while A_i<=30 do begin1 n) Q3 L7 n' Y7 k6 M" C
travel to pickaisle.con(A_i)' j$ ^& ^- y. L% b" g2 k
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 l" C. R0 U- f' E! H
else wait for 10 sec
& ^7 c/ I: p' a5 R: P% N& l if A_i=A_leave then send to die- }9 v) O9 d. n- t2 Z7 T8 B
else inc A_i by 1. `! n# h9 ^; ?( x N& E
end
; X; Y7 {; u2 w# @/ \3 t1 Wend
( {5 T/ g2 o5 r- B2 n. W' h, j' L+ {, J1 q
begin P_pick2 arriving2 W) V$ W( K, ~0 F
set A_i to 11/ C2 t/ o7 ^8 F9 b) G
move into Q_induct2
' L# I6 `( Y8 Y) X- }8 i3 c move into pickaisle.induct2
( [# u1 Y' q. R2 D4 V. p while A_i<=30 do begin
, {& L P& T# P- U travel to pickaisle.con(A_i)* {* \; r0 V1 C: Y0 S8 j, I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: l4 ^+ w+ b2 `9 `5 L: e5 E
else wait for 10 sec- n6 F. t! g( @; Z2 M+ j1 X/ Q/ U
if A_i=A_leave then send to die
/ K0 W( B. c* V3 g else inc A_i by 13 F& {7 K; h: [3 W" w4 L, p2 t( G
end
2 Y$ f6 z. h! D; O z& pend
, v. A4 T2 F r# T8 m1 K& p" G9 W, V: G( @- {8 f0 g6 f
begin P_pick3 arriving) |& {& E" L; r; ?4 Y6 d
set A_i to 21
f( [5 K1 T: m2 v$ S, k4 A0 n9 \ move into Q_induct3
: _2 Z4 | O- N2 z* t- ]: E move into pickaisle.induct3, h/ R% @# m, K( P2 L& Q% \* k. I% `
while A_i<=30 do begin
6 |7 o7 I/ G8 h+ |1 @# |+ z5 E travel to pickaisle.con(A_i)
! ?$ Z/ v O( ?1 Z6 H1 L2 o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) \* ~; K9 A' o9 f' h else wait for 10 sec
! L/ M7 d( T# i. i) `6 R if A_i=A_leave then send to die
( a9 x/ A; f0 {1 Z- x( ` else inc A_i by 1/ y1 P7 |. L j
end6 R7 h: j: Y% ~+ `' B
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,其它按你的 ...
|