|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 w6 R2 @0 s/ j+ f- U; Y9 A
: z: v0 s1 l$ {6 s' R- p$ u我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# ?/ Q4 J% g% k) P
! ^# |4 r$ ^/ Y f- wbegin P_read arriving2 b& {" u! T$ Q, ~
while 1=1 do begin
- i+ ` ~( ^6 K& I4 M) w( E7 [ read A_tote from "data.txt" with delimiter "\n"+ m# z k/ w: q0 d& T
read A_time from "data.txt" with delimiter "\n"1 m( c& v) o. N1 n( h
read A_leave from "data.txt" with delimiter "\n"
# X# y- L/ E0 }( A+ ~( z& | read A_picks from "data.txt" with delimiter "\n" a3 Z4 t+ m g0 k8 [
set load type to A_tote6 i/ i* _0 n# u1 O
if A_tote="tote 1" then set A_induct to 1
: [/ Y& |+ _( W! u$ J; }$ c else if A_tote="tote 2" then set A_induct to 27 F0 q i0 Q5 s
else set A_induct to 3 + V0 h9 W. D( m+ g5 a) m
set A_i to 0
0 c6 c! v0 \& W, @; } clone 1 load to P_induction
# C% r* u3 F# u) | wait for A_time sec& o& e8 ]* i# z' y- m! w
end) L: K& n p! n; L( S$ m4 g
end' U: G- L3 ]+ }' g
! i0 W& e) z7 |# gbegin P_induction arriving
! O* G4 y5 J* m; s+ l if A_induct=1 then clone 1 load to P_pick1: i# I C) {. K
else if A_induct=2 then clone 1 load to P_pick2' A/ S2 r4 S" B4 t1 U
else clone 1 load to P_pick3 ]- ~: R" W7 m+ l6 T
end2 ?$ M- s& k o0 Q- H& }3 ^* w
4 t* O6 ~) ] y' K
begin P_pick1 arriving
+ L5 T# }8 y! B+ A2 h/ \ set A_i to 17 J! y0 f& {$ z- }# Q8 Q
move into Q_induct1
. m z* Z$ q- \ move into pickaisle.induct1
9 {5 I0 a1 z8 ^1 [: ^! p. A. l while A_i<=30 do begin
' D1 v) |$ F( s% b5 f travel to pickaisle.con(A_i)
& ? W% y: g( A0 u. k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* i& l+ m7 w' K' b" m# ~
else wait for 10 sec0 A& _: u. h1 l; U9 G
if A_i=A_leave then send to die
1 |3 ] g. P8 o( F% W! ~/ `1 W8 f else inc A_i by 11 N' d5 u) s' ?4 k! Z1 H9 m
end
3 T9 l% F! V/ b$ ] n% B3 y; Mend/ K. X" v! _" h+ U* G6 t
! D W4 U. ~) o3 r- g$ V8 g- Tbegin P_pick2 arriving) k1 N: b0 O7 |4 u7 S2 G
set A_i to 11
' H8 g; c4 }; ?$ I% A move into Q_induct2
_* [7 j4 G8 A# n( X move into pickaisle.induct2
2 m/ X: h8 k% P7 k7 V+ m while A_i<=30 do begin) }# `0 i/ j7 o" e5 h5 Y1 r
travel to pickaisle.con(A_i)
& ?' D; W( o6 F6 F1 y' }9 L2 F' g; S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ e3 V) j; U( B7 f( X7 r else wait for 10 sec
% m2 |7 Y2 F# D+ e, w3 Y, } if A_i=A_leave then send to die0 o4 w+ \* S9 Q, q
else inc A_i by 10 d5 V6 _8 b# @& P9 _# @
end/ [ K' C2 b, t! w2 y9 |, x
end
* R7 ?) W; W* M) U' R) l! T! q: [1 Z3 V" P- h- w
begin P_pick3 arriving4 D5 }/ W2 t$ ]2 o) A) O* U6 }* M
set A_i to 21
& ?4 E! o8 C# e move into Q_induct3* ]- h; x8 o" w8 g7 S9 n
move into pickaisle.induct3
2 A: {2 H. S# Z# \' v1 ?8 P2 { while A_i<=30 do begin
0 x$ N/ f' C& d1 S9 S' q travel to pickaisle.con(A_i): }- `6 g5 y$ u& f% |0 ?+ N2 I$ `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ M2 b0 r3 _' T) y1 l
else wait for 10 sec$ e) s% n+ m5 E9 Y( a6 _
if A_i=A_leave then send to die
4 i1 d" O. X% ^0 D else inc A_i by 1
: Y4 H1 N; P/ a# j6 I' p1 s end( b% p& P0 [7 P0 r' b/ j
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,其它按你的 ...
|