|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. r: c% k3 }' R( x4 F/ n
: b+ B: v/ P$ [- X! J+ u
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. l# z" h$ b5 J/ f0 C/ x; `1 Z8 O: ?/ W8 _# d0 F K) e1 W( Z
begin P_read arriving/ S8 o- H! y: m, E+ P
while 1=1 do begin
2 T" Q0 n! A; }* y$ } read A_tote from "data.txt" with delimiter "\n"
) O' x) S- s, N* {7 ^ read A_time from "data.txt" with delimiter "\n"0 `. D; D: H+ p) s3 v0 p
read A_leave from "data.txt" with delimiter "\n"
' G# B2 |# f% Q; R4 W k$ f6 k& R read A_picks from "data.txt" with delimiter "\n"
' \0 z2 _. e$ V+ K$ c1 C set load type to A_tote$ O: |+ Z0 a1 i% d
if A_tote="tote 1" then set A_induct to 1
0 y1 U3 A+ {, k4 N9 d else if A_tote="tote 2" then set A_induct to 2
3 [4 M2 n0 [# v6 ^5 ^2 O+ s, M else set A_induct to 3 , D1 c0 G5 ]3 A1 R6 \
set A_i to 0
$ f9 b/ m) x' L% v5 e3 c7 {! t C. p clone 1 load to P_induction. Z l6 |% l; e1 o; s+ W
wait for A_time sec. p; Q0 a" u0 T, R* h( p
end% x0 c) e( k% p5 o- G$ x+ ]
end$ G$ m% X$ t4 A( o
l& C- T! D2 Hbegin P_induction arriving9 Q9 k W- O, U9 c0 f' t+ O9 C
if A_induct=1 then clone 1 load to P_pick1
% [7 G" z' I/ [2 {" ]. Y! D( f else if A_induct=2 then clone 1 load to P_pick2+ F; Z' }, ^$ G9 I' y4 b& O4 G; ^
else clone 1 load to P_pick3
" b; f& V4 x' @8 f4 Pend7 H1 ^* o/ w4 P% {
7 g' T( q, ]/ L; O% _( L: l0 z
begin P_pick1 arriving- G7 u6 W2 d' {& E
set A_i to 1
9 _1 ?1 f, A) T* n' X move into Q_induct1
9 P% T1 d8 a5 u$ z6 ?5 `. d) T move into pickaisle.induct1( B/ L# x7 Y0 O( ^
while A_i<=30 do begin
3 L% K. k& B1 y6 e travel to pickaisle.con(A_i)) ?3 {8 d6 [4 i3 _) c' I' a W4 K
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ B$ J$ K4 R1 r4 S8 J4 d
else wait for 10 sec H3 S/ a7 d# r/ H9 J V$ |+ Q
if A_i=A_leave then send to die) _3 k- c3 x1 r! g5 x0 `/ J! I
else inc A_i by 16 @9 q A+ I4 }- r( g
end
: W8 p% x; V, R1 Q. tend; g# b! }0 g) `$ q. G5 j8 F
7 m6 _' a, `' z6 T0 S- x" qbegin P_pick2 arriving; T: U) B* c4 f9 k: ?+ I2 `
set A_i to 11
! v: S# q- F. W. Y" R9 c move into Q_induct2
( B7 i. Q: ^ ^6 b3 X6 y: i move into pickaisle.induct2
) ? S0 T; E! X5 w3 k" O8 m1 y while A_i<=30 do begin; o* T) X+ \" o/ g
travel to pickaisle.con(A_i)
) }: y- W& Z$ P- P. t1 x# I6 V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 M% ^( d8 `, U" ^; A( ` else wait for 10 sec
6 [+ |0 A* _$ q! ~; o' y5 o if A_i=A_leave then send to die
7 e1 e) R# R: j& }- d& ?! W0 s else inc A_i by 1
{5 X( k2 x7 s; J: } end4 ?0 b, u# b: ^% x
end3 ?- V5 ?8 d0 s' L B, d/ C
; O* v0 b# y% g4 ^- Y% A
begin P_pick3 arriving
: R5 F" @ c4 o7 Z- {" q1 O: a, b. q set A_i to 21
- l# r( B7 L9 ~* Q9 x% t7 D move into Q_induct3* R1 X% [3 ^ z" H6 Q7 T, E! t" s
move into pickaisle.induct3
8 C6 [; I6 d" ~+ a0 l) \$ J while A_i<=30 do begin, U' S2 A" ^# u, B/ D6 T; c
travel to pickaisle.con(A_i)
$ ]/ }# h) Z% ?- I) Z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# Y0 b8 Z* p$ |) n
else wait for 10 sec' G d+ V4 _2 p6 Z% S3 ?& T+ V
if A_i=A_leave then send to die
: d' W# P2 x: K6 u else inc A_i by 1
+ G# t) ]4 t4 e4 k. N" y+ s end1 |4 f8 _( ~# R
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,其它按你的 ...
|