|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 V! C: d4 Y7 m0 }$ k% g6 \* ~0 J! w; E
我的问题是,在每个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中的数值,不知道会不会有什么不妥。0 P- V F0 D2 a% Y- D! m# T
+ b' j9 V9 w& Nbegin P_read arriving
+ t: f6 r+ l: K% @9 i1 t while 1=1 do begin5 I* t6 S5 W" a3 G) ]
read A_tote from "data.txt" with delimiter "\n"
; W- F& ~) u& ?) G0 m9 X u read A_time from "data.txt" with delimiter "\n"! c5 r& x$ D! D
read A_leave from "data.txt" with delimiter "\n"
w- {; m k1 l; Z( D- s i read A_picks from "data.txt" with delimiter "\n"" r% W4 Y- s, U8 E9 g2 R% m# k* m
set load type to A_tote' S% B7 L& c- ^/ q
if A_tote="tote 1" then set A_induct to 12 h( j5 Z1 i* n9 r* c
else if A_tote="tote 2" then set A_induct to 22 u0 r' D. _2 {/ @
else set A_induct to 3
! X7 r. j% S* B+ R2 B set A_i to 09 w# }& y ?. K
clone 1 load to P_induction" _# k% ~+ ], a. O. y6 I# o# F
wait for A_time sec1 S I* y' \* W
end
! I" a2 k, Z4 @9 i) U# d4 L8 _5 vend
1 J% f/ ?" S6 `& f2 `
7 V5 N* D. z1 P+ d$ f Z2 ?begin P_induction arriving" T/ P! z6 F, ?0 F$ T
if A_induct=1 then clone 1 load to P_pick13 h1 s8 B9 e& Q+ C' p& H
else if A_induct=2 then clone 1 load to P_pick2/ P3 X1 H A5 \( E- _# G5 v
else clone 1 load to P_pick3
. o8 U9 X+ e( v# V- tend
$ {0 {; X5 j' W* p- E
" _3 L) w2 F0 r8 ~4 @- Nbegin P_pick1 arriving
- V5 f4 x) `% j, \; O0 j set A_i to 1* n/ S2 J1 ^0 n
move into Q_induct1
+ {2 x* E* f/ ^: O, F- v+ R9 T move into pickaisle.induct1
# k5 d6 m. N; [4 h/ A @; z/ L$ g while A_i<=30 do begin3 h2 }+ m2 v+ y
travel to pickaisle.con(A_i)% F2 y- G2 X9 h5 y% c8 y1 ?# _8 i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! B4 I. v4 z/ |8 R: ?8 l( N
else wait for 10 sec% a; I8 [8 L% ?+ Y0 i3 t4 f! m: W
if A_i=A_leave then send to die
$ N" f% [0 f- S0 U6 z else inc A_i by 1
+ _' C4 i5 k1 D3 m end/ J2 ^; `; N% ?2 n' T. t
end3 q0 k0 d8 m! M4 ]* f' i
7 D6 x: r7 l- M1 Jbegin P_pick2 arriving/ ^) k! R5 J8 G$ }
set A_i to 11
4 \0 D$ T) l G8 K9 Y% t- Q move into Q_induct2
3 W. E8 _- x7 y: x+ X, a move into pickaisle.induct2
! X( Z. f9 U7 L4 A; E# C& ? while A_i<=30 do begin2 G- l0 L2 e" ^8 A
travel to pickaisle.con(A_i)
, L3 V# n+ r; N7 R if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 S, G8 D: D! }8 R1 }3 A3 I: e1 p else wait for 10 sec
3 F% ?9 {& |1 |- r1 t if A_i=A_leave then send to die
# p" L' k. x- v* \6 i else inc A_i by 1: w- Y1 C! L U# b8 }. s
end
- M( u, G% l4 c7 Z: s) u$ Gend: @4 L5 J, \/ a# a8 B! a0 U. s, Y
& ]6 \5 Y) J- |( U% ~% ~. P6 pbegin P_pick3 arriving
7 B! a b+ t. V" m; o set A_i to 21
o* V9 T" O G" W8 X9 g move into Q_induct3/ I2 r0 Q1 b) p/ ^. U' ^
move into pickaisle.induct3
1 w6 f' k2 X1 Q while A_i<=30 do begin
' w& r( G' `( E travel to pickaisle.con(A_i)8 f6 m/ w3 k( F# }
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 {6 e& t6 z& c! q1 }
else wait for 10 sec
Z' g) i+ H" a4 k. r! C if A_i=A_leave then send to die+ [; r2 r/ |( u
else inc A_i by 1' o0 ~/ H( M: u: S( y, A( z4 Q* s
end: H1 V1 R" P7 U, _% h( q
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,其它按你的 ...
|