|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# Q, i# X! p8 a9 E; {" ]; c
0 z$ O+ \" N6 ~% F8 b2 @; f我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 w" K3 C7 }! i. E& \: t. [- b: C9 y
begin P_read arriving
+ F: f1 @( j- ^/ k; K& F while 1=1 do begin S. u/ N, ^( v+ p7 y" \4 Q* x1 ]5 k
read A_tote from "data.txt" with delimiter "\n"
. e0 @" X, O4 S% Q. {( e+ s read A_time from "data.txt" with delimiter "\n"
. M/ D! u3 y8 L7 @0 f4 b read A_leave from "data.txt" with delimiter "\n"
% M) ` K; h z' g4 Q7 J& J, _+ p" q8 }; c read A_picks from "data.txt" with delimiter "\n"" D- ~, @9 Y- f
set load type to A_tote& F* @. A6 f0 r, m
if A_tote="tote 1" then set A_induct to 1
) S7 H% M. y" a* _3 U8 d else if A_tote="tote 2" then set A_induct to 2
: k3 c1 Y$ D8 h else set A_induct to 3
; b# U, s y3 d1 @ set A_i to 0
3 c+ S3 T1 j% B9 m% L clone 1 load to P_induction
- ~$ R4 i. b" R7 t3 H) i wait for A_time sec
% U3 a- @) `3 l& R# H end* s% E; {9 [" B2 r" \: {' y
end
8 E a5 S" d" W1 |% l& C
' U4 J; ~6 N1 [ d0 ]# T0 ebegin P_induction arriving' q0 |( D7 w0 Y: Q) P: v) G4 k
if A_induct=1 then clone 1 load to P_pick1' L. z0 q8 o% m2 u
else if A_induct=2 then clone 1 load to P_pick2
% Z3 ^+ C7 t3 e2 R else clone 1 load to P_pick3
% }( U x/ Q) K7 ]+ ^end
: s2 G4 k) u( ~: @/ d- l- L' e4 g% r7 o# a* e- x
begin P_pick1 arriving5 |/ E" c0 W/ a, S0 `1 \* w+ [
set A_i to 1/ X1 e4 }/ Q; m( {* v. I
move into Q_induct1
. T$ I2 _0 X! ~7 G& u move into pickaisle.induct1, E+ G8 Z8 m6 X3 i
while A_i<=30 do begin8 o5 l! y! C0 H
travel to pickaisle.con(A_i)
: l U1 z7 x7 D if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# [: L: B6 Y% y7 y- g6 ]% n else wait for 10 sec
- p" N$ c9 ?2 x4 Y3 b8 u: e if A_i=A_leave then send to die5 ^ E u& B1 P4 |5 Q7 L
else inc A_i by 18 z$ g0 A- a2 a3 K
end5 w7 P" a; g& V/ `. L( ?
end# J" H1 p& |. }- }
3 C6 }8 A6 s( p1 x
begin P_pick2 arriving
" F% v: q: a/ n* `* m: t" x2 E set A_i to 114 h( l, \- Z! w: k0 @5 |8 l8 x
move into Q_induct2& a: \3 q8 m) Q# |! ?% r" _
move into pickaisle.induct29 o, @" U/ ^$ H
while A_i<=30 do begin
9 V+ L5 a/ z9 D- d1 S0 n* R travel to pickaisle.con(A_i)
3 \$ R# i( F6 d5 ^8 r* y( E6 M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, |" g0 j4 Q2 z) R# [ else wait for 10 sec, T# H2 A' h4 V' H6 _
if A_i=A_leave then send to die0 x, {" I. M* {& r0 ~5 O
else inc A_i by 1/ {/ @* E5 [8 c; h% g5 n
end& ~+ t- I1 Y N7 {8 g6 T L- o
end9 L2 b( } ^4 v; z2 l5 H
' V6 n! A U! cbegin P_pick3 arriving
2 `' |9 @1 Q. G7 O3 c set A_i to 210 H) m/ `) T* A+ {# b
move into Q_induct36 n) g; v% i9 F' e6 k1 j
move into pickaisle.induct3" {# N" Z8 w x2 `; o, M- [ T
while A_i<=30 do begin
9 B B# J0 [5 l travel to pickaisle.con(A_i)
9 T9 H) i, c, @0 h' q* Z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' W `' M; t+ } x8 L2 ` else wait for 10 sec1 h/ y# }' j" F% g! ?! ~' s
if A_i=A_leave then send to die- V( v3 ^9 f. y8 s9 f
else inc A_i by 1( m5 ?8 H# L J# i- q& S
end/ }% N" G5 q# V; S" s
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,其它按你的 ...
|