|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢 l3 D0 Z* M1 U/ `4 A
G% g/ D! \) h/ O; l
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ g1 F/ ^4 |4 f! \4 ^# ?; a
" S. g+ Z, A) h' N s+ I" X) v1 Kbegin P_read arriving$ T5 }4 r3 V, ^4 S: N3 O
while 1=1 do begin$ ^! E* x* h W; Z
read A_tote from "data.txt" with delimiter "\n"
; P& X, P* G# t# b+ e2 A$ f read A_time from "data.txt" with delimiter "\n"
% l$ P) B0 Z3 b$ t read A_leave from "data.txt" with delimiter "\n"0 c) ]& h" _1 o9 O: j
read A_picks from "data.txt" with delimiter "\n"+ Y9 M2 Y, T$ Q+ A; a/ j e/ f
set load type to A_tote
1 Q) @9 l6 A$ T; A% W9 U4 Y' G if A_tote="tote 1" then set A_induct to 1
8 s. W* R* X; }' _/ e else if A_tote="tote 2" then set A_induct to 2
# `( B0 p) W* x1 r# V" \& @: S else set A_induct to 3
, @/ a$ L& `- ~' Q: \9 | set A_i to 0; t) G3 l) N) f- a
clone 1 load to P_induction
0 g! {1 e- `7 J4 k' ?- I( v wait for A_time sec9 j0 v: z7 Y* R4 L
end' j" c7 ?) v8 t$ n' l- k4 Q$ D
end: [ ^* y& z, q' {+ s' f0 }( s
# ~6 r" Y9 b$ X0 ]( X. u5 Z% v2 `
begin P_induction arriving) j: i& k v: \' A
if A_induct=1 then clone 1 load to P_pick1
$ f) R- `" M3 d' r else if A_induct=2 then clone 1 load to P_pick2
8 N2 w! B4 f3 ]7 W7 Z3 F else clone 1 load to P_pick3% M1 c ^7 n0 ]
end
6 K4 n2 z) s0 b; |, g9 {* z& i& t' B6 @! j5 J! E
begin P_pick1 arriving
c. x$ z8 g9 y6 Z. y' [ set A_i to 1/ u1 m/ @, r$ M( v
move into Q_induct1
8 h2 {# {9 Y' i# y6 |5 U move into pickaisle.induct12 K5 S5 a+ g% c% y6 e
while A_i<=30 do begin
$ B/ e7 m; T }6 T travel to pickaisle.con(A_i)
6 S" a" e; i; I$ z" { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ N, s; ~$ V( Q$ V* O' {
else wait for 10 sec
- A% l! i: b8 R& F; |) V if A_i=A_leave then send to die& l# Z9 M) t0 k( {' y0 O: Z( e
else inc A_i by 1' n+ i' Y; x: [. s" k) [+ G
end
, l0 J6 H ?0 i: g f; d3 jend: a' t& o: j( S; a
8 X' M8 A5 n* C O
begin P_pick2 arriving
' _2 C; @4 e, U* ] set A_i to 116 r5 ^2 X' M, B* [9 H4 E) u) |
move into Q_induct2
5 _! \; o7 l' {/ y) Y: A$ Y move into pickaisle.induct2
) `( I" [' n" I, I6 g2 k- X* Y while A_i<=30 do begin& e5 |3 I7 t8 \* ?) ^; j
travel to pickaisle.con(A_i)
8 ?1 o4 U- w0 |" w( y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' ?2 s# A( g# D( g6 z; \
else wait for 10 sec
, e7 K8 r1 j# ^0 H# q! [5 j if A_i=A_leave then send to die
( T5 i$ @. g# \4 B- } else inc A_i by 1: [8 @9 k9 _+ O4 X! h
end+ u6 `9 q/ B+ a3 y
end2 E, S. B5 H- q: J$ a0 D4 |. z
z: o2 P' a+ F! [: ]begin P_pick3 arriving
7 T6 f! _4 A7 u* K set A_i to 219 P+ l4 O7 \, k
move into Q_induct3
( w- I E( `) \, c2 {3 n move into pickaisle.induct3. P/ {& M. Y+ X+ G% i
while A_i<=30 do begin
* z6 _' l3 j7 @+ h3 r: {. Y travel to pickaisle.con(A_i)
2 ?# N3 M& Q3 ~+ O. {+ C3 `! N" D$ I9 d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( E8 ^7 H$ a t. x2 Y9 _ else wait for 10 sec, ~: y1 N! y( q" q" r' N2 b
if A_i=A_leave then send to die m2 q" X9 I, b! R4 L
else inc A_i by 1
, O* A: B# S' ?2 b' ?- A# L end
$ r+ m1 Y' H) P6 _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,其它按你的 ...
|