|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* s9 A7 C& ]! u) A+ ]( N2 R
: N% C! a; Z0 ~5 a+ C
我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 U) F8 \# j3 j, q' g# c, k0 m
" X4 N% t; ^! ~" z( ^3 y* hbegin P_read arriving7 h* P# P1 @9 b) ^" h- Y% P
while 1=1 do begin
7 U v- V( ~5 T read A_tote from "data.txt" with delimiter "\n"" m4 k' k) r% w8 U) f9 _
read A_time from "data.txt" with delimiter "\n"7 m. l7 C9 n" U0 K* R3 x$ ?! h3 T
read A_leave from "data.txt" with delimiter "\n"
% ]8 S( X, J& } read A_picks from "data.txt" with delimiter "\n"3 R% J, d7 v% R0 d, C! `; L
set load type to A_tote* |) A$ h8 g. y2 |/ X
if A_tote="tote 1" then set A_induct to 1
3 N2 e$ G ~& N% U% \# m$ V else if A_tote="tote 2" then set A_induct to 22 }7 g% y; y5 a! m# K
else set A_induct to 3
3 X% J6 a+ Y3 S7 @: U% |$ T2 j# _ set A_i to 0
0 S0 l; Y6 H3 O! `8 l clone 1 load to P_induction
, c, V8 X7 |& @4 Z2 }, {5 e wait for A_time sec
4 e; K$ M7 N* ] k end d: [! Z) V$ t: {
end& D' v! X- ? Z' C c
8 n# s4 ?, J f: R1 j3 _( wbegin P_induction arriving, O) s& m7 G; S9 S
if A_induct=1 then clone 1 load to P_pick1
" \( n8 I0 }* N+ p# U, E5 G else if A_induct=2 then clone 1 load to P_pick26 m5 S ]/ E) M& o0 b
else clone 1 load to P_pick38 }4 o" C1 B2 o* H) a
end+ F6 D4 e( |: [& ~, ?! Y
7 d0 J+ Y" `6 x) j3 G6 F6 Lbegin P_pick1 arriving/ V7 T4 L/ m2 A' }- |
set A_i to 1
9 ?) g. D+ U, X0 @ move into Q_induct1
2 W3 z7 g# E, S7 ` move into pickaisle.induct1$ E# u, s. o6 h9 q* K, @8 N
while A_i<=30 do begin
, C' P3 x; o/ ^% }! _. P travel to pickaisle.con(A_i)6 u4 `# [0 g, b B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) H) ~; u& p# z4 k N; d else wait for 10 sec! ^+ g, d9 l3 ?) W2 O: x6 z
if A_i=A_leave then send to die
% ]' d* Q% t0 Q! N' V else inc A_i by 1! p6 {" `# ? t* Z( A/ W
end
, } d# d6 v6 m' F7 cend' Z) _: n# J* ]
6 `% x/ O4 q" H* v [: c5 r
begin P_pick2 arriving" Q3 e7 d, n H: W9 H" m
set A_i to 11
: x7 N6 @8 U9 \ move into Q_induct2/ i f7 o3 R/ _. d
move into pickaisle.induct2# {0 f2 g5 o3 Q' q1 J2 G9 ~
while A_i<=30 do begin
8 T7 Y7 U" Z, u3 A7 L: _, F travel to pickaisle.con(A_i)# e7 P- z) K- I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 x$ l, D+ }9 M else wait for 10 sec9 U7 w7 e P% F% O
if A_i=A_leave then send to die
8 W0 ~; D: m) X else inc A_i by 1
4 i+ V* M" \, Q. c. p end* c/ L! O1 z& w9 @" Y" x
end
' ]0 o8 c% C1 @2 S5 Y# C7 |
3 ~0 ^% H8 u% g! C& L# Ubegin P_pick3 arriving
- Y$ H0 E2 z5 M8 ~ set A_i to 21
( H7 ?( S8 t0 ~! t* K move into Q_induct3, A$ Q- i7 r) o% W9 o
move into pickaisle.induct3
' P* O! y* N; {" M5 H while A_i<=30 do begin
/ N a. V) b# s! q travel to pickaisle.con(A_i)9 u. A3 [9 B+ f: r7 q* j4 ~! y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: n4 J8 w% Y! W, n2 i& ], g# H+ \
else wait for 10 sec, l) L0 u& E4 U$ q4 R2 D# u
if A_i=A_leave then send to die
4 A! b! d0 S& }% N) _/ y else inc A_i by 1
. o9 f0 _( g( C' M5 { ]* G end
7 |- Y5 D" G4 `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,其它按你的 ...
|