|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ Y8 ~; ^) Y) I7 l2 G, T9 b4 O2 n/ _6 N* ?: m6 E& h& S
我的问题是,在每个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中的数值,不知道会不会有什么不妥。* Y6 o, _( P- W
1 b. t4 g6 w9 A+ q. z: qbegin P_read arriving# q8 w# e8 @9 Y1 u
while 1=1 do begin
" g) g$ H6 X! t3 R/ A read A_tote from "data.txt" with delimiter "\n"
- ^% K* S) c }/ @% I N- q read A_time from "data.txt" with delimiter "\n"" v6 @' }/ A4 F4 y) Q+ N4 N
read A_leave from "data.txt" with delimiter "\n"- ?6 K; W8 b2 F) L+ O- T% {
read A_picks from "data.txt" with delimiter "\n"
8 M0 C9 A4 e& d, f3 h: C set load type to A_tote: a. r/ S: f% J
if A_tote="tote 1" then set A_induct to 1
5 |( `5 z+ y. {& q else if A_tote="tote 2" then set A_induct to 2
M1 d, y" G' Z7 Z/ G: M else set A_induct to 3
3 i# F+ [# [+ {" x$ b) {* q% A set A_i to 0
9 I3 U" H) [. [, _ clone 1 load to P_induction' v, u i' L. @' {% Z; ]6 }- |1 y
wait for A_time sec7 Y2 W8 H, V- L4 [' J: _8 s
end
* {8 @9 F9 d c w/ J& W/ lend
/ b$ `& {/ C9 ]9 O! K5 _% O& ?- r1 i r/ p# z- b/ R& ]% Z% G
begin P_induction arriving- D% x. m& w t
if A_induct=1 then clone 1 load to P_pick1
$ n* |! q' g* g else if A_induct=2 then clone 1 load to P_pick2
. R/ v7 t5 ~; x- Z5 A0 i. m: a else clone 1 load to P_pick3
" G; I9 D: e z# E' Fend
8 @4 m8 v' R$ p1 B: m! H0 J, ~) A4 Z4 |0 u+ y- _6 R0 y
begin P_pick1 arriving% H8 h" q# F" ~2 n7 [' P" ?
set A_i to 1& U- Y. k: {- d2 J; q
move into Q_induct1
; n# C+ h& a7 G3 [# n5 E move into pickaisle.induct19 a2 ?7 ]5 |; H! Z+ q" X3 H
while A_i<=30 do begin: `/ H& Q, Y. b. {
travel to pickaisle.con(A_i)
1 S# z7 l6 U/ Y& q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 v' O9 O! P7 f! o7 y4 Y- Q
else wait for 10 sec4 @! S0 A: [- S7 C% O! L
if A_i=A_leave then send to die6 v- L6 j, }* D3 I9 {
else inc A_i by 1
$ l/ F8 {- @; Y* j) p end
e0 p; O: u @: C& q rend
6 n3 d7 \! P$ B! f4 \ P1 E1 |! Y) e6 P3 E- b, e0 l: |
begin P_pick2 arriving
7 A0 u+ {2 _ h: U set A_i to 11 I0 A0 F2 B* z# j! G# Q3 Q, w
move into Q_induct2& w: F: G% E2 F9 D- H4 q J1 s0 K8 q
move into pickaisle.induct28 F0 B. U. k9 l! X$ f1 k
while A_i<=30 do begin
' H$ F) _" x z( b travel to pickaisle.con(A_i)$ x& s; B& R/ }( |+ U2 x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: ?" W5 W; d0 P7 K0 } else wait for 10 sec
+ L9 F, g( s x( M4 [' J' U+ p if A_i=A_leave then send to die
6 R# W5 C8 o/ S" b$ O7 L% ~% v else inc A_i by 1
' H4 d6 K, z# c U ]7 Y( q) F end$ g$ u" X1 Y# C9 x7 g, O, d( i
end- b% ^* h/ E5 b
3 M* q$ m1 z; ^" y7 u+ P
begin P_pick3 arriving
8 G" w M4 S! C+ E# E) {' m set A_i to 21
% b' [/ m4 D( R/ F move into Q_induct30 [+ n- B# m/ A# T% z' }0 I) R
move into pickaisle.induct3; } n( E V" v" ^2 o! C6 Z+ c; N4 V
while A_i<=30 do begin
5 y! f7 ~6 L5 [" |. ~9 E& G& z travel to pickaisle.con(A_i)1 y) p; Y+ |- o. o2 [' E% v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" q/ Q0 F$ N1 ~. b' Q else wait for 10 sec1 {7 t T9 K/ @5 J/ i5 c
if A_i=A_leave then send to die. G% |, \+ O4 z) k
else inc A_i by 1
( [4 t0 u* G8 @* l end
/ k& d1 m" H4 w; ]" ^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,其它按你的 ...
|