|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* J! p) B/ k6 c) ]7 C7 ~+ w4 Y! i
5 A$ T/ K3 |2 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中的数值,不知道会不会有什么不妥。
1 e" R. o5 b$ ]/ D$ z0 N7 L+ u/ Z# q- z. B ~' R5 y
begin P_read arriving- S% R- f7 i2 \4 F) V. Y$ t7 T+ K
while 1=1 do begin' D* s0 A% D* u% A: z
read A_tote from "data.txt" with delimiter "\n"
0 t0 O' w7 }- j% E. p read A_time from "data.txt" with delimiter "\n"
/ Y* @7 R U) f& Y* {" s, J read A_leave from "data.txt" with delimiter "\n"
8 Q! N! |$ }/ I' f" e read A_picks from "data.txt" with delimiter "\n"
+ W" D5 j4 r) C9 J$ Y set load type to A_tote
$ t5 m$ g2 h* H+ }- E- } if A_tote="tote 1" then set A_induct to 1* C: F: R0 B! X3 l
else if A_tote="tote 2" then set A_induct to 2$ S. p5 t/ `0 V
else set A_induct to 3 P% T8 C E( r2 r: I- B- S
set A_i to 0) s( M" O' P& e2 n# L( K
clone 1 load to P_induction: a: j: S/ _' D' M, X
wait for A_time sec1 v4 d: m3 n: i. E
end
6 X( S% G7 n2 t. V5 f2 a4 ~5 M) i) Aend
+ s1 O& O, K* p$ o$ b
$ @, n9 F6 p3 A! w& R& fbegin P_induction arriving2 B2 C* o; c8 G
if A_induct=1 then clone 1 load to P_pick1* u3 B$ I9 o3 U
else if A_induct=2 then clone 1 load to P_pick2
- t0 Z$ @- Q' [3 a0 r! E else clone 1 load to P_pick3* W4 F9 F3 G9 d
end) H0 E( {# i$ @5 U: r+ I' R
+ I( G& b0 `9 F* @$ ebegin P_pick1 arriving. ?. L# K$ ]0 u" Q' _ y& s
set A_i to 1
% R7 \1 y2 n3 j6 i. h/ R: u move into Q_induct1, i$ a' ^ r( t9 M5 l2 _- x, [
move into pickaisle.induct1
- O6 ^7 P) ^8 b, \ while A_i<=30 do begin
7 U' E5 X9 p! F$ j travel to pickaisle.con(A_i)
0 r0 u7 }8 l/ b% @ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' a+ q. Q' p$ p# ] else wait for 10 sec2 z U- z" u9 x
if A_i=A_leave then send to die
1 G7 f# y$ t/ `, m1 N z else inc A_i by 1- m/ s1 _% f% a, Z6 T' G N
end+ g( {3 c) `4 A
end1 |4 I6 Q( q4 z" U( h
7 L8 z. z4 v( Q1 \. s/ P( Tbegin P_pick2 arriving, q( e8 ^( U4 n" `7 e0 Q' z) r
set A_i to 11# E* v0 Q7 F, @9 ]$ N- q8 N
move into Q_induct21 F3 g, {; n% l0 }4 H
move into pickaisle.induct2' V% S: b; X0 z- H z6 d4 Y; U
while A_i<=30 do begin2 J+ W7 S/ W+ }, O3 p' k4 Q
travel to pickaisle.con(A_i)
' \! e) Z4 b1 S0 s/ }4 r if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 H) n0 w3 h% O7 F" B8 B5 } else wait for 10 sec: F8 c0 M4 O; A- X. ]
if A_i=A_leave then send to die, c: ^0 R1 k% _* D( S" x, T
else inc A_i by 1) A. J$ }2 @4 U( K7 T3 F# d8 Z
end$ ]/ e' @9 n0 A) e/ J) ?6 a
end0 M6 j" k+ R$ l4 }) ?
+ ?' k5 X8 k' n; ]9 N( f
begin P_pick3 arriving
$ Q4 g w9 b, D! t: E, y set A_i to 21
6 W/ R" \/ a* z5 r) S# B move into Q_induct37 R* L* v- I6 c
move into pickaisle.induct3% u! k+ |, _: s0 t+ b
while A_i<=30 do begin
$ C, V9 w0 q" ^, x& v travel to pickaisle.con(A_i)/ W. @& Y, N7 ]3 J9 V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& m, S) h; B. v( {. Y
else wait for 10 sec
0 K7 Q* G. H, q. P& U! _! q if A_i=A_leave then send to die
2 g$ `0 ?$ c1 g1 { else inc A_i by 12 c) ^/ G$ a& w4 d! {
end
- L" N7 P; c2 Z* E. m+ dend |
最佳答案
查看完整内容
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,其它按你的 ...
|