|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- p" }5 f- J7 Z+ g5 d& |- }+ [
! O. L: R+ j+ F {- F6 T& |我的问题是,在每个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中的数值,不知道会不会有什么不妥。* N# E9 Q- o3 D; \: _. @7 k
7 \) Z' x( a4 [0 h0 ~, g0 N- ubegin P_read arriving
8 ? |3 _( D1 l& w, @9 Z+ C while 1=1 do begin2 t+ f1 `. K r# j' W- `# V
read A_tote from "data.txt" with delimiter "\n"
: s( v' i1 D* ^4 r5 m: W+ a3 V7 e read A_time from "data.txt" with delimiter "\n"3 u* w9 G' K( S) E$ v
read A_leave from "data.txt" with delimiter "\n"+ | Q" h) |8 M5 @! ~
read A_picks from "data.txt" with delimiter "\n"
' z0 u6 a; e' O2 e) H3 d, F6 J9 ~6 T set load type to A_tote ~* M; Q _$ |& r# b: Q7 X
if A_tote="tote 1" then set A_induct to 13 f1 @7 I- _+ N* m0 r! D
else if A_tote="tote 2" then set A_induct to 2: F4 N0 ?3 I ]3 k' p0 {% ^ v
else set A_induct to 3 6 b0 ~' r2 o* ?. |' c
set A_i to 0
/ A5 z7 b+ F, K5 Y: n clone 1 load to P_induction/ w3 r' d, I- w- ^6 H; G
wait for A_time sec
# }; m6 \( O( V' q' K8 U5 d& _7 V end
) w" B. X* E8 o. @end
( M& i' X# F9 l
8 n7 Y( k4 Z: x( A, Nbegin P_induction arriving
! k5 _4 t1 G$ d' s, S! D if A_induct=1 then clone 1 load to P_pick1
8 `/ m' r( ~: ^7 i else if A_induct=2 then clone 1 load to P_pick2
. k$ `! F, _2 d( z else clone 1 load to P_pick33 t7 Z! J) z. T
end
& K. m2 W7 R0 L# a7 p% k
* T6 R! w# O9 s, V( wbegin P_pick1 arriving
2 q. x8 t: D* I# d' V5 Y1 b& _3 U3 ] set A_i to 1
( U' p9 S1 I! L( ~& J move into Q_induct1$ g' M1 }7 \" H9 L' G4 _
move into pickaisle.induct1
( p- c8 U, W' N+ D7 Z- e0 M. Y while A_i<=30 do begin
$ E* k4 v* x2 w travel to pickaisle.con(A_i)0 }/ R0 a- N% ^3 b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 P9 r- W2 @4 _* z6 @9 ~- b' x0 N
else wait for 10 sec
4 Y6 J5 F% w) S) q" b N" z9 v$ y if A_i=A_leave then send to die
$ M _4 `; n8 l& \6 O else inc A_i by 1$ {* `; G% l0 u4 W7 L; h
end
* Q, v. Q. \9 Cend
3 Q) D! Y8 V, j3 A
% R' Z1 K! j2 j; Vbegin P_pick2 arriving
2 r6 k3 G+ J4 o0 T set A_i to 11
; o+ F6 V+ x5 v' p# _2 {4 m move into Q_induct20 f. V# J5 x5 A; z
move into pickaisle.induct2
( _/ T" M8 g Y5 p2 X D8 Z3 s while A_i<=30 do begin+ x5 p7 b5 \7 i8 \7 s
travel to pickaisle.con(A_i)2 a* p1 ?6 w+ G6 a: z/ D2 ?1 V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, z5 p8 c7 g( P8 y1 g% ?* ?
else wait for 10 sec
! d, X; O/ b: G1 x if A_i=A_leave then send to die
8 Z' r- I! X6 D" F else inc A_i by 1- G% _+ r, Z% ^; o
end
4 |0 j% |: C" |end
+ \3 K$ J' J/ Z
) G: t. G. V0 N- R5 a5 N, C/ Abegin P_pick3 arriving
5 E4 T, z7 U+ ?+ l! ?3 v set A_i to 219 M. n+ K' y& W* i9 S5 p' ~
move into Q_induct36 v- O0 O% P* d7 c9 h( E
move into pickaisle.induct32 {. K* y; v8 S- F6 a' y
while A_i<=30 do begin
+ c# q0 K4 B, R8 M travel to pickaisle.con(A_i) N$ m% a6 A6 e5 T9 @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ j9 C' B1 @3 y( P) ?
else wait for 10 sec& F/ D* M) ^% E5 C% v7 l; i/ k
if A_i=A_leave then send to die0 m& B6 d% r2 p
else inc A_i by 1
; J8 F5 Y& Y1 ^$ A end+ K6 q2 [# y8 D4 W8 [6 b) O
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,其它按你的 ...
|