|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! i: Y# @# q m( `) l* f
% L+ x- s- C, H6 T# I7 f% N
我的问题是,在每个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 W; ?9 n" c& C. l4 r) u: E* k0 w4 @2 j) V: P; F
begin P_read arriving
* S6 L8 H0 [: K+ L while 1=1 do begin. d. m& J: P5 s, V" s- x
read A_tote from "data.txt" with delimiter "\n"+ X/ X \. S0 ~, S' m; S$ \( Z
read A_time from "data.txt" with delimiter "\n"( J- v& W, x& K3 V k8 K9 [( Y; h
read A_leave from "data.txt" with delimiter "\n"/ ]1 O) j5 M: B9 h* M
read A_picks from "data.txt" with delimiter "\n": j1 x4 W+ i8 V$ ?
set load type to A_tote+ z N+ l7 b* _: S: }4 }
if A_tote="tote 1" then set A_induct to 1
8 o, L* e7 P; J+ L" ?+ ?+ K# n+ ?1 Q else if A_tote="tote 2" then set A_induct to 2
" H6 z8 J0 a0 X, v0 G: v& w7 X else set A_induct to 3
. O8 B; i! |# c set A_i to 0# v8 t. i: w k3 ?$ q1 f
clone 1 load to P_induction, t3 F2 V: m2 }
wait for A_time sec: X' @4 x! p& X
end# u- A5 l7 _1 E, D& x2 J
end
0 _$ B1 z3 v4 T
0 j ?0 }4 Z, q: @begin P_induction arriving8 b/ [2 S2 d8 o, m; z1 O
if A_induct=1 then clone 1 load to P_pick1" ]% x8 k0 y& X3 ^8 Y% m
else if A_induct=2 then clone 1 load to P_pick2
& s- ]0 ?: o% b# D2 R/ { else clone 1 load to P_pick3 M) s4 [9 ?5 M5 |0 I) W/ `
end+ ~- f g0 f% _; K
8 K4 [, A. J) K& Rbegin P_pick1 arriving
9 i; A0 L$ P9 j g$ x set A_i to 10 p2 a+ {9 ~% s
move into Q_induct1
* W) ^5 o) S6 L* |' w9 p move into pickaisle.induct17 G1 m" A; t% A* ?- t5 c$ D& [
while A_i<=30 do begin
- p4 \4 s& f' J& f& s+ T: M' v travel to pickaisle.con(A_i)
- S+ Q0 x' ]' ^* K8 r: L. b& y/ D if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( @7 D' Z- v' ^
else wait for 10 sec+ m: W/ f) k0 n# \4 O+ V! n1 d, Y! t
if A_i=A_leave then send to die
8 k+ c# t8 c0 C/ \9 w# [ else inc A_i by 1
- J! ]# Z* P/ L! F. v end* P+ m; {4 @$ F$ v
end6 D: w, P& K: `$ v
( P7 _) H; ? H) c" R5 abegin P_pick2 arriving
2 h( |. D3 U, W' [. U8 Z# g( Q4 | set A_i to 11( `9 ~1 k: C w& s6 A$ }' w
move into Q_induct2
, y7 L9 w8 n9 }2 W8 u move into pickaisle.induct29 X$ A$ x8 q: w$ N0 `7 _
while A_i<=30 do begin
% m& B9 Y* r5 { Q: Z- h/ A travel to pickaisle.con(A_i)
. `4 y' j9 q2 y0 l: l if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: b+ Q9 Z0 N+ h
else wait for 10 sec% s7 s& c, F3 \& I: [
if A_i=A_leave then send to die
4 V( ?7 _0 m/ Z* F. t else inc A_i by 1. G. h* v' H( [8 j& f
end
/ y2 @ q' @6 k1 c. ]end
# [5 c- l5 j9 g6 Y4 r% M1 L, d7 W0 S% x# N
begin P_pick3 arriving; S2 p b) t" }( a# T
set A_i to 21
3 y" C$ P, T. G move into Q_induct3
2 Z V% ~" s4 A( s move into pickaisle.induct35 G( W6 c# |* Q# t8 ~- q
while A_i<=30 do begin5 l* \/ B; H4 v- `. J, x! a/ s
travel to pickaisle.con(A_i)4 \2 ^9 N# }8 v, y2 j
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 j' d* W* d9 R) ~* ^5 v0 G6 H
else wait for 10 sec
u1 {, e; Y. y4 }6 P) C a if A_i=A_leave then send to die+ q8 w7 s3 n0 I1 E+ ^8 q
else inc A_i by 1
( O) T6 T; l$ S6 b7 e end
* q" [: s- o( iend |
最佳答案
查看完整内容
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,其它按你的 ...
|