|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: P7 y4 n- f) T, {9 x% c5 i0 }+ J& T1 n" e
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ I" r7 I, F0 q2 I& o% ^6 D4 G* q, n' l c) \7 ^
begin P_read arriving8 e, _8 W+ B7 z+ E9 l- B
while 1=1 do begin
- J* l! e, u2 y* N: N# W: e read A_tote from "data.txt" with delimiter "\n"
% W6 i; p) I+ H& |/ D5 t$ o3 b+ S read A_time from "data.txt" with delimiter "\n"
0 z4 _. c, z, ?# H" h read A_leave from "data.txt" with delimiter "\n"
2 A- |0 M# m7 z$ L read A_picks from "data.txt" with delimiter "\n"
: x5 l' @$ W- p* t' u0 h: X J set load type to A_tote/ U) ^) H+ l; o: K- _! j2 S- d
if A_tote="tote 1" then set A_induct to 10 \, D8 `6 d. V9 C q, H( Q
else if A_tote="tote 2" then set A_induct to 27 E! N) [: v$ O, E
else set A_induct to 3
5 C8 o0 \7 L: ]: d. v5 w6 t; W: ]9 E set A_i to 0* I; P) B' r5 j/ h
clone 1 load to P_induction
1 z- u7 a# x" @, |+ W! \0 X" y8 h, [ wait for A_time sec
3 w2 W% X( ] L; _" N+ ]& @: e end
E: k: t( G) fend
N' x$ o: l+ ]( U
) ?) I+ |) o. H) w9 `8 }begin P_induction arriving: C# C+ i/ b6 L" A/ ^+ f
if A_induct=1 then clone 1 load to P_pick1" }- F; Q1 f1 h- R" i! z
else if A_induct=2 then clone 1 load to P_pick28 _& D& \ ~, H
else clone 1 load to P_pick34 I5 A7 Q3 @- y6 P" R$ f; A3 A
end
& h7 b7 B* L* {7 q" {3 o3 f7 b3 h2 |4 O
begin P_pick1 arriving
! M. A) Q9 y, n2 g7 y set A_i to 11 u; y3 L/ ~3 o2 D+ \
move into Q_induct1
0 T9 W$ z% }! X f( ?% o2 z# d move into pickaisle.induct1
9 P0 ~. `6 ^% L5 k while A_i<=30 do begin
7 i$ t5 V3 f4 |+ D, S1 G. Q( @ t travel to pickaisle.con(A_i)
% X: N3 E3 y' _5 d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' \ K. _# d" v6 A! N2 a' a
else wait for 10 sec
. y. [3 \1 F# G if A_i=A_leave then send to die0 Z3 J0 \5 o+ }. [2 J& L. s4 p
else inc A_i by 18 b+ \% J4 N. q& F# r3 e% V/ D3 \
end
U+ t, U6 s) ^. Eend
9 S) |# h* K3 z! T, A* v7 v
) i. @0 K6 N' W& ~begin P_pick2 arriving: R% B A! ?) `
set A_i to 11
" f6 B% j) ^$ G+ D7 A! a move into Q_induct2" h4 r; i9 r0 s4 g
move into pickaisle.induct2
0 P5 R( z3 k( n( S: R7 k/ t G2 N while A_i<=30 do begin0 M( I& {0 p' H/ y# B
travel to pickaisle.con(A_i)# T# Z* V9 j; y, Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- [! O' d1 }+ J& k- V else wait for 10 sec
9 L% o6 @. [7 f" m$ I if A_i=A_leave then send to die/ u* [% f3 c9 j! X
else inc A_i by 1/ R1 ~" m8 x% z. ?4 \
end* c. l" K3 M0 C$ [& X" W
end- m& E+ g) l* Z' F; D" V5 n( x
$ W; n; Q' \1 a% P' x$ z: hbegin P_pick3 arriving B0 {$ `& x' U( Q
set A_i to 21
2 x# H2 E( x$ l- c8 p1 M move into Q_induct3, l2 W5 \/ j% s( U- j! o
move into pickaisle.induct3- H, }+ F1 p/ a+ f y+ C9 n
while A_i<=30 do begin
( S+ K7 V7 W/ a6 O+ \5 U+ k7 V travel to pickaisle.con(A_i)
6 a% t, V6 d* Z0 Y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 W: u! I, ^- Y8 v+ \ J else wait for 10 sec7 I# E# V$ d' P, z( S4 U7 b# d
if A_i=A_leave then send to die/ ^7 E3 `2 z9 [/ C# n( d
else inc A_i by 1
s8 |1 i3 \' F! X end
! a3 l$ A2 s; j* D x3 t! `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,其它按你的 ...
|