|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ h: d2 y& d9 O
! |! L; H/ p0 U' s: i- K. ]% I我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ d: D5 Z: ^% @. |, N! e. _. |
: I1 |3 X" Q2 O/ g5 p0 Qbegin P_read arriving. l& i, G7 T: D6 n- D% c
while 1=1 do begin
8 S+ b+ N7 H8 e: {6 W- I read A_tote from "data.txt" with delimiter "\n"
0 i* u+ C, d4 L, ] read A_time from "data.txt" with delimiter "\n"
' F0 `' h7 X( l. s3 L3 n read A_leave from "data.txt" with delimiter "\n"
! z8 K) n6 n* P+ b% L( ~ read A_picks from "data.txt" with delimiter "\n"
* h+ X1 v, l% b( r# M) @9 G# G, _7 }' q set load type to A_tote2 h! A4 L8 q- B* h% n; [; Z
if A_tote="tote 1" then set A_induct to 10 x4 I+ w6 S9 r3 F9 I5 C% b1 }
else if A_tote="tote 2" then set A_induct to 2
1 `3 B% Z0 m; b- B7 R else set A_induct to 3 R9 C0 H2 R# o, e
set A_i to 0
1 Q3 N) d+ j. z' b9 c clone 1 load to P_induction
* n; ~: Q- F4 u7 E2 w7 r/ I; ] wait for A_time sec8 I. w, l# [- V- [$ Z
end. K+ f' E/ x' l2 J
end
8 F3 r, e9 c/ E8 v! o, W( _2 b& ^- \' `, N1 z4 r
begin P_induction arriving5 A8 j/ P* e' _' C
if A_induct=1 then clone 1 load to P_pick1 Z M# t7 Z- ?* H3 T0 F
else if A_induct=2 then clone 1 load to P_pick2( N! R) X: J7 s( t* ?/ q# }: p8 q
else clone 1 load to P_pick3/ V% K# W8 \, L1 R8 }
end
6 d* L' S+ j, D6 {9 L' h+ s7 g o8 V
begin P_pick1 arriving" x% P1 P# ]) o8 G4 y
set A_i to 1% a4 F( S0 i# h2 D' T- G
move into Q_induct1, A# X, N( U+ j
move into pickaisle.induct1# {! n3 w! h. F# `6 L, m6 g6 B
while A_i<=30 do begin% _$ v# |' F# v3 s( }7 e
travel to pickaisle.con(A_i)( T2 x7 y4 c* J5 q. Q0 o! D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 k9 V4 ^( g' Y+ e0 u/ S( j
else wait for 10 sec
. ^8 w9 s; O" x if A_i=A_leave then send to die; `6 l+ ?$ k9 h
else inc A_i by 1' l' o2 b, s1 A- v$ K7 g% c* A8 ]6 o2 C
end1 \; q( Q+ m3 d V. I' z
end
* a- [" B, O9 D' S* o8 D
! [4 I1 [! `9 G+ T: O5 ebegin P_pick2 arriving
% @* o6 l9 m% Y, D set A_i to 11
' h! F1 H% z1 R+ f8 O( e move into Q_induct2
% H: R$ b1 _ F* P move into pickaisle.induct2
; d) G+ |6 H4 _& H- P P+ f$ x while A_i<=30 do begin2 W7 o. t6 _8 H" w
travel to pickaisle.con(A_i)
9 L' D' B! z, S8 J: p- h0 N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 H4 N5 B" u( `: f else wait for 10 sec6 z$ b% }1 O; c, p/ Q9 V( s: Q/ O
if A_i=A_leave then send to die
8 W3 a9 \1 C* c- D% D$ C0 c& s' x& x) J else inc A_i by 1
+ g& n3 V, S& G end9 q. M! W0 G8 m! b6 ^
end9 O7 ?! j8 k/ Y5 {' M" F
. a h: `7 C7 w. z& T* |% d
begin P_pick3 arriving0 A7 M! ^. A9 W3 B, t- O
set A_i to 21
% x- X; ]2 P5 Q move into Q_induct3
4 w- k3 g( j. K; e- K3 G5 z; d- i move into pickaisle.induct39 F8 Y* l1 x/ k3 j/ [/ C& d1 z
while A_i<=30 do begin9 f$ Y! u7 c7 O, d1 j
travel to pickaisle.con(A_i); v+ P& [2 o4 n. h
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, c/ Z2 G: u# G. d else wait for 10 sec
7 i* v' O8 ?' h+ s! z if A_i=A_leave then send to die$ H; P) s1 a1 b
else inc A_i by 1
6 v2 v; M, i( Q0 j9 n0 G8 h O end
$ _" l' n O- }- P: C3 u% send |
最佳答案
查看完整内容
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,其它按你的 ...
|