|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, K; }9 m* ?8 w7 r8 v! l! {& P ^4 A% t4 C. ^ N; _- M4 ~
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ j- q" l* k2 M0 k x% a/ l4 g) `* F5 V
begin P_read arriving2 N' K: N3 m+ Y9 m B/ p
while 1=1 do begin. j6 [& X; A6 w) N2 p ?& f6 h
read A_tote from "data.txt" with delimiter "\n"* \# ?* n1 n; W( Z0 U/ q
read A_time from "data.txt" with delimiter "\n"* N* {/ W5 _5 U! @: B
read A_leave from "data.txt" with delimiter "\n"
6 g9 f7 x, w2 p( C& S/ X read A_picks from "data.txt" with delimiter "\n"0 K3 `; H% h2 I: j" v# I0 u
set load type to A_tote; C6 H- \$ A1 `* }3 f
if A_tote="tote 1" then set A_induct to 12 G) d: c( }) I, g, F
else if A_tote="tote 2" then set A_induct to 2
$ n: o: j5 v+ j, B4 J+ |7 L else set A_induct to 3
1 m7 x% q1 I2 x/ `9 ]( ^! C. C set A_i to 0
9 x" h% z1 m" p' l; C" i clone 1 load to P_induction# ~3 p8 K* p7 s2 I+ f
wait for A_time sec3 p8 P( Y n. _" O6 b9 a
end
: g7 p4 Y0 i$ b( }$ _& E% O _end
' a+ y4 d" l# M% p4 w2 L3 x: k8 w5 {2 Z8 m" W% i( ^
begin P_induction arriving$ Z# @; w( `. L) i: l! z8 T! R
if A_induct=1 then clone 1 load to P_pick1" @5 x l, P+ ]- _
else if A_induct=2 then clone 1 load to P_pick2+ t$ M6 j) r* R( ?5 X B" e/ v$ B! b
else clone 1 load to P_pick3
) d' |0 F8 R u# S0 ~- eend
" Q5 y+ U$ }4 V' A0 I, ~$ [. [2 z* K1 x' S5 O: b: ?
begin P_pick1 arriving
& m; I4 b8 \% L/ V) V) B) c set A_i to 12 I7 x% @9 R- P4 x4 }/ j9 y: |
move into Q_induct1" m8 x9 \# Y3 Q3 g6 j
move into pickaisle.induct1
: C/ L7 O5 c1 T" i! R D, @ while A_i<=30 do begin* L8 r3 i' n2 P! H4 E8 p" i
travel to pickaisle.con(A_i)
! N$ r, _1 e6 y7 h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 V& G8 T0 |+ D, r. V( b else wait for 10 sec+ h5 B2 Y# n4 D' @% b$ d
if A_i=A_leave then send to die0 R( b( L* F- {+ E( b1 o/ |
else inc A_i by 1$ r3 `& ]; }& O+ V
end1 [" l' @& Z6 d$ H- X$ K* b
end
/ H$ L, s. @ l; ^* S d: [: V- e7 z4 a* B! ?0 Z: i
begin P_pick2 arriving
" ]0 M3 L2 k) g set A_i to 116 w. D! J: L8 q( _: ]$ B- h5 ]
move into Q_induct2# o) |2 z5 d5 B U; g3 Z
move into pickaisle.induct2) Q5 M5 m* R1 E; B* ^- J
while A_i<=30 do begin1 f1 U0 ~8 J0 O( _5 r) t' w. J
travel to pickaisle.con(A_i): n+ V/ C) G. K6 d7 m" D0 m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; y: }, ]6 T! o2 b/ E* N else wait for 10 sec
. @' |7 R6 G' V' q$ z if A_i=A_leave then send to die
2 l: @8 b* O2 R) x else inc A_i by 1
6 q; @9 ]1 C) D) w- H/ w end! `: L# a7 h/ c% o/ {* y8 K
end9 U; C8 T. p/ f, ~( F$ ~: }1 Q) T
7 x1 h# w! x' d+ N2 Tbegin P_pick3 arriving
# g2 ^6 A* ]( f7 x set A_i to 21
n0 B. y) _3 A: ^ move into Q_induct3
3 L, h3 z8 T& e4 G move into pickaisle.induct32 [% k/ a; S- B2 G$ ?7 a
while A_i<=30 do begin
+ s& L6 q; ~. W- u/ ^ travel to pickaisle.con(A_i)
7 p4 C/ P J5 {& Y( k" D9 S! ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# D) ?$ [) I" W$ |3 ] else wait for 10 sec
9 j5 E; }/ {# X# F if A_i=A_leave then send to die
1 f' I% C9 }# B9 k# \" @ else inc A_i by 1" A2 L# Y) k9 V5 `2 V
end3 q6 X, v$ m# w; }' r7 o; 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,其它按你的 ...
|