|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ Y V& a5 Z% b% D, e' `, J" i) R/ [& F- f" l: @; N, U% l
我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ G* s0 x. U" s- r' _
3 s4 b Z$ V; w6 w
begin P_read arriving
+ r/ M$ o6 A C( _" W: Y8 c while 1=1 do begin6 `% d" Y, D- F( L: f' i
read A_tote from "data.txt" with delimiter "\n"% z Z" @& f- }; O# T7 m- \: D
read A_time from "data.txt" with delimiter "\n"4 S7 ~6 H2 G3 p7 }6 A, q* B
read A_leave from "data.txt" with delimiter "\n"
6 W4 D2 K8 c1 |0 H read A_picks from "data.txt" with delimiter "\n"
6 K+ Z/ R# t3 K+ o+ C/ t set load type to A_tote
7 w& ?) B$ a' M if A_tote="tote 1" then set A_induct to 16 {' S) [5 N! S7 R) I
else if A_tote="tote 2" then set A_induct to 2
; ? O1 h7 Q1 [+ M+ }- t+ B) ~ else set A_induct to 3
, R9 F3 m' z. L% w0 I set A_i to 0
5 M; Z, l! Q- I) }4 ?9 m5 f# n k clone 1 load to P_induction& i! w: Q0 d+ G. f* |! I& m
wait for A_time sec8 U. P$ I9 K& u/ q5 U5 f+ u
end
( @* g* P5 a! s4 @7 V9 L9 h( Aend
, V$ R& S; l* l/ F W) |# ?; E+ Q: |: G4 x" x9 M+ `4 N5 N
begin P_induction arriving/ D( k% [; w3 n9 j: s) b0 |& x
if A_induct=1 then clone 1 load to P_pick1
2 ]" s9 h" J! i0 {7 \, L else if A_induct=2 then clone 1 load to P_pick2
; ?( s2 x. X! J else clone 1 load to P_pick37 F' j& v* k I
end. ^" t' K: M3 p) ?8 e
0 ^3 S+ O; ~" S
begin P_pick1 arriving
; g8 q6 S, o& R' J9 P1 p5 H. o set A_i to 1" O! g* K1 Z2 @, D1 l+ J* L1 ^7 q! S8 ~
move into Q_induct1
6 W. J6 S3 }& P8 O move into pickaisle.induct1
2 \- x1 k& Q* p7 S% o while A_i<=30 do begin
! `7 [' S7 Y7 F. b9 m, {% j travel to pickaisle.con(A_i)/ [- \+ b: K w* D- t) [/ y, z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; S1 f: S$ f- ] [, s* f
else wait for 10 sec
" A: x" j d+ P5 Q if A_i=A_leave then send to die
2 ^6 H; h( P$ z else inc A_i by 17 J3 T8 l! @% U: ^! Y
end
6 e2 t; C7 G+ d: s8 ]end
1 g, J# t, M. F; C
- x# P8 v' v5 m9 `begin P_pick2 arriving- M8 o: |- v; V) |1 s' w
set A_i to 11$ u% A& ~' p0 b8 P" V) u# \
move into Q_induct2+ z4 c% d+ _& L" m# C
move into pickaisle.induct2
: n* |; U$ Q# D9 }/ T: ?. b0 O' G while A_i<=30 do begin
( _- O7 R0 j! R7 Q travel to pickaisle.con(A_i)
8 I4 X2 t& O4 `3 D if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; u: c" ]' s1 O
else wait for 10 sec5 O. ~" N$ e! U: G h
if A_i=A_leave then send to die( E/ u$ [7 z: T1 Z8 w" K% ^
else inc A_i by 19 h* \' ^+ Y. K" k) Z) a
end! p0 S0 ]5 t* Y- L6 w; |- J
end( \7 L5 L$ S1 o
/ t) f1 n. O9 N" R% j) K* o) s
begin P_pick3 arriving
4 o6 Y9 Y' ~2 B6 f set A_i to 21
7 O% c0 `( D5 r move into Q_induct3* J) n" Y% X( n
move into pickaisle.induct3
- H3 I- [$ K1 u2 Z while A_i<=30 do begin
& w& j V; e3 Y4 g travel to pickaisle.con(A_i)& ?0 `/ G/ g% f: t! Y- ?: l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 ~" H. ^. |# ^4 f X! G
else wait for 10 sec
( c5 v7 ~$ V+ S: X& m8 r/ N if A_i=A_leave then send to die4 J2 ^0 O E5 o- ^
else inc A_i by 1
" l% S$ F9 Z8 \ end s0 w$ _9 M8 j. N( v K
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,其它按你的 ...
|