|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! g& ]& W/ k$ L$ p; S" W0 L- Z" R% W0 [' Q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( H2 c5 J+ v+ ?) p; D; H7 z+ f/ j
7 M) o- R8 }7 J2 }5 A. d1 O4 h" Bbegin P_read arriving6 ^) k0 ^ [4 S. S; }. e9 K
while 1=1 do begin
4 y- E+ H: c# `. f% O% t read A_tote from "data.txt" with delimiter "\n"
! l9 T N. N8 b- N read A_time from "data.txt" with delimiter "\n"
+ E! _: b( g5 a- Y" |+ l read A_leave from "data.txt" with delimiter "\n"
4 v& K! j/ _1 h9 P% O+ U2 G+ ~ read A_picks from "data.txt" with delimiter "\n"% z5 S5 a. o. [$ D3 Y- s
set load type to A_tote
/ R4 D7 S& _6 i* i8 x if A_tote="tote 1" then set A_induct to 1$ }( ^ S9 E2 S3 C4 N7 H$ B4 N
else if A_tote="tote 2" then set A_induct to 2
- J8 r. Y6 k. W! L% Z X& g else set A_induct to 3 ! X8 |0 a- _$ T' m
set A_i to 0: r; p, r+ d3 h3 \6 A4 M/ e
clone 1 load to P_induction
+ R$ e: l: s8 z/ n `9 Y wait for A_time sec
D! S& g" g/ V) n end
) I( l$ ?, I; w ^end. A7 }8 p$ y* l" {5 k9 y3 e3 d
% Q$ m( _& t: T: y+ \! dbegin P_induction arriving
$ L) R6 d6 }, J" j if A_induct=1 then clone 1 load to P_pick1& _0 x, K7 `, \7 C3 o m, X
else if A_induct=2 then clone 1 load to P_pick2
; [" J& l7 D& w G2 ?. N& E! X$ T6 u else clone 1 load to P_pick3 Z4 q, K* A: Q1 @7 O1 X" E+ B& _
end8 f9 M, |! b6 ~9 P' C
( p0 d% L( J: R1 `' Rbegin P_pick1 arriving5 n k' p: S. C( i! K7 O
set A_i to 1& F) ^; p3 a1 t- c- z
move into Q_induct1
! \6 n( V9 M5 E0 Z8 c7 u move into pickaisle.induct1 }* U3 X; u I( i$ x3 s" r/ g1 K
while A_i<=30 do begin
1 I, X+ c" @3 K. h- A; X, B travel to pickaisle.con(A_i)7 s" F/ h( P# F6 Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 e0 d$ z" F4 I/ y2 q# r1 x else wait for 10 sec; i; z" | M" U* @! s
if A_i=A_leave then send to die4 F4 m- S$ Q1 _+ X0 p8 c
else inc A_i by 1+ T; h9 X0 O+ R. u
end/ h8 z" H- {' ?+ n" \ L( V& b+ |
end
# z1 }. u$ ^4 T) e7 f& a& q0 Z# s( C! \. R# M9 |5 c& {# e
begin P_pick2 arriving# U+ r; q/ B0 A% I$ t% r& t
set A_i to 119 f. t, P( Q3 @0 I2 p1 h- ^# v! Y& b
move into Q_induct2
( H* p# [; i7 \- a, k move into pickaisle.induct25 X0 f/ ]; }+ f. `
while A_i<=30 do begin9 v9 r0 s$ A3 F/ S; H3 L
travel to pickaisle.con(A_i)
% d; j5 D" k6 b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 R0 B" v' N* `# y+ A else wait for 10 sec
; \6 K6 v# R" O9 q8 B1 I; W if A_i=A_leave then send to die
5 Y- O$ f N& R2 u9 a" Y else inc A_i by 1- Q" q- q9 S. x" ?7 |
end4 ]8 f, g* e* i( _: `8 W g
end
- W4 t$ U3 V+ q3 M3 A. }, Y0 j# Z, \- }- l
begin P_pick3 arriving
. p/ @) t4 w" n9 }) P4 z set A_i to 21
& d. G0 `# z2 a' R; j T: s4 h3 Q2 N; u move into Q_induct3: D5 D5 e: z6 x7 j6 a! L4 i
move into pickaisle.induct31 `1 J/ m, n! e' _& N. v9 c
while A_i<=30 do begin
' V/ y- ~! P2 X! ^9 a. v travel to pickaisle.con(A_i)
0 n6 V$ b0 b7 Z# y6 ]: w9 p ~4 n* i if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 }& C5 C3 b! W0 X; q
else wait for 10 sec2 b! ?. E5 `; ?6 [/ k
if A_i=A_leave then send to die
o [4 I6 |& ~ else inc A_i by 12 t3 \8 W" g/ {$ }, X
end
0 G" D9 |: G. g- R |+ ?( fend |
最佳答案
查看完整内容
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,其它按你的 ...
|