|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! p+ |' W' D3 }
% x. I* e3 m+ g5 |4 Y! r2 Y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 Y/ ~! O! B# Q, G4 A& z1 R, n: i: E" W6 x7 _
begin P_read arriving
8 N- P4 Y$ o# i: r( w5 q while 1=1 do begin5 u; E8 S# s! L; ^
read A_tote from "data.txt" with delimiter "\n"
^+ x6 @9 O# @ read A_time from "data.txt" with delimiter "\n"9 `0 x4 `: C5 n9 `# C1 E7 W$ r
read A_leave from "data.txt" with delimiter "\n") g" F; Q5 u% O2 @2 ^
read A_picks from "data.txt" with delimiter "\n"% W, m' y2 J+ O9 t
set load type to A_tote; A0 l- W) Y% L$ X5 n$ z8 D; N
if A_tote="tote 1" then set A_induct to 1% y. N1 q4 B" Z9 z9 O/ Q
else if A_tote="tote 2" then set A_induct to 2; C d: @0 |' z/ u
else set A_induct to 3 " f( r# {0 {" I9 v. m
set A_i to 0* a- }6 j* y* w6 Z4 B3 r
clone 1 load to P_induction. ^5 o# z) R. U* Y# ]" D
wait for A_time sec
9 \" {) b: v! x, J0 g end7 Z! g: ~ \$ R. z! u
end
' u* t( G2 U6 U; Q6 J
( B; C% n8 P1 X6 d6 R8 ybegin P_induction arriving! y2 y9 w! G- a0 a t8 h/ @& |. I
if A_induct=1 then clone 1 load to P_pick1
+ x8 ~) y/ g# k; X/ E' C: D( b) i else if A_induct=2 then clone 1 load to P_pick2% J& F9 M& O4 z! ]! x7 W- T# K- ^
else clone 1 load to P_pick3 V& Q) Q G) f
end
( Q0 ], B* p, Y) d9 S' o j2 Z% p6 J; c3 r# \4 J
begin P_pick1 arriving
9 r% U4 V& u, l% z) p set A_i to 1. A8 C2 H: C2 `- k: H. Y8 w
move into Q_induct1
8 N+ o8 z& k6 D7 P, m move into pickaisle.induct1
, q. t* @! [3 l' l- N while A_i<=30 do begin
/ d: s5 ?( _2 u$ s9 f, y travel to pickaisle.con(A_i)
' w# [9 n v1 P* W# u if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) g R* N4 n* E' K
else wait for 10 sec
2 [/ U" j" |( x1 V if A_i=A_leave then send to die: c ^% S4 Q# r9 ~6 j
else inc A_i by 1' e0 I8 Y* y, ]9 Q+ X0 o, ]" W0 T
end
. Y$ A7 x. H3 e4 g; Kend+ N& ]8 F0 _- n i; B
# k: A( b5 q m* V% g# v+ f4 S/ G
begin P_pick2 arriving
! M1 P0 @# p( Y% Y( W) U8 @9 p set A_i to 11
8 [- Z- }: M8 P- K1 i move into Q_induct22 F; ?7 {. h# b+ O+ o$ `$ h
move into pickaisle.induct2
2 G' w g4 E# L# M3 s; t1 X while A_i<=30 do begin
: x/ L1 q& ~0 Y8 X- l4 G' q/ Q# S3 w travel to pickaisle.con(A_i)' n0 K/ y1 N2 t1 ?! X. h* e7 |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 X) g, [; ~) P i6 H
else wait for 10 sec2 D2 f5 {9 Q1 V; C$ G8 m0 y
if A_i=A_leave then send to die
+ t! t7 v: M. V/ N1 x7 E else inc A_i by 1$ Z( C( [0 V$ \
end8 T+ _6 N. y4 `- w6 L
end6 G% H! k0 h+ V/ ^6 \! d5 b+ k0 H
, F' X1 T* I. R9 p z& g* Zbegin P_pick3 arriving# W% M6 Y2 e0 @( T/ R5 ?
set A_i to 21
8 k* q, ?; v4 @9 y! B( M move into Q_induct3. }; U# x6 i$ p9 a2 ?+ x6 H% X
move into pickaisle.induct3
) f5 v6 Y3 `; d- @0 V8 c1 M# B% g while A_i<=30 do begin" {1 L- n/ k( |1 o2 N- x3 S
travel to pickaisle.con(A_i)
. |( M8 L9 S% [5 ^6 |; q1 O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ ^# x' e8 ?; e- e
else wait for 10 sec
; S4 g2 w2 Q0 |. J( r. g+ a if A_i=A_leave then send to die
- H: \- c6 O0 [7 \8 a& n. b else inc A_i by 1
& _$ A$ z, l- l5 K1 X- } end; d- [) H G: s
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,其它按你的 ...
|