|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& u4 ^ }# z3 E; k3 g; Q% T1 Q+ O9 I4 [7 }( N9 U. W
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ c+ L& A u4 ~) k. z9 N* D! d) Q# ^8 z' J T7 f* F1 e
begin P_read arriving* u: u* o- p, o8 c* O
while 1=1 do begin
1 |' I0 H+ i" o* I% x% e1 b read A_tote from "data.txt" with delimiter "\n". O u( B$ ~* y9 p# A# L
read A_time from "data.txt" with delimiter "\n"
4 X; x* }( p* s" E$ K3 j3 s4 B read A_leave from "data.txt" with delimiter "\n"
) O/ \2 H- r. c; Q5 ^ read A_picks from "data.txt" with delimiter "\n"
3 a& I* O4 O. N+ k! H8 Y4 q set load type to A_tote
- r( n% {% x! S! _' |8 `! n* r if A_tote="tote 1" then set A_induct to 16 P' P8 Z. t% m1 ~" S8 W
else if A_tote="tote 2" then set A_induct to 2% m6 k) Y; t h
else set A_induct to 3
( A0 {" E- N- C7 ] T; m- H6 \ set A_i to 0. T4 C3 G2 e: E/ \ L
clone 1 load to P_induction
/ Y" y7 n6 f1 Z# R2 V wait for A_time sec
5 p8 ?4 P5 v- [1 }( P. r. e1 N R" t end# Q* o# A4 l7 t- B7 n' e/ o m
end2 ?( D5 L0 }7 j' G0 h- Q' J
. M% e7 Y) p5 ~& F; V0 Mbegin P_induction arriving6 J( c8 L5 W+ O! ~. W( L+ D! q
if A_induct=1 then clone 1 load to P_pick1: v, a Y4 ^5 q/ R: a8 O
else if A_induct=2 then clone 1 load to P_pick29 |* s4 I' D' L9 n* a
else clone 1 load to P_pick34 I' Q/ u9 X5 D
end' {$ p: D2 W1 f2 ]8 v
' m* ^5 D1 @% Q% Gbegin P_pick1 arriving
8 R0 Z" c% V9 r5 f3 P/ r set A_i to 1
K E3 O) T) d2 U1 L move into Q_induct1
, ^( Z. N4 q# Z- ^" s2 ^ move into pickaisle.induct13 I! W3 T1 Z- R
while A_i<=30 do begin
. M+ Y6 j d9 g& z travel to pickaisle.con(A_i)5 L! E/ A _1 w: `! \6 ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 e$ c1 z% s" k, U2 l6 P1 S
else wait for 10 sec
7 J% A4 U& v8 h( R4 E% @ if A_i=A_leave then send to die1 V) H* f" ~0 o/ Q6 l. s
else inc A_i by 1% p* P- p! e' f! l2 S2 }. q* d
end+ n* h, c7 i+ @
end8 d7 S9 J6 B# `1 q0 {
' x6 q8 G1 [2 }) t1 `0 V5 gbegin P_pick2 arriving8 s h6 t& v* M9 l: S
set A_i to 11
9 t+ R4 M( \4 V$ w move into Q_induct2
5 i5 [( c+ S1 m1 {; T0 ?- M/ y3 u move into pickaisle.induct2
4 Z) c" E% X( D while A_i<=30 do begin& n# }# [4 r* Y$ @$ q
travel to pickaisle.con(A_i)( ]% M) J% h8 [! ^( O: a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 c6 q7 L" E9 }( T
else wait for 10 sec+ I* g9 { S, B2 n+ ~/ d; T
if A_i=A_leave then send to die3 @2 Q; k1 p0 A( ^) e9 F
else inc A_i by 1
8 i# ^5 V; Q$ d4 F end1 `# ]4 L: J# t" w( o% R6 I
end
" _) f% ^0 y9 A- x5 k; _, c, C; `5 M6 B. ~/ x' T3 `4 l, l+ s8 W
begin P_pick3 arriving# U8 H A4 G4 D6 T
set A_i to 21
2 I% ]. o% I5 q& U; Z. b2 ^' k Y/ k move into Q_induct3
+ ]1 o$ \, O3 J' z& P move into pickaisle.induct3
' z' H: n! W: `" F6 m$ W- o while A_i<=30 do begin" T# v" l b# X$ X
travel to pickaisle.con(A_i)
$ S K1 e% y7 M+ U; z F! D if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# _8 a/ v; s4 Q, l5 j3 N else wait for 10 sec% w/ _( q0 T0 _! L4 p" k1 |
if A_i=A_leave then send to die# _& ]) i A0 w8 j/ `
else inc A_i by 1
; q2 r" E0 ?- p0 R; a" b end: V0 y4 w5 d+ o- _& 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,其它按你的 ...
|