|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 X! n9 n& }0 a9 M# J/ j3 A! p* t, z) H2 l3 j2 _) o
我的问题是,在每个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 V$ p7 V* O X/ q0 d
, J/ s4 m" Y" D. H7 q Z$ Pbegin P_read arriving6 W& Z4 C, l/ Z$ G+ _. {: ~9 N( c
while 1=1 do begin- [. Y) x' K+ R4 x( w- c2 f1 S
read A_tote from "data.txt" with delimiter "\n"
. L3 `) e2 O- O+ }% j' a( B read A_time from "data.txt" with delimiter "\n"
! [3 E/ F9 ^3 R9 `# u read A_leave from "data.txt" with delimiter "\n"
2 V# M' E c; T$ w' h/ p5 o read A_picks from "data.txt" with delimiter "\n"
% V t: \/ g* B7 p4 H set load type to A_tote
! _: n- `* I7 T3 @$ Z _( z0 ? if A_tote="tote 1" then set A_induct to 1
& |* u$ j) C# E/ Y else if A_tote="tote 2" then set A_induct to 2
$ {. N0 N# g- m& I: W: e else set A_induct to 3 1 V/ v w; L! A: G& X7 j, M
set A_i to 0* X5 ], S# E0 P( u7 B
clone 1 load to P_induction
" p: D0 m9 _! B( N$ g" o! f wait for A_time sec$ H6 W2 d' o& r% E7 S
end+ B& _" o- o( \3 T" A' Y8 b+ i
end* l4 ^, w8 c. T- v) {. t
6 |0 h8 i$ c( w; A! ^# l9 d
begin P_induction arriving
( ?5 q, j5 ]# b1 K# M if A_induct=1 then clone 1 load to P_pick1! h, m Q9 B" u; z1 r1 u- o
else if A_induct=2 then clone 1 load to P_pick2
- l4 o d! J) P, @4 S) g' p2 `4 v else clone 1 load to P_pick3
0 s# m* k0 S2 o+ L# u/ yend
% L1 F+ y, v5 \9 W+ G% ~
# h& u1 P3 S l" O/ }begin P_pick1 arriving2 I. p& k q3 o; a% g2 Q2 e
set A_i to 1
, r9 [1 z/ X; k% \+ C) q move into Q_induct1
# p X1 g/ K& ^2 t move into pickaisle.induct1, G i3 f; l; T# |0 N6 ~3 Q1 [
while A_i<=30 do begin4 H0 x6 D" _" ~! o1 W
travel to pickaisle.con(A_i)
g: O* x+ [0 S- E' }! q% B if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# b9 {; d/ H# t; `9 W; k- B$ }1 v else wait for 10 sec
8 }+ L$ D* W! X0 }( d if A_i=A_leave then send to die
7 t X% b. J6 m. n5 d; A else inc A_i by 1: c) J. |& W5 J. h+ C
end# d5 S6 m+ `; T1 _! n, w
end7 B7 n& o5 P; H9 b
1 g/ A. o e% _/ u, i7 e+ T* p
begin P_pick2 arriving
2 j# I& X" d9 H( @9 q& E* @# @, a set A_i to 11
- L# h" Z9 D8 p$ v7 y0 B5 U% P/ \ move into Q_induct2
t4 i5 h3 T8 C* a/ u+ W& t move into pickaisle.induct21 J% `: n& W+ `5 B3 W
while A_i<=30 do begin! n/ V2 u9 W, h% T& d8 L
travel to pickaisle.con(A_i)
4 }* _: a* ?0 \/ |- ~9 \2 ? if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 w& V3 }1 D2 |3 Q else wait for 10 sec
9 _& p4 E% T& | if A_i=A_leave then send to die0 X4 s! S0 z7 o5 N
else inc A_i by 15 i/ A7 x" R$ @% s
end
" w1 d) c: {" l/ hend6 @' v$ ]' _! s
. x) y7 B" [# K( R, y( Q
begin P_pick3 arriving
* h, p' M9 [. ^( X" m5 [ set A_i to 21
6 z5 I I1 R/ F) m) T% l0 I0 W move into Q_induct33 y% H8 T. w. }& E# Z
move into pickaisle.induct3
$ Y! L: M0 w/ b; A while A_i<=30 do begin
! H$ x# |3 i2 h4 `2 a travel to pickaisle.con(A_i)" n/ j7 S8 r/ ?. v* B1 p
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: Z) T' Q: Z- F, e( V2 F
else wait for 10 sec6 J) \- ]! U) Z9 r0 m& N8 r
if A_i=A_leave then send to die
' y" w- U. @) w8 I+ x* B/ a' M$ U/ G! w else inc A_i by 1( S/ Q+ S# k- r9 A; J& Z
end
6 M) A! ]8 X; x1 Vend |
最佳答案
查看完整内容
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,其它按你的 ...
|