|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- [$ L% \: k! I8 F' z0 J0 [( c, Y4 R" `* G3 b
我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 o2 E4 \4 o/ l N2 w2 P. }
, a! `) _) K3 @begin P_read arriving% ~8 v& _8 F4 L* G0 k a% M% o
while 1=1 do begin
7 w& V, [0 E/ O8 Z; r* Y read A_tote from "data.txt" with delimiter "\n"
* X. M) b. d8 d. o7 l9 M i read A_time from "data.txt" with delimiter "\n"
r% p1 j: t: R* ^/ \$ E read A_leave from "data.txt" with delimiter "\n" X+ _ M! C! P1 O0 d
read A_picks from "data.txt" with delimiter "\n"
* s* A j0 ~+ z# R6 e6 Z8 G set load type to A_tote
; w8 A7 L0 }7 y V: L if A_tote="tote 1" then set A_induct to 1
6 J g" \' D9 ~$ A else if A_tote="tote 2" then set A_induct to 2' _/ L- a7 N2 m1 D" M
else set A_induct to 3 5 {% u' G1 q% @5 M" Y
set A_i to 0
2 j; j% M4 B& q1 [3 x clone 1 load to P_induction/ K; S1 j' W* v( j' n0 f
wait for A_time sec4 T3 H# f3 K# G+ Y: B/ I1 f
end
& v6 c+ c& o: Eend
T6 d8 i- n% B- _+ G3 I4 Z; Y# a" D' q4 E
begin P_induction arriving
2 m$ ^$ i& G1 E if A_induct=1 then clone 1 load to P_pick1
\+ p: v3 `5 O" h else if A_induct=2 then clone 1 load to P_pick2/ }* @. j T* R8 X# N U
else clone 1 load to P_pick3
7 P& T" t' @. Eend( B6 o4 P4 ?3 r. a& s
1 l; C3 G' L/ G: ^( @! L2 obegin P_pick1 arriving% h9 B8 y) s, V9 M4 v/ ~
set A_i to 1# O2 m, }* m9 c9 M* v
move into Q_induct1
& x- _% q( \9 n4 f move into pickaisle.induct1
4 c8 e: \7 d: P while A_i<=30 do begin
9 M2 s. b! L- I4 T travel to pickaisle.con(A_i)
. M/ L7 `. x a# q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 Z5 L' a) C o2 J else wait for 10 sec
- u& a; K( r1 g/ j0 @ if A_i=A_leave then send to die, j1 L, n, Y. N2 a0 y+ m
else inc A_i by 1
' _3 v* t+ p I6 _ end
$ I2 J6 T' i8 eend; J5 V5 P* c# l! \: J3 R
" k% U, V u7 vbegin P_pick2 arriving. g7 C; a" k1 V' B+ ?) c
set A_i to 11& Z: i7 }1 ~/ L O
move into Q_induct23 A8 d/ W- R3 [" d, B
move into pickaisle.induct2$ H& k Q- R) L2 h
while A_i<=30 do begin0 I. ^* k4 W$ i5 I0 Y# R: ^' R7 W
travel to pickaisle.con(A_i)
8 x N) L' ~* I5 r- W- E" v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# I& j9 T$ D! v2 x- l; z/ X5 g* k
else wait for 10 sec
% l) `, v! R& g* r* d2 |/ C) f if A_i=A_leave then send to die; j' f1 z F: C; V6 V- q
else inc A_i by 1
$ m" ^5 {5 z; m5 C* }+ N% A' a end% Z O3 }5 a; z! _ P' y+ q, j3 d' d
end
' h6 F: m8 {5 z Z! r6 ?7 a8 u# d, |) U8 @( c, ^8 R
begin P_pick3 arriving) Z+ |$ C& ]4 k
set A_i to 21
% V6 r8 J4 A8 z move into Q_induct3" n( e; ~5 _ `9 l. N/ N
move into pickaisle.induct3
. B$ E6 r6 H$ r while A_i<=30 do begin
2 M+ N: u8 J/ t, d travel to pickaisle.con(A_i)
) C" S* O5 I! u g/ }7 l/ G% j$ ?' s if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& t5 S- r& x8 `+ Y2 n9 y* M else wait for 10 sec
# [8 {" {& A! X( H if A_i=A_leave then send to die
: t& G G1 Y4 e else inc A_i by 1
1 p3 ?4 h% R' e" v' j! C end F0 j& v* V. t) j4 W- l
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,其它按你的 ...
|