|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 b# g3 J- `" N( K
( l0 G, ^# d w/ `. x1 \我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 p# G7 J/ ~9 }2 E4 F
8 M* `/ Q- b$ [. s; v0 D- hbegin P_read arriving
7 U: z# N* s( z% e5 @$ S while 1=1 do begin
5 o4 y2 V; N0 n5 G read A_tote from "data.txt" with delimiter "\n"
( r+ }; S; U% u5 G; W* n/ F read A_time from "data.txt" with delimiter "\n"
$ l# a' I( h. }4 t: g7 {4 W read A_leave from "data.txt" with delimiter "\n" [' _& B3 M$ j; Y, ~3 `, G' k
read A_picks from "data.txt" with delimiter "\n"4 I9 } K+ a4 m" } W/ P1 q
set load type to A_tote8 [% d( _9 x5 r2 s# u
if A_tote="tote 1" then set A_induct to 1
5 G' P$ s( h4 P else if A_tote="tote 2" then set A_induct to 2$ j* C" S* j1 m. B1 k3 r
else set A_induct to 3 % f6 w' \) x4 e+ K: Y1 _ E
set A_i to 04 [% U& Z* o" X ^
clone 1 load to P_induction+ L* V O; w$ b4 e$ A4 @. P7 O
wait for A_time sec$ ?8 q- w3 }5 j& s G
end; v( Q! P; s# i, S4 H7 S
end+ q3 D1 C0 P$ o0 S- X& s; f3 E
' _+ w' \6 c/ Z/ K" t6 W
begin P_induction arriving
, e* v. c, n& k% f- e t if A_induct=1 then clone 1 load to P_pick1
- x- C, m7 _. W% L2 S else if A_induct=2 then clone 1 load to P_pick2
: I# U2 u6 U8 Y/ V8 V2 k& c else clone 1 load to P_pick3
: D4 t. @! a! G+ _$ Jend, m; r( d1 n! p6 U+ v* G7 i! q
( t% c" f, s5 \: v; Sbegin P_pick1 arriving
' w; A8 B0 |: C% z set A_i to 1
; n" T' O( d$ _ move into Q_induct1
( M) h% D, Z# X( q' s' O move into pickaisle.induct1
7 `9 F! E3 E6 d1 d& `! [; Q while A_i<=30 do begin' ]5 X9 @& r" J
travel to pickaisle.con(A_i)
, |8 _5 F+ Y4 k) \6 k' W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! ^3 \( n& R! n e( z
else wait for 10 sec. h2 J4 ~. g, R- H4 L) X- P
if A_i=A_leave then send to die; p/ v+ s+ _: r+ T6 j5 _
else inc A_i by 1; f2 V5 N! T; H1 k
end
% _! i9 \" Q& V9 Dend1 r) B$ f1 F6 g: L$ o
( T. }9 A5 R6 R- D/ X7 a4 h& `begin P_pick2 arriving
% L1 c5 \" d7 y; _2 w" B set A_i to 11
4 d" @5 R* _% y! P5 K8 p& ] move into Q_induct20 u- X1 g& W, `5 j
move into pickaisle.induct2
, N$ I* h9 [% ], F while A_i<=30 do begin& n5 S; g/ V$ f' q9 S" L
travel to pickaisle.con(A_i). L0 u; G2 ^6 L5 X8 Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) k' `/ D; V1 C. |
else wait for 10 sec
0 G; ^6 f. l; X4 H if A_i=A_leave then send to die' f) E8 S/ F1 U c/ |' N
else inc A_i by 11 Q1 G- C9 _8 u
end
* F( r& P" Q+ |2 wend% V2 y x) N8 X' s+ O5 k: `
1 H; n! g; }2 t* j# hbegin P_pick3 arriving
' K L: s" C1 X+ n7 y' ^ set A_i to 21) R9 A8 e0 G) n _" E& ]
move into Q_induct3
' P: e- L4 U+ j# x$ | move into pickaisle.induct3
* d: i9 y1 A6 e1 K/ R0 p9 A4 A while A_i<=30 do begin' Y( E1 o' |! s; U$ A7 t' k
travel to pickaisle.con(A_i)
! [/ ?( t8 T: H# G# L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* N N: m) H9 ]8 ?2 [6 J else wait for 10 sec
0 t2 o) r7 g2 S' k, ` a, C if A_i=A_leave then send to die7 [3 J( Y0 t" F# g5 q
else inc A_i by 1
3 }( F2 p. p0 F! e$ u end+ ~7 \* v% }* l6 e# s4 q Y* l
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,其它按你的 ...
|