|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 M. q4 ^. ]) n, F1 B
- ^' e0 ^6 k! W我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 m9 k9 Q$ Q5 b3 g: ~# U, j- o
( q2 X& \" ^8 F" Z+ M% Gbegin P_read arriving
+ i1 X! D# [: I y while 1=1 do begin) k! I* b/ S7 H0 s
read A_tote from "data.txt" with delimiter "\n"/ s3 S) p) }, n4 p
read A_time from "data.txt" with delimiter "\n"
0 g, S- i" h- g' Z read A_leave from "data.txt" with delimiter "\n"
6 _) x' X1 b7 Q7 a5 m- W read A_picks from "data.txt" with delimiter "\n"
5 s) t: j# c( F, y9 U/ r! m: U8 c set load type to A_tote6 _, L& L! r ~
if A_tote="tote 1" then set A_induct to 1% w0 w% w- ]5 x+ E
else if A_tote="tote 2" then set A_induct to 2
% Y) i8 ~* Q6 [! O* T+ h7 I else set A_induct to 3 ; E8 q% w& s" _1 B% Y
set A_i to 0
! T$ v6 D8 O s, K# n7 v clone 1 load to P_induction
' x9 F" {; ^; h! s4 ?" u wait for A_time sec: \; v9 W5 B' y2 E
end% a+ N* q( }: F8 {# f
end
) h6 s* B2 N' @$ G* R( v, S; ?( N5 X. o) I: M3 G: W0 t- Y% ~
begin P_induction arriving7 D' C0 y T8 a8 [. X: c" b$ \! l
if A_induct=1 then clone 1 load to P_pick1
. U* A8 u, `* F else if A_induct=2 then clone 1 load to P_pick2
- G9 u3 Q# K# j; g( o: ~" Z else clone 1 load to P_pick3. U2 H+ o. v' p7 `8 K& A& B5 u6 j8 q- j
end
0 @# `5 d2 Y% b
, W1 \! w: G' p1 Wbegin P_pick1 arriving' M" o d- A2 E2 O. e: l' \: y
set A_i to 1
0 m( v+ u/ v* \5 ?7 X; ~% k7 M( }! y move into Q_induct1
8 E& o' r& L1 g9 A move into pickaisle.induct10 [& m& \- |" o; @) j, S3 _% e$ @
while A_i<=30 do begin
0 x9 u, p/ @3 Z travel to pickaisle.con(A_i)9 k! N* F$ B1 J9 H, ]) p
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. ^; P4 a; a+ ?9 b* {$ i+ F' M' y else wait for 10 sec, Q( @8 x! m5 j3 \$ c
if A_i=A_leave then send to die
- @. r# b! X) P" [ else inc A_i by 1$ n$ S) ?9 W$ Q( G! Z' k" v8 {
end
H) X' |+ h. C. tend
/ M4 i0 E0 [6 h" G( P/ E! |0 U
2 T5 P/ I4 ? n1 U3 G0 y( Dbegin P_pick2 arriving2 N' |( {8 o5 q. P- s! b
set A_i to 11; e) A5 F4 a3 ^" v2 U
move into Q_induct23 ?5 F. z7 C0 e- n. `. ]. O
move into pickaisle.induct2# T* {0 R9 s5 o7 x& x1 F- j! p
while A_i<=30 do begin' ]* S2 W9 M4 i8 V" B
travel to pickaisle.con(A_i)* m" t" s% j; G. u; @$ D1 ~
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 p5 I* f. `+ Y8 b& j9 Y else wait for 10 sec
7 F5 }( c- L) V$ h if A_i=A_leave then send to die/ U, L) c2 {( L: C
else inc A_i by 1% r, O7 ^: }! y! R& V! ` Z: E8 ]
end
$ @# p" G H3 e8 y2 t3 ^: S+ `end/ q% @! g6 J/ C/ T6 z4 f: v
8 i# {" L1 ]" n: Abegin P_pick3 arriving
( ^! Q; B* y# |# C set A_i to 216 C3 V8 l' [* Z$ r# U" l
move into Q_induct3
% ~+ X% @, U6 C$ ^' C. O5 Z, l move into pickaisle.induct3
. \. u# Q8 d4 h: r% \2 b$ l while A_i<=30 do begin
! P" p) O6 n( f" [# p travel to pickaisle.con(A_i)
' J/ ^" K0 G- L5 p# E& x* } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 {9 e$ m: _% w9 B% E$ p5 h2 m% F else wait for 10 sec* B! x A7 H% y5 x' W; g' v
if A_i=A_leave then send to die( x4 }9 O! C; g3 b
else inc A_i by 1
5 R2 m& h2 N, t. j, \ end( B; N2 M4 R" F$ r/ {* g
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,其它按你的 ...
|