|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ |$ c5 O; ?/ {* ?+ K5 _ z: R1 o0 u E. {6 ?: S0 T# Q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。# c, ~7 W' a8 B) \3 m! O9 _
* G& F) E3 {; x5 M: B9 R! T, a0 X
begin P_read arriving' }+ M& S& Y8 U" F# p
while 1=1 do begin; V7 n2 x, r4 N% L P
read A_tote from "data.txt" with delimiter "\n": I1 Q4 v- b1 Z' s( |9 e7 R, U
read A_time from "data.txt" with delimiter "\n"
' |$ d% |7 ~ v+ E1 i read A_leave from "data.txt" with delimiter "\n"( L' m; V2 B! R4 L/ ~
read A_picks from "data.txt" with delimiter "\n"
" W$ {$ Q& J$ L t" W7 s( [ set load type to A_tote2 g0 o; K y" u: x5 Q3 |0 {7 q
if A_tote="tote 1" then set A_induct to 1
! a7 l1 N: o" ]# D$ d1 d% Y4 S* x2 u# K* O else if A_tote="tote 2" then set A_induct to 2
+ m8 O" `6 H% \ @ else set A_induct to 3
, c; B5 ^6 `. c( }' T4 K, X/ ~/ ^ set A_i to 05 [# g0 L; B% `# `( @0 _. ^3 @
clone 1 load to P_induction; ?, l7 |3 \: ^7 U3 V
wait for A_time sec6 X* W7 ~6 O- h+ V, z6 c
end# s; K" S" i& {0 N4 v9 x8 f. G# ]
end+ ]" A/ N4 U- J& |. a9 B- \2 n
0 S# p( ^4 C$ M" O& D; C' U! \
begin P_induction arriving/ R& y* t/ R% o3 G( `; c, N
if A_induct=1 then clone 1 load to P_pick1* L5 X' Z4 B6 B$ U
else if A_induct=2 then clone 1 load to P_pick2
4 E j# i* d' y; b7 _7 k else clone 1 load to P_pick3* N% {- N4 t' h: C
end- N6 t, E+ `. Q. y
9 [! W% _5 b. abegin P_pick1 arriving
2 m2 Q% q$ l. d& d/ q1 P set A_i to 17 q3 m/ l4 V1 U! U# P
move into Q_induct1
8 m/ ^2 g& ^# ?! ~) d move into pickaisle.induct1/ \& [5 m! r3 r( N" n- F8 Q5 @
while A_i<=30 do begin
6 A; j( H9 Q# [( p travel to pickaisle.con(A_i). P* C" F8 `4 [( t K
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( n9 j4 p" C" \0 G* T5 Q$ G1 a else wait for 10 sec
9 P4 d: l+ g- r, D9 f if A_i=A_leave then send to die
' \5 M5 n) S6 h7 m6 O6 |* @ else inc A_i by 1* J* A! Z) O& c8 L3 n
end6 h& ]9 ]% Y$ {: N; p
end) L1 T; R3 S& k7 K' r B
+ H: f2 L7 H- N/ v+ G% [' d( Z
begin P_pick2 arriving
5 A9 v' k& y4 {: T* e set A_i to 11
p' X/ |7 s4 K* s! z" h/ d' w move into Q_induct2# T6 o7 |# c: R; `* v1 \, ^
move into pickaisle.induct2' F0 P' {4 s) Y# _
while A_i<=30 do begin
# l9 u2 G( ^" ? travel to pickaisle.con(A_i)1 I5 p$ ~: x) ]* a8 {% @* u+ {0 v/ ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
B. c( u0 b. C4 Y( ? else wait for 10 sec9 h; M- S" J! ?. W6 T
if A_i=A_leave then send to die
$ q/ N5 A7 Y/ `5 N$ \ else inc A_i by 1
) Q1 K U; K5 m8 O' H end# K8 l; f; I# w: K' Z# _' e: e
end
, B* D* E* J6 s' J& [, p9 X. c3 S7 Y# U) h- G/ v
begin P_pick3 arriving
% {. e' ~2 n ] j6 \# L/ W set A_i to 21; }4 x- ~: y( O( {! \" W
move into Q_induct30 U5 E% f# q$ T0 r0 b
move into pickaisle.induct37 ^, H% {/ b% G% I; |: g2 ~
while A_i<=30 do begin
; u7 g8 h* A) A' x- h L7 o travel to pickaisle.con(A_i)
0 K3 _0 g( w5 f2 e/ j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& b- U$ q% ~( j: | else wait for 10 sec
+ }5 W% o: O) V8 z" y if A_i=A_leave then send to die
! a X5 [6 Y& R, G4 k3 r- x8 f else inc A_i by 15 [9 H5 q8 W0 C
end/ c5 R; ^$ x$ q" t( V! _3 c7 L! K2 U
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,其它按你的 ...
|