|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 h P3 U, n$ b+ V, ~1 i3 x* r6 @) ]3 I# K2 a
我的问题是,在每个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 z& g+ ]. y4 s! t' a0 r
% t5 I) x0 _. L: L- Ubegin P_read arriving
8 [9 j' D! [7 g' l$ K while 1=1 do begin7 m+ Z- M) m1 J4 u9 h3 O" V
read A_tote from "data.txt" with delimiter "\n"
* x; p0 r, H( U: {) B! x read A_time from "data.txt" with delimiter "\n"
! S9 H7 W5 p" a4 Y9 K J* Y read A_leave from "data.txt" with delimiter "\n"* r o( |' P5 X1 y
read A_picks from "data.txt" with delimiter "\n"
/ }) S9 y9 S5 B6 ~- i set load type to A_tote. U* ?4 N; p' h2 \9 F+ f
if A_tote="tote 1" then set A_induct to 1
/ M3 q; H# O2 H7 q4 g2 D2 } else if A_tote="tote 2" then set A_induct to 2% D" G6 f5 I0 C% _9 T7 k
else set A_induct to 3
( g$ l2 [! P: O |0 U8 r set A_i to 0
& i" y X: n4 d& z/ @ clone 1 load to P_induction( P& I3 s1 i& w$ W
wait for A_time sec6 k9 @* o3 c+ l# b
end, o3 G4 [% _# S3 ]. J, a
end+ d( _1 ^- t3 k8 }; J
: D9 e" a/ H2 o/ C M
begin P_induction arriving
0 A8 P' A6 X1 @, J9 n if A_induct=1 then clone 1 load to P_pick1# J( p2 H, G1 V4 K: Z+ d2 J
else if A_induct=2 then clone 1 load to P_pick2- u* F! e6 M2 Y' |
else clone 1 load to P_pick3
. P2 M' t, M# D/ N- m/ M% ^end
& h" j8 z- @$ v |
% }# N/ Q3 D# z# B mbegin P_pick1 arriving
# Q: u* y8 ~5 N7 c set A_i to 1) `! h m/ j% H% p Y
move into Q_induct1- x3 ^) U8 u8 Y1 p# ]6 F' f9 z
move into pickaisle.induct1
T/ i4 C h, a- _) r- w while A_i<=30 do begin$ c7 ^0 F2 i5 T O
travel to pickaisle.con(A_i)
! [: W# P3 u: ]& i! { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 c, W( N' e% P6 o3 @& w2 V6 X" O
else wait for 10 sec% f5 X3 W) [2 M& |. ` N( u, U( p9 t( N
if A_i=A_leave then send to die
" r& C% v k4 l9 L0 Q" f2 y else inc A_i by 1 D1 x* ^, p2 r: K+ X+ i
end: }. I0 {4 c8 Z+ Q* k9 m% c# }
end
' f1 q7 a( U! |
, I2 U4 o' l- m) ^4 g& x4 W2 v6 Kbegin P_pick2 arriving1 B0 c% B: h) ?( |# |
set A_i to 11% ]* m: W4 G0 ]! E5 {, U; t Q
move into Q_induct2
% X) \( ~4 Y# _: A2 ?* Y* ^3 [/ i move into pickaisle.induct21 \! ^1 l0 G; j0 d6 { I+ \+ u
while A_i<=30 do begin
8 @- M- ]# I! b( t. q' W travel to pickaisle.con(A_i)
- Z+ M" m" E1 ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: q2 W+ ~; i" o
else wait for 10 sec
+ Z8 |( D: W0 @ if A_i=A_leave then send to die3 X7 {) s! P8 U" {. v, b( H
else inc A_i by 1
& u9 G4 O0 {% X" E; Z, K$ J8 t9 F# p end
c5 l6 [; ^; e0 S. Iend
5 \8 B" m' R2 ~- t$ p, }! a; H ]. k2 O+ F( M
begin P_pick3 arriving
6 S' l4 f, [3 W6 K4 P! ~ set A_i to 21
6 y5 n7 i" y# d8 V4 I move into Q_induct3
% v% A6 ]8 v2 a; T5 h+ `* g* o move into pickaisle.induct3* F9 M6 S+ r& @: I
while A_i<=30 do begin
8 C2 i- ^- x+ E' y1 A+ N travel to pickaisle.con(A_i)
0 m; ]* P+ R5 P4 [; I4 |5 [ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 R, ]# j0 }" t" k! c+ Z- {
else wait for 10 sec$ a5 L. N" x! r5 `0 F3 B
if A_i=A_leave then send to die1 E4 b3 I8 {; U' }7 C
else inc A_i by 1
' b6 @* H2 n C end
* p5 Y3 K* V: u' M* B8 Bend |
最佳答案
查看完整内容
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,其它按你的 ...
|