|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ C# W; [9 b5 r0 S
: ~& ~1 G9 }2 u1 A6 P) w$ D' R我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& @; Z3 K. E. @& h5 U* n
! O8 i' \; @! obegin P_read arriving
1 u. x. m7 V5 E; d# P! j' j while 1=1 do begin
+ Q, t: n3 F5 n; m1 t& w: d' Z read A_tote from "data.txt" with delimiter "\n"$ y# C" {# G4 K1 f+ x* C- U& L
read A_time from "data.txt" with delimiter "\n"
; @, @9 ? ]+ \" I g read A_leave from "data.txt" with delimiter "\n"
: o' Q+ N6 p1 U* Y; n$ `* s read A_picks from "data.txt" with delimiter "\n"7 a: A/ V& X3 g. ~* _+ q
set load type to A_tote
1 y' h3 g) U" k" a if A_tote="tote 1" then set A_induct to 1
+ W: V, k6 L" B3 z else if A_tote="tote 2" then set A_induct to 2
+ H% Z+ f2 f8 U. O: T else set A_induct to 3 + m* u% e" A `# G9 O# k
set A_i to 0
! }/ t/ m' C& P0 S7 }8 f" ]1 B0 e clone 1 load to P_induction- p% o/ `" ] y& v; `
wait for A_time sec. T! N) b4 o8 Q. G
end
' v5 d8 Z# k+ [1 u% Dend
/ U( S" u* o7 Q1 T4 l2 I2 w$ m$ b' f* g" @! w) ^( }
begin P_induction arriving( f- }# `/ H8 [* h- l4 @0 O
if A_induct=1 then clone 1 load to P_pick1
9 w0 S. ^& ^8 u$ K else if A_induct=2 then clone 1 load to P_pick2
& k: L- {1 @& }0 \* ~ else clone 1 load to P_pick3$ C; D' y0 P6 n! E3 M2 W
end1 e5 K/ u# d" y0 X: C5 s
; J3 K' J' P# y6 q0 E8 g, {! q
begin P_pick1 arriving+ Y" o$ T" i, c& c6 H/ j
set A_i to 1- v m- K8 B, z- ^
move into Q_induct1; R. R g C) V% ^ {
move into pickaisle.induct1
: w8 \5 i* I* n* P! L) p. y while A_i<=30 do begin
# C5 \+ d2 u6 M( T% q: m( X' A travel to pickaisle.con(A_i)
1 B4 X( Y4 s7 q+ P6 A& }" E if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; E0 _1 K: R7 D& m- Q6 _ else wait for 10 sec; k& w! T$ N$ u7 m
if A_i=A_leave then send to die Y( C+ {, J: V, I
else inc A_i by 1
& j2 G/ `+ ]1 n0 k# I. s+ S; C end [* d% O, \- O0 u. z/ D
end
/ V* {: C8 U& @6 M
0 u7 e$ p. p! }' P1 y- ubegin P_pick2 arriving* h& }% a1 I$ n+ W6 Y
set A_i to 11* d+ A" r" F& O0 t
move into Q_induct2$ k) l) v. L7 r
move into pickaisle.induct2
' P( |. @8 i4 \0 N* o while A_i<=30 do begin
4 D5 q2 D0 w3 C travel to pickaisle.con(A_i): M2 L, a4 c4 |! C( z$ Z F- C7 U
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 r! @' ]9 w n J* Z7 T) O
else wait for 10 sec
1 N+ p# s$ q7 x# d2 d- y if A_i=A_leave then send to die- {' Z u6 }, ]6 v* v+ A, T. g, W
else inc A_i by 1
# b* Y3 ?- g5 s/ X& z end/ G7 |0 B0 j" `$ e. [
end( H. W' c' p/ y" L1 V
- ^0 w6 g2 F; Y' [: G4 wbegin P_pick3 arriving
- S/ O5 t! d+ a9 \ set A_i to 21
- {& B2 h$ _! h$ n move into Q_induct3
r8 ]: l5 S( P/ \; g move into pickaisle.induct3# M2 `, D: E% g1 }/ q3 L/ k
while A_i<=30 do begin
* n& ^; d! k5 y' E5 K1 o travel to pickaisle.con(A_i)
2 T( I5 s g2 l+ H( v4 ^; ^ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ X; F3 o; p0 N else wait for 10 sec
& c4 M7 { B/ U8 c% L if A_i=A_leave then send to die
3 j) m" Y% Y- b3 @ else inc A_i by 1
9 [! P1 P* D! ?% Q4 t end9 L+ a" u! N2 t; V& r7 |
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,其它按你的 ...
|