|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" @% {' z2 q" k( p1 C
# Y6 a$ q. s) K3 E我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 Q( Q' z$ |9 X' r% q1 R2 J9 J. R
begin P_read arriving
3 r4 l4 F3 P) ]& q$ i, h5 Q while 1=1 do begin, \' X% s# K6 j' n8 B; p+ V
read A_tote from "data.txt" with delimiter "\n"
# c( b+ {; L& i# B read A_time from "data.txt" with delimiter "\n"' N( _" P& r# {& |, x3 l, s. e$ h
read A_leave from "data.txt" with delimiter "\n"4 A6 p9 @* O6 _& X" ]
read A_picks from "data.txt" with delimiter "\n"
2 _8 F6 M! l M8 V0 q set load type to A_tote
, P% v' S0 ^' j' q* C if A_tote="tote 1" then set A_induct to 1
( ^" j. C+ J% M else if A_tote="tote 2" then set A_induct to 26 I, R) R( F5 D* Q7 f3 a3 E5 R
else set A_induct to 3 7 E( m5 y% @& l; c; g
set A_i to 0
8 F! ^; C/ ?( }1 H clone 1 load to P_induction( U5 R- r/ y1 o$ h6 n
wait for A_time sec
+ O3 Y; {- t' ]. p end
; j# I0 r; L- Y' Tend8 g8 _: Y+ `, k2 f# v6 z2 F
& `, E9 n3 H7 g$ t @9 Pbegin P_induction arriving
8 Y, Z; W+ C8 u3 K+ g if A_induct=1 then clone 1 load to P_pick12 h' K S6 Y; V( k' Q7 {9 W$ I
else if A_induct=2 then clone 1 load to P_pick2: Z0 W4 ]( r$ W" G1 q6 {
else clone 1 load to P_pick3: k; b0 u' z8 n! \* Y
end3 f+ S/ n- f" L+ I' `
- u. V; V6 _' l: Bbegin P_pick1 arriving
7 d/ Q/ i2 S2 P0 P W- s set A_i to 11 @* r+ Z- B" p9 K) Q* X; U; q
move into Q_induct1
( Z& P; b0 \# U! l+ z2 D move into pickaisle.induct1
0 @2 o; B9 M& T while A_i<=30 do begin6 n8 D3 H7 j# k2 n; V
travel to pickaisle.con(A_i); J6 F) c: b* j; b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ V4 q j5 Y( s7 H3 v' C5 f else wait for 10 sec
" n! W3 [ F6 f" W7 K* p if A_i=A_leave then send to die
* {" u* O4 \/ S, f# G5 g0 ]2 r& y else inc A_i by 1* G* Q9 W7 `' t o! @* G& P( ]
end- d. x2 F, E" [/ v3 [4 {5 {: s
end# c+ \: k% D2 h; B
# x( N( a5 C( l. Gbegin P_pick2 arriving
& B, w. p0 \* e! ^2 _% o set A_i to 11
+ L, x" M1 ^! g, c1 i$ k1 V move into Q_induct2 I. X q/ G3 W, L Z
move into pickaisle.induct2
j7 M. l$ S- [+ x4 o9 y3 N6 n while A_i<=30 do begin& F z- w9 f' l' b( ^
travel to pickaisle.con(A_i)
9 W4 U, D* B5 m2 F9 @0 ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 ]4 \1 z) S% D) }2 \" J! M
else wait for 10 sec$ n3 {7 X% B. K. e2 Y3 n: s
if A_i=A_leave then send to die
+ ~9 R5 D# x/ Y. Y( e y; ^3 m1 ~ else inc A_i by 1
: K9 j: s8 J. m, j+ C- o6 S end
: w. Z! i! c' v. \2 qend
( _3 L6 U- [7 z/ C8 g9 c) S- F+ X C" H! k$ \2 O- Q5 @% L( h7 j
begin P_pick3 arriving; c: L9 S: N% N) D' I
set A_i to 21
+ K" L+ T5 |. f2 {' d move into Q_induct3# a: l8 V6 B5 W. `5 k
move into pickaisle.induct3
' i& R- S, b9 `6 n+ R while A_i<=30 do begin
# ~8 e) u3 C# J( x travel to pickaisle.con(A_i)
3 V$ r# B6 | C5 K, m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 q0 b2 r! ?4 Z; j* Z
else wait for 10 sec! T7 m5 u. T/ B* R. h
if A_i=A_leave then send to die
7 N, ?( o) w) k& P' h* l8 a# N else inc A_i by 1* A8 [5 Q) c N
end+ h. `% O H+ F9 d6 H
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,其它按你的 ...
|