|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: T/ C5 _5 w* B! k; z* |1 j, z
- H/ d2 s2 o: a; D8 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中的数值,不知道会不会有什么不妥。% i% U# d k3 v( J
0 ^; g) |4 M; F
begin P_read arriving
0 c2 n6 \! e6 d: w) p6 t6 q$ h i while 1=1 do begin9 w+ V% p# K" k
read A_tote from "data.txt" with delimiter "\n"1 l( t" i8 B" x, U+ Y
read A_time from "data.txt" with delimiter "\n"
+ [& w6 l" f( M: t) e9 o- D5 S. { read A_leave from "data.txt" with delimiter "\n"
: z& D- {8 w% t; T+ E z read A_picks from "data.txt" with delimiter "\n"
, q- P' R' {9 m+ k set load type to A_tote
& Z4 V ]9 g0 A0 g if A_tote="tote 1" then set A_induct to 1
E1 I. g% r( N) O0 g else if A_tote="tote 2" then set A_induct to 20 @$ h( P: Z3 a; y8 k; D
else set A_induct to 3 + D5 |, w0 T, d+ s( ~$ T
set A_i to 00 |) X P' j# l1 B
clone 1 load to P_induction C+ `, i; R8 p( h8 O
wait for A_time sec( W# I e7 U$ |' f8 r6 w
end
$ B9 f) l- t9 E( j3 U( kend. P7 p9 s# E$ E- c2 b8 N U) j- `
; i# Y1 c( a$ e* u! ]; O% U! Gbegin P_induction arriving
% m& p, }, E6 b# P if A_induct=1 then clone 1 load to P_pick1+ ?- y' u* F' s( k2 J
else if A_induct=2 then clone 1 load to P_pick2
' g# _' V% _& M; s/ W2 O else clone 1 load to P_pick3
; N/ ? H( b- \( Y! S$ {1 p/ zend. Q( x: Z$ ?& ]
! y! Q1 a( Q% l6 O- {+ Y
begin P_pick1 arriving' J3 |* @& |, }! N# U, p7 T
set A_i to 1
* Q- a& W/ I0 `, P+ _ move into Q_induct1
) O# b3 R4 ]1 h, ?$ P' E. c move into pickaisle.induct1+ p5 l, e4 D8 W; g( X. } w
while A_i<=30 do begin; y! ?, Q L) X* s$ u% M, k1 |
travel to pickaisle.con(A_i)% t1 w3 F7 a4 d) V1 Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 {5 I7 U2 `: J" F0 b
else wait for 10 sec4 `! G$ Q5 m0 J3 }
if A_i=A_leave then send to die
, Q7 O7 [: f* {: T) x) g S else inc A_i by 1
T9 R/ \9 t3 ~8 E end/ Y Z6 R( _2 Y4 c' ~: \
end/ ~& s$ |9 i! `; U. Z# L
1 H9 ~+ P) J; T0 Rbegin P_pick2 arriving
! W/ a5 a- w& L0 Q w/ @" D+ p set A_i to 11
. b2 I; U& w% D: | move into Q_induct20 m9 H4 i9 _+ S m
move into pickaisle.induct2/ _4 z& p8 A9 O9 ^1 r
while A_i<=30 do begin
5 Q/ p u7 ^3 T0 ^% I% c travel to pickaisle.con(A_i)7 @% n/ w$ w% I4 f3 j! D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ f* }7 @7 z* [+ z) ~
else wait for 10 sec5 S5 J7 n% n( ?0 c! C2 l/ I, X
if A_i=A_leave then send to die" Z6 R) z `; K4 ]- h T |3 k8 w
else inc A_i by 1
+ X" Z k( b9 Z& w" q end
& H2 k8 z( G" B7 [% fend
/ H, J/ w `: o
# q- q5 W; T7 D# b) Gbegin P_pick3 arriving
& q/ D" l# X: q( x) z set A_i to 21
, x. L+ Y8 ^$ f, u( \+ _" w move into Q_induct3
( z; G& e! F* M! n& y8 d4 R move into pickaisle.induct3
' [2 C" z2 @6 E- K/ s while A_i<=30 do begin
: \6 R" i: H4 Q6 ] ~9 t travel to pickaisle.con(A_i)
% [% F6 @% \/ I9 ], R% v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% g M3 w% L, n& r6 w' u else wait for 10 sec! e. D8 p8 B$ t
if A_i=A_leave then send to die
- B& d6 S: A o6 ]9 t; D$ t else inc A_i by 10 _, |9 t8 w0 N* u
end
* H, K; d3 ~2 }& ^( eend |
最佳答案
查看完整内容
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,其它按你的 ...
|