|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 _. x1 f% n) F8 K! x) i
% C/ U' H$ X+ s' I7 q, m5 ]我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ d, J( c5 i* f* P/ \$ b* v, V3 ]1 _0 L) C0 p% i) \) D
begin P_read arriving E. ?, b" v8 q) D! S" w
while 1=1 do begin
h5 C# z( X; ^( i; {$ l0 c read A_tote from "data.txt" with delimiter "\n"9 h; P; [) ^6 x! i+ q9 Z
read A_time from "data.txt" with delimiter "\n". F( A# V2 j7 w) C1 V: H ?
read A_leave from "data.txt" with delimiter "\n"
4 w d# [- t, A& J* D8 L read A_picks from "data.txt" with delimiter "\n"
7 B" J" H( f/ H# O set load type to A_tote! v# R7 Z$ _# d. @. x
if A_tote="tote 1" then set A_induct to 1 D* n. a' N9 U
else if A_tote="tote 2" then set A_induct to 2% P/ O: z% L+ L
else set A_induct to 3 v& B+ E3 r. _* Y' f* M
set A_i to 0
; N4 m7 `0 w$ k/ q) l' p) L clone 1 load to P_induction% X% {$ K$ b- n1 h8 u6 y
wait for A_time sec5 E1 |+ g! z; B" J- j1 u
end
+ x5 ]1 |4 E* y5 r2 B9 oend
$ K/ ^8 V' q9 w0 a- R1 q; @
- j* c1 `+ H$ F" p: k b0 ybegin P_induction arriving0 J% B' g; F6 A
if A_induct=1 then clone 1 load to P_pick1
; F' N+ m6 A( e% ~3 \ else if A_induct=2 then clone 1 load to P_pick2, W5 P5 K8 F/ e* s! B( P
else clone 1 load to P_pick3
9 X1 W- q3 W4 Z9 ~# m/ bend
# W) i+ ^& M4 f# N4 e ~" E. y* X* F3 ?
begin P_pick1 arriving
$ D1 f* f6 l4 u6 w; C' e set A_i to 1! }& T" B! ~2 c7 a" k. s# @
move into Q_induct1
+ Q" G- M) A' g5 e1 E2 \ move into pickaisle.induct1
$ Z8 f( p& z9 r9 w8 a2 ~' [ while A_i<=30 do begin1 Q! p |- ~# F4 G9 D1 m
travel to pickaisle.con(A_i)7 t2 ~ C/ l' A% a& e3 t H7 R, Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* J V7 Q1 [ F$ z else wait for 10 sec
# _0 _2 {7 g( Q6 I9 y! ]" X- K if A_i=A_leave then send to die1 |0 X! }% D' e" ?
else inc A_i by 16 I9 j7 n. U3 w6 Z4 B- M
end T& @$ w( \0 j! p% o1 W0 h$ ^
end
1 W& n+ ^) L; m) w8 U* ?& s
: r4 Q, T7 q, D) Zbegin P_pick2 arriving
3 N" V/ D# C! S# q% Z D6 B set A_i to 11" N2 I* o- z0 `( O
move into Q_induct2: w& I' B8 g* u, w* N U( Q3 B) t, b
move into pickaisle.induct2
- \- @2 h4 F4 u5 [0 i2 i while A_i<=30 do begin
3 V3 k, S; Z9 G! Z) f: R travel to pickaisle.con(A_i)8 _/ T4 `- W6 r, _+ ]7 g
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 `+ ~- `& o0 C" E/ t
else wait for 10 sec
- a' V8 X7 b7 N6 }, w( V8 ^* ` if A_i=A_leave then send to die
1 [8 G" q6 c, H/ \8 A& O else inc A_i by 1
0 s2 N2 X: q B& B end
^. y3 E% x7 t- g, }end
$ _9 i1 e$ V" d+ g3 M- o5 C9 c& p9 }$ `6 ~% t- w
begin P_pick3 arriving; Z& {5 y8 T( F; ^
set A_i to 21
, }& w/ H/ w" h S move into Q_induct34 J! V- ]4 h, y8 G* g4 l
move into pickaisle.induct3
; L# f- A2 J! y' W5 W" Z while A_i<=30 do begin4 b) K/ r, n: r D9 G1 Y
travel to pickaisle.con(A_i)
# V% w S8 W$ u u. f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) x) [1 i; a8 h2 U8 n4 d, X
else wait for 10 sec
6 a7 {; Y; q, z2 {9 O% n if A_i=A_leave then send to die9 W( S/ _1 R% H$ N0 z* e
else inc A_i by 1
8 [8 B( T+ x5 x end
& M$ N! P8 K! S4 @1 xend |
最佳答案
查看完整内容
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,其它按你的 ...
|