|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ h% U# H) u$ C
1 s% b7 X: Y+ w% [; D, 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中的数值,不知道会不会有什么不妥。* \. M- N- S5 k( q; B) c H: \! T
& H3 N, s3 `$ G0 M8 Q5 b
begin P_read arriving+ \+ r8 M1 ]2 R N1 ~
while 1=1 do begin
" @) N' e# v" t1 i o' C read A_tote from "data.txt" with delimiter "\n"* d1 Y, j. Y4 ?9 }4 V& w) n
read A_time from "data.txt" with delimiter "\n"4 r% x% q% N% \6 j/ d1 U# s
read A_leave from "data.txt" with delimiter "\n"" d5 l2 y8 m9 U9 F* u- y; X
read A_picks from "data.txt" with delimiter "\n"
7 k* K% \# R8 N set load type to A_tote
2 b0 _- Q1 w9 a. y5 K) o' Z if A_tote="tote 1" then set A_induct to 1" l" s8 u( j4 v6 ~1 S
else if A_tote="tote 2" then set A_induct to 2
! O5 Q% r. |& l/ ]: ~9 h4 H- H else set A_induct to 3
. {8 T6 G8 e- g set A_i to 02 }; m8 z5 w/ s- k9 J
clone 1 load to P_induction& A5 c( D1 `5 u; ~ c( W: G2 [! q
wait for A_time sec5 w% L5 l% { Q w5 q- d
end/ ^! W4 [ R1 }& p/ ~
end
7 _1 B3 s3 G* |
3 `9 b! @- ~6 B8 P5 r$ Abegin P_induction arriving& a2 \& k( u8 a3 e
if A_induct=1 then clone 1 load to P_pick10 |" g+ }- F9 S! \1 S% k
else if A_induct=2 then clone 1 load to P_pick2
; a1 S$ j) b! y0 [ else clone 1 load to P_pick3- S$ S$ H8 i3 K1 U! c1 V& W
end& a8 t; q5 h3 d- y' y
+ j3 |+ }6 Z! c: f8 Pbegin P_pick1 arriving
b, |: J6 o. b set A_i to 1
; n* G4 s1 `- j' z move into Q_induct1
1 X/ g2 d/ k/ `, @6 W) H2 a move into pickaisle.induct1& d8 M h, L2 A/ q
while A_i<=30 do begin4 z* o/ d' D4 m
travel to pickaisle.con(A_i)
W6 p2 {3 d# E$ ] P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, S" Z% N% b0 A1 R8 v r1 Z
else wait for 10 sec
{; S0 Y! e2 R# ~. R3 ^& C if A_i=A_leave then send to die9 H' X9 Y0 e2 \7 T
else inc A_i by 17 Q9 R% _2 }. d
end: [. R6 r/ V( z- m) E. h3 f
end
7 p- q# V! Q. [% R
0 e7 k. p3 `) Cbegin P_pick2 arriving' m5 C. V6 Y9 l/ W' Y5 e
set A_i to 11
, C; ^# i+ f. u move into Q_induct2
$ b+ i4 l( D3 [7 m" h move into pickaisle.induct2
0 D' T% r# N4 C+ r: w while A_i<=30 do begin5 H& E! V5 d) T& ?# ~! K
travel to pickaisle.con(A_i); b4 v2 F' T' C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- a& ~$ x7 N5 y+ d+ I else wait for 10 sec5 A" q, c& U' |, K" A' K2 ?
if A_i=A_leave then send to die5 L- d+ u0 p" b" U9 K& O) C
else inc A_i by 15 `$ R' L) |. ~# d4 x: U2 ]
end
2 g8 V c) q% O) M" ^$ aend5 s& B4 l. ~% E1 V
3 E) W. q! C/ U6 i+ J2 R- @& y; _; q0 k- Z
begin P_pick3 arriving2 ` S9 y; |) A7 h
set A_i to 21
. n1 I9 i( U! ]. r9 T @ move into Q_induct35 B& b! X6 F1 H3 t
move into pickaisle.induct34 M) N5 s! A! J* Z, M8 ?4 A
while A_i<=30 do begin' v" X p! L8 ]( r
travel to pickaisle.con(A_i)& r$ Z( @& P6 _, {: d" ?) B3 p
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- |7 n% s2 ]2 t' ]: {
else wait for 10 sec
3 _! v Q0 G0 W3 t9 X. \ if A_i=A_leave then send to die
: l4 y8 N3 P- ^6 O else inc A_i by 1) l0 l" T& s8 l2 {* j
end0 }$ [9 y X; _6 ^5 L, C& y
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,其它按你的 ...
|