|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 V0 I5 j9 z6 J9 p" M' P" k
0 X$ {7 J a+ [我的问题是,在每个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. K9 } o, f
, M: Y, N- D. c2 V; x; hbegin P_read arriving: j' C1 ~& L) P8 K2 @
while 1=1 do begin) M! E/ c2 i* ^) h' L8 I0 x/ Y
read A_tote from "data.txt" with delimiter "\n"
: b/ n& s& x& J+ p1 V read A_time from "data.txt" with delimiter "\n"
: q. E4 v- B; Q7 }' [1 q read A_leave from "data.txt" with delimiter "\n"! f7 R: O: ~3 U. W. }
read A_picks from "data.txt" with delimiter "\n"
; k: p, ?4 Q. s. _ set load type to A_tote
* C: e; F' c p! M* O if A_tote="tote 1" then set A_induct to 16 H/ R. p2 N% c q
else if A_tote="tote 2" then set A_induct to 2$ g" Y1 b/ G) W# O3 B) p f
else set A_induct to 3 3 {2 B# y7 W; B, Q' f/ X3 I( k
set A_i to 04 P: N& a# c9 X9 M* t$ \& a
clone 1 load to P_induction
0 {. ?) L' B9 Z; l8 {! C% x+ X wait for A_time sec& k2 a$ Z8 d( l" E# T% Q$ `
end5 i7 I9 i; w7 r+ e
end
+ X0 b( q+ |% Y Q9 }% {- P, M) |* _
begin P_induction arriving
& O2 T, h6 h: u4 a0 w. _* P if A_induct=1 then clone 1 load to P_pick1
2 s% B1 T& P: G! g: Q2 n5 V g- L: p7 T# q else if A_induct=2 then clone 1 load to P_pick2
6 ^$ e5 l+ F( |1 Z else clone 1 load to P_pick3
2 w3 }4 \0 _' @+ |- q4 {end
5 D1 }8 a: t8 C9 h, K/ W
7 K, x( t1 ~ Vbegin P_pick1 arriving
' L5 ?- C; i5 ^* A# L5 b: x set A_i to 1: x! a+ @& h- L8 g8 ^8 T h
move into Q_induct1
1 r& B2 C% [" H! ]) h3 f" ^ move into pickaisle.induct1, |$ s1 t1 ^4 n0 X! N" j
while A_i<=30 do begin1 r, a7 M- R4 X1 m9 u
travel to pickaisle.con(A_i)- n, v/ L" y" d" q4 n7 Q5 c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ j; E) E" p/ B {0 a
else wait for 10 sec
4 B4 ^3 K8 ]* R; u if A_i=A_leave then send to die: ^/ E7 M* ]' @2 ~; j g5 @$ G; t
else inc A_i by 1
- T! E( m7 e6 ?1 v/ Z: c end3 S6 s: o, _( D- B) }, v0 H
end9 J6 c) ^2 [' S1 h* l
' n+ X& a# k1 o8 g. f. N0 v
begin P_pick2 arriving
, B3 W) J2 _ [ set A_i to 11: [) `7 Z5 i9 l/ F7 B: b" S
move into Q_induct2
+ s) m, y1 k) R move into pickaisle.induct26 P6 C0 x" H, t: G
while A_i<=30 do begin3 f: T8 h% ]1 B/ H0 P( x
travel to pickaisle.con(A_i)
: _- U# D2 {# v5 m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ _6 P F$ m7 q: l/ ^) J; p
else wait for 10 sec
- J+ n5 L1 b7 E- l% i6 ] F# m# C) u if A_i=A_leave then send to die" y' r( c0 d5 U j# z5 M) j
else inc A_i by 1/ m% a& ?/ u8 p
end
$ r: J+ O8 U( {6 ?" N+ M9 wend
* i- }2 c' g5 @7 U1 G' F4 X6 z$ p+ f
begin P_pick3 arriving7 S3 E" e& o# |3 u7 [; J H
set A_i to 21
0 h& }) P/ L0 I; |0 O2 }- P move into Q_induct31 C/ v7 A5 b& ^! n4 s9 F2 o3 O- Z
move into pickaisle.induct3
5 J& q1 t0 u% {( q6 ^0 Q" b while A_i<=30 do begin% ?+ U: L; V. G+ ~1 j/ e( z& G( O+ H
travel to pickaisle.con(A_i)
' c$ C0 |' u- c. T% C5 ?6 P% K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 m' A- T: L. x% [
else wait for 10 sec( C$ A% J0 H- c! K4 I z, e
if A_i=A_leave then send to die8 I+ q' n7 s; h8 g* i+ |! e
else inc A_i by 1' t0 f+ x+ }% Y7 Z8 j5 @2 }2 T
end
: E A( y0 r8 h* v. a! 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,其它按你的 ...
|