|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 J: Z5 J. h+ M' z) x$ `
* f B9 X! L# \/ s; q8 G2 j6 D
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 B1 }" q7 p- K4 C$ s1 k& Y" w
; v8 n9 l1 Y5 v3 ?9 N# q4 mbegin P_read arriving
2 \( c0 ~7 m' `; N while 1=1 do begin
& @ D' n' e. Q$ W8 J, [ read A_tote from "data.txt" with delimiter "\n"
. N2 W4 b# e2 [- H read A_time from "data.txt" with delimiter "\n"
/ [7 Y; b2 E) g0 T9 L read A_leave from "data.txt" with delimiter "\n"
+ [9 ^- H; ?3 {9 U* U read A_picks from "data.txt" with delimiter "\n"
, K7 x4 }( {# u1 f set load type to A_tote
9 }$ j- F* g5 d* y7 A* A# C if A_tote="tote 1" then set A_induct to 1
, E+ z0 y) U. _3 C1 T# _ r/ o/ k; } else if A_tote="tote 2" then set A_induct to 2
- [1 ^. S- S' W" ]# ] else set A_induct to 3
, q; P2 ]% s8 _& i* B5 m set A_i to 0
+ b$ [5 M. V4 R& o clone 1 load to P_induction
$ l% L0 L8 n% l* _$ I; O& t wait for A_time sec9 F1 K( i# v, k. Q& X" x4 G
end
9 j! f9 x: B' }0 }3 ?: dend
" M* B( Y: \5 [/ j9 Y3 W, F
6 @, B/ S0 J* V! U1 cbegin P_induction arriving
; S6 C8 A6 x3 R1 k if A_induct=1 then clone 1 load to P_pick1
`! M5 o: b3 ^, G- n else if A_induct=2 then clone 1 load to P_pick2
" Z( i6 N4 ?% l1 s else clone 1 load to P_pick3
& U$ K# W0 }- R& e( `. qend
3 J8 `$ _1 N% e0 w0 L* K1 `+ ]! {" @, k4 f$ @9 p
begin P_pick1 arriving
- R3 J" ~$ r. a2 U1 n set A_i to 1
! i V2 \1 n( m' N7 i move into Q_induct1
^/ K% [6 p/ @2 W move into pickaisle.induct1- R+ U8 u9 w4 p0 C5 G7 D& ?# j( N& @
while A_i<=30 do begin
: N. g' ?* W, P& Y% `: j' x travel to pickaisle.con(A_i)
; z1 P0 R. M8 Z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 d9 P6 o; S* Z- ~3 W
else wait for 10 sec. x. q# l4 x& B2 @" Z8 M8 z9 I3 i
if A_i=A_leave then send to die
# {, ]- W2 L% g; q O) k0 h else inc A_i by 1
7 G7 e' T( A) w( l$ p end! f2 j5 W3 j" W$ B% J1 l7 C& ~( g
end
8 I" [9 g$ z1 W( L. X& g/ B8 ^5 D: v, b
begin P_pick2 arriving7 b( |( J$ N; ?: A' U* I! N
set A_i to 11
9 N5 F( u; X4 q ^; j/ u) Z* e3 K C move into Q_induct2
9 C2 h/ I2 T; w9 r move into pickaisle.induct2
2 D. i9 t$ o# \7 L3 o/ r while A_i<=30 do begin
9 ^3 ^4 \( M, T8 _ travel to pickaisle.con(A_i)3 o% U& L& p" k2 Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: C) N9 `5 K! p
else wait for 10 sec
' r0 M. h N* }1 }/ J9 e8 H6 j* x& Q if A_i=A_leave then send to die
d2 n8 W3 r1 ?0 n6 F. i6 e else inc A_i by 1
+ C# S& ~6 m" h/ p% a d& h end: Q1 R( X8 P/ e1 x2 ^
end
; m/ n$ y4 E( d7 @2 B J& ] r4 P6 G0 d& o& W2 o
begin P_pick3 arriving2 e( m- g3 b1 Z. ]% L
set A_i to 21
7 h% S! M9 P, `: Q0 J7 H6 w move into Q_induct38 C, t" p0 U7 V4 y1 m9 m0 z
move into pickaisle.induct3
" A4 K0 O/ y* v9 o* @2 Q while A_i<=30 do begin
9 b! A7 r2 V9 A) g* S. X6 k travel to pickaisle.con(A_i)
* Q3 V, R. u* S+ @% m7 e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 z- f2 O6 @; f" d8 y
else wait for 10 sec7 h0 |& x8 A0 ]% P0 z! N
if A_i=A_leave then send to die
2 j( k& }. ]1 D else inc A_i by 15 e' \) K- D/ c* y f; Z. [
end
8 [( P1 Y5 a" } h0 j# Jend |
最佳答案
查看完整内容
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,其它按你的 ...
|