|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, ]( Y9 Q7 }7 z; y
7 G" y P8 ^% x _0 _; h我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* f! ?9 b- P! x' k# a& u
' j) E, j6 ^5 l% Kbegin P_read arriving+ H1 ~1 t5 n. E7 g
while 1=1 do begin' m( h' o, a' A+ @( P7 ^ E
read A_tote from "data.txt" with delimiter "\n"8 t4 I; E3 s# v! F; Q8 f& p
read A_time from "data.txt" with delimiter "\n"
9 y4 I/ I( L4 J& W+ e+ I) ~ read A_leave from "data.txt" with delimiter "\n"
" r8 c4 D$ A ?3 N read A_picks from "data.txt" with delimiter "\n"
, N$ }0 t8 `9 y set load type to A_tote; }; o& j2 B" l8 o7 |+ M1 v9 F
if A_tote="tote 1" then set A_induct to 1* D# w& {# x/ A( o" [6 Z
else if A_tote="tote 2" then set A_induct to 2$ L- s a# E1 r/ w
else set A_induct to 3 6 O3 z& ?8 ^4 ]
set A_i to 0" F3 D) l3 @2 E. h& {
clone 1 load to P_induction# `$ U% p/ N6 x6 F7 h: G2 \
wait for A_time sec3 j" }$ l2 C9 G4 r, u
end
) A; ?4 u" r* B6 Qend3 n. X, e/ g& A7 _; t) Z
) q9 r/ o" ?' L- d9 M1 ~
begin P_induction arriving- {7 R! C$ d( e1 z1 a, L
if A_induct=1 then clone 1 load to P_pick1, @5 J6 _$ K+ t( L5 U
else if A_induct=2 then clone 1 load to P_pick2
8 c" k1 t& \' g0 H- _+ L else clone 1 load to P_pick3" O% m! O6 G( h6 r0 o7 V
end
* D! k3 Y) U1 G; V8 R
% a) t3 e R% b. }+ [3 pbegin P_pick1 arriving4 c4 d# \3 |6 Z$ O2 I3 r4 l9 H: J' u
set A_i to 10 @: ?& C1 C! ]8 C' k( f" l
move into Q_induct1
1 }( U. p$ L1 z8 U$ E( j) S move into pickaisle.induct1, F4 s- y+ v. ]5 ?7 S. W
while A_i<=30 do begin/ z3 ?( V3 Y: i! v' s' H* @
travel to pickaisle.con(A_i)
! I7 m& z1 W. R if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 q* B0 m' q+ u6 w. T, A* {3 {
else wait for 10 sec/ i3 D6 i% L, O% n/ j$ Y
if A_i=A_leave then send to die. G& @6 J; g4 j4 X h
else inc A_i by 14 f- T: b) T6 E3 T
end
! \" n, W% k" M* M; Lend
2 g) f \6 M3 z! T) b/ }
/ z0 u& [) @& k# L- S0 e- j/ zbegin P_pick2 arriving0 ]- c: w- H. c6 L
set A_i to 11
* q8 x8 O* B, T" V4 K% H, Z move into Q_induct2
& g6 l* z: F! a, R4 L7 X move into pickaisle.induct2
0 V3 [- {( S$ @8 i8 P while A_i<=30 do begin& [/ l N7 r9 c5 e0 ~' `( c" z
travel to pickaisle.con(A_i)
; J7 h6 O5 o) A if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 @* E) X0 [/ d else wait for 10 sec
" X( r d) p' S# M if A_i=A_leave then send to die
n( W q7 ^, N4 @ else inc A_i by 1
! ?& a; U5 E( b( D. ] X end4 V( I7 R* p1 z1 w1 {+ Q" c' `$ F4 J
end1 ~; H1 i: B# W' p; L2 Y% v
# q! }" }% r% [: Y+ Pbegin P_pick3 arriving
1 G I& U- k; T7 E set A_i to 21' i) Q( P1 K: l9 C8 k7 n" t: Q2 \
move into Q_induct3
2 C" h3 \6 M7 O% z move into pickaisle.induct3( @1 N, {2 D( ]& T
while A_i<=30 do begin* s! k3 M6 ]. b$ |+ _4 f5 q
travel to pickaisle.con(A_i)
% v" e3 u6 Z- q; b2 L; x if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: [" g. ^" |, l, s. F k/ z else wait for 10 sec+ e N. [2 l6 l
if A_i=A_leave then send to die
0 X! R. Y/ _7 i, I, ~% _ else inc A_i by 1
! X0 _+ p8 U0 w X) a! [ end
9 ]7 P3 l6 X( }1 j; T( Z8 ^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,其它按你的 ...
|