|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 A' H* Q+ S: N2 Z1 r ]. ]! ?, Y8 |4 D9 d
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! |- n$ n* E2 y/ p% ?+ S) {0 n
+ D( x2 l' l4 T% P# L
begin P_read arriving1 i/ X q7 a+ A) x c2 B
while 1=1 do begin
) x7 O' L s: Q( A read A_tote from "data.txt" with delimiter "\n") l7 y Q, Z$ b# u, E5 n% P
read A_time from "data.txt" with delimiter "\n"/ x: f& R* {' G0 L$ F1 L6 R' ~
read A_leave from "data.txt" with delimiter "\n"& U8 ~4 @7 h2 o2 ^3 \" l |5 U+ {
read A_picks from "data.txt" with delimiter "\n"* n4 Y4 H- W# R( h+ }5 X, @9 M) I
set load type to A_tote" {3 k/ o) i' b4 w5 m
if A_tote="tote 1" then set A_induct to 1
! V) m) U0 v* [ else if A_tote="tote 2" then set A_induct to 2
# C( Y5 z- j2 h+ D else set A_induct to 3
+ d# @, N$ B2 T9 m3 g4 U+ v set A_i to 0
% C6 W! z! V! P clone 1 load to P_induction
& A0 w* ` B8 i: b wait for A_time sec B' q; X4 ]" i$ H- f# y4 x
end& P% k" Q! {* l, F& d
end6 I. j0 v7 A6 \0 B% X
+ t2 h1 B! K) T6 @& q* T
begin P_induction arriving
) v! |( B0 B9 Z2 N if A_induct=1 then clone 1 load to P_pick1& E. G$ H4 C$ w3 x6 f) W
else if A_induct=2 then clone 1 load to P_pick2
3 M" s% f0 Q0 l' } V else clone 1 load to P_pick3
& S) ]: ^$ H. b. X% Uend
7 ~1 V$ ?4 M% O+ e+ i7 G' V* S" K: x# ~
begin P_pick1 arriving
( G: \$ d7 _& o" _0 e) p set A_i to 1
_* i) R* R; G) ]6 J) f, t3 N move into Q_induct1
1 t8 `4 r5 y6 Q4 g$ G, { move into pickaisle.induct1- n* S) j) h7 X0 H2 ~0 `) Z
while A_i<=30 do begin: Q* p) R, L- @5 N0 G
travel to pickaisle.con(A_i)! F! v/ h3 M( L/ N
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ B, L* C5 Q; O% v
else wait for 10 sec u, s! h! S* n
if A_i=A_leave then send to die
" Y4 Z. W4 u/ z6 B; V4 ]* U- F else inc A_i by 1# v9 s' u s2 Z% \$ n) b
end4 Y- a5 h/ B, l. {
end
Q$ S- Y: v& H! M3 g2 O
7 }9 ~4 `8 x) O$ o% M( |9 H. a9 kbegin P_pick2 arriving
# R& H6 l$ k0 `* Z4 I+ p set A_i to 117 P/ C* t' q" l/ W! ?+ P
move into Q_induct2* t" J3 n) e [/ ]. ]% u8 |
move into pickaisle.induct2 A! p: l: }# P, I$ I8 a6 g$ {
while A_i<=30 do begin
* w" m, K/ k, m1 P8 {* Y travel to pickaisle.con(A_i)
) R4 h$ d' w$ D( T* Y0 u" s T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 M9 ]$ i) S7 ^& t) T f* S else wait for 10 sec) D# a. Z* y. P% N. S
if A_i=A_leave then send to die. P0 o6 V; ~* u
else inc A_i by 1, V \! p+ x: l: {% a5 T
end
+ N; L* n) E; t& Y Y9 z& iend
0 \* i! A" N$ T; D& R% m2 B: E( j6 w, c- n) M
begin P_pick3 arriving
6 {6 ]1 A* F; ~7 l set A_i to 21
8 x1 }( H a! g1 ~! k move into Q_induct3
. E+ z( u5 }6 ?8 ^# Q u5 y move into pickaisle.induct38 |! X1 o' ^+ s3 h; r
while A_i<=30 do begin3 @2 D! p( T7 Z0 F2 \
travel to pickaisle.con(A_i)
, L; n. q, x/ H6 U" J: T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 ~! e$ S9 c, e. f1 H9 a. r$ |6 _
else wait for 10 sec
s6 v& K/ t0 A6 K0 {; w if A_i=A_leave then send to die- o8 ~8 S: m3 @# W6 _5 m n
else inc A_i by 15 Q5 b& v6 A2 y6 ~3 r5 c
end: G4 ]4 _ v) q
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,其它按你的 ...
|