|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, B$ |3 B- T* c! m5 M9 l7 y2 F U% G, e; w$ j
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 X; F% y! N: e- x+ s9 l
% O6 N& ^/ ?% k; }( \begin P_read arriving8 x& X2 T6 q( g% s1 k9 M
while 1=1 do begin$ _( g- G) Q, w( c7 w1 u" {$ J
read A_tote from "data.txt" with delimiter "\n"
' C% a9 d g# y; C$ D read A_time from "data.txt" with delimiter "\n"; v5 {4 T! N. J/ p( @) B( r+ ^/ }
read A_leave from "data.txt" with delimiter "\n"
: U8 u8 B; Q J5 b; n read A_picks from "data.txt" with delimiter "\n"
; O' t- `; F1 G) g X \, { set load type to A_tote% e* J3 U$ W* Y, V6 s7 Z
if A_tote="tote 1" then set A_induct to 1
6 G+ S9 r4 g: o* ` else if A_tote="tote 2" then set A_induct to 2) ]3 \( Z9 F7 d; N
else set A_induct to 3
. M% m K6 U7 B* M& j set A_i to 0$ k8 l0 K4 O- g- k8 p. W: i2 o; s" d
clone 1 load to P_induction( U% d7 y3 C Q+ T6 x: A! B9 v' [
wait for A_time sec) A% \3 D( i" F1 L" v! K ~# J
end
# X& v" p9 k/ V( c& Cend
7 G% {/ \9 L7 `- }2 O2 L6 a0 b* N' F! s7 T
begin P_induction arriving
- v! F$ V0 P2 K if A_induct=1 then clone 1 load to P_pick1* d0 P9 I" E g& G5 w
else if A_induct=2 then clone 1 load to P_pick2
& o; I; f8 U2 e: v3 g2 o$ t else clone 1 load to P_pick3- `3 T' T5 M. u2 V# M
end( I5 V! X7 p* R3 h, k [' @
+ i# Z& T2 Y) d7 j1 Z
begin P_pick1 arriving$ u6 u- n6 x0 A$ \: i
set A_i to 1/ e j2 a& n6 R4 v; b3 E
move into Q_induct1
. k' ~9 |6 M* F; u3 V8 _ move into pickaisle.induct1
/ Y) I% V% `. _2 o" d while A_i<=30 do begin. C: g9 o+ }3 i% |* p% s6 a
travel to pickaisle.con(A_i)
* }$ ?7 S3 ?, Y* y% O; i5 @5 V% B if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" B1 ?" S- F1 U# [! B4 j- F
else wait for 10 sec
! i) I. r& c8 o G5 n: g if A_i=A_leave then send to die
$ M2 J% d, e9 X Q; w* Q3 d0 j% @, K1 t else inc A_i by 1
7 G, [+ m0 x5 W! M5 ~2 w2 K+ a end/ Q& h1 d; _. W, z2 G
end; t7 H( c$ B' r$ z
* z9 I& v2 G) N* W' u I8 u/ W* c1 J
begin P_pick2 arriving0 T' R6 |- {8 P5 ?8 X
set A_i to 118 t8 ?0 ^8 c, Q0 n) Q) }* Q6 n
move into Q_induct2. a- M' [; ^$ R t
move into pickaisle.induct2 N6 q$ _) P A7 m: O0 }0 t
while A_i<=30 do begin
6 v/ v; t- P y$ P! i4 E! O travel to pickaisle.con(A_i)1 u2 P, N/ g7 a* c' b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 M2 \4 c9 X2 p& k& F$ F4 ?; l3 U/ S4 C else wait for 10 sec
/ y7 [, `( D1 \- M if A_i=A_leave then send to die
, A7 {: ]4 B$ r# }3 R else inc A_i by 1
7 q* u: [' J0 Z1 d3 M0 l) c& P* a end% h1 `' b+ f1 u) Y: M" D4 s
end
0 @5 ~+ l# D- Q# D" }' ^7 A
5 }! V' f; [/ l- Y* i4 `5 fbegin P_pick3 arriving
3 O; q4 m+ J/ O! u6 A' P7 E6 L5 p set A_i to 21
9 Q. B H6 _2 k+ B! h0 n- M$ @ move into Q_induct32 J" i4 c; s/ Y* {1 v% t6 d7 `7 v
move into pickaisle.induct3% t, o& e4 Y N7 h$ l5 U* g
while A_i<=30 do begin4 O$ p, K8 \5 }8 f- N/ v
travel to pickaisle.con(A_i)
/ Q% ~2 Q4 w: E8 ]) j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( g2 x9 J$ k, e# ~2 { else wait for 10 sec
/ \) `9 k: m! O& n& t/ c g if A_i=A_leave then send to die
! f7 Y6 ]- L. B2 c+ S else inc A_i by 1$ |3 [4 n* f, ~2 y, {/ w' Q
end* s: k3 w, {2 P
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,其它按你的 ...
|