|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( W+ L7 O! U% S' u, m0 I& |
! W- O1 p3 g3 }5 I" u* ]% U我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' Y. T. j$ G: j! b% b9 G2 H# ^$ i" J* ^6 [- ]3 h) D) f
begin P_read arriving4 ?. r$ f$ ]0 m% o/ {0 ?, O' S* D
while 1=1 do begin3 V; X# @ u+ `# r
read A_tote from "data.txt" with delimiter "\n"
5 j3 E' H1 u3 b; T) P read A_time from "data.txt" with delimiter "\n"% b+ x/ _, K/ u7 K; A
read A_leave from "data.txt" with delimiter "\n") ~! Z4 F$ y+ N9 y: J
read A_picks from "data.txt" with delimiter "\n"
4 X* a! Y+ _1 A' ] set load type to A_tote
5 U8 N* t& a4 G if A_tote="tote 1" then set A_induct to 1
/ T% M. y7 M: K5 g' D else if A_tote="tote 2" then set A_induct to 2
$ X, D8 d0 a" |- C0 l else set A_induct to 3
, \7 m% E& N/ O set A_i to 0
6 e* O H4 H& }1 w b clone 1 load to P_induction0 k, f2 A+ D' a- g# I
wait for A_time sec
* `: R3 r9 p5 Y) r$ b. a6 s- I end7 s+ i. x5 f) ]* A, R
end
2 g4 e$ ^( P3 V" i
4 @9 V3 }3 L2 C, Y& pbegin P_induction arriving; G; j6 A1 j; Z! S! k
if A_induct=1 then clone 1 load to P_pick1
* _- Z' u0 ^& T( @& @* q else if A_induct=2 then clone 1 load to P_pick2' @: j6 S0 ~: {6 d- w
else clone 1 load to P_pick33 C8 I$ i- \7 z$ Q) L# M1 Q
end- R Z' z* a& n# {6 H
3 p( F( Z$ ]7 _7 D8 j2 a0 q
begin P_pick1 arriving
; O5 n; G9 \6 P, `* T( q: Q set A_i to 1
% y# B2 i% A3 M, i/ R( N% z move into Q_induct17 G) g) \: m) J6 T/ p
move into pickaisle.induct1+ A, \ a2 h/ s. }( M. X! A0 u
while A_i<=30 do begin5 C; }& F1 Q4 t- u2 _2 c
travel to pickaisle.con(A_i)
# M4 U* b! T, H- D. u, x/ L2 Z' { K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 w% n. o5 L3 s' Q
else wait for 10 sec- X4 J$ O4 ?* h( N
if A_i=A_leave then send to die- T# e% a' n, e. g; f5 I r
else inc A_i by 1
3 N& }' O0 O& t$ u6 J, Z end4 Y: Q+ `) y6 t1 Z+ }, d7 o
end
4 V3 Z# G. h. C. s: V: q! _4 x' N- B: p% }" W7 H
begin P_pick2 arriving
4 V1 }# U: w) Z& I. _( g5 h) I4 K2 ? set A_i to 115 A. z, ?% t2 c) M9 A
move into Q_induct2
* j! M1 v) v7 X, y3 Z/ o, A: ?# a move into pickaisle.induct2
6 g0 L5 `. W# `/ @; V O while A_i<=30 do begin6 y5 t z- l% P3 g7 K/ g! M
travel to pickaisle.con(A_i)" N+ B: o% w" Y: s4 E9 Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% g T6 w" N6 p3 e0 q+ g& ]# k
else wait for 10 sec: r9 k, p" n, H/ B5 E) ?& m9 d! O
if A_i=A_leave then send to die( W' K) G9 }( z2 r, A8 F
else inc A_i by 1! I" @' c: u$ {/ q
end
8 I& R' {1 n4 d8 V& Uend
( c4 S, i( _: ~) n) W' W! l$ j
9 c- S& N: q/ Q) y7 N; o% `begin P_pick3 arriving
' c9 b' @# ^2 K3 R set A_i to 21
* l4 q; i+ z( ]. l8 R6 Z move into Q_induct3
* [9 E. X# ~& u$ q( M0 j move into pickaisle.induct3' v" `' i7 B/ d* f, _
while A_i<=30 do begin# h) k" q3 M: ]7 E
travel to pickaisle.con(A_i)* n0 U2 ]1 S# Y7 h0 e g2 x* t W1 @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 r+ G9 }7 J, `% ?/ W, X else wait for 10 sec7 Q! R \& V" _" x6 ^: P
if A_i=A_leave then send to die6 I. |* Q% i; w- Y8 q9 X
else inc A_i by 1" S2 N: B! n, e
end
/ m" r2 q5 M( }9 yend |
最佳答案
查看完整内容
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,其它按你的 ...
|