|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" G% c3 d0 Z, i$ A1 W# K& H- I6 X: _
7 F R1 ~+ @4 i+ ~# m我的问题是,在每个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 o7 ~4 M; ~0 J0 N( b
4 s% a/ C1 m# |# M9 W5 rbegin P_read arriving5 \! O( {. O+ }: g
while 1=1 do begin
& A+ F( I4 N) n# G: L read A_tote from "data.txt" with delimiter "\n" F Y7 r. _, H- Y; L% i( R
read A_time from "data.txt" with delimiter "\n"1 L- N K% B, Z+ ]; w; n, H+ }
read A_leave from "data.txt" with delimiter "\n"
- j( ~5 r3 B q, [* f+ P read A_picks from "data.txt" with delimiter "\n"2 j; P* ^) g/ M
set load type to A_tote; `& t- b: V' p
if A_tote="tote 1" then set A_induct to 1& P- C; t- d) y& b9 ?, A
else if A_tote="tote 2" then set A_induct to 2# S. _! Q# H4 n) I0 t3 C) Q
else set A_induct to 3 6 I4 ?2 f& y3 [4 ]1 `5 k* Y, B3 ~% M" M
set A_i to 0+ }$ ?& f1 p6 H7 l
clone 1 load to P_induction L& C0 y$ f% w3 ~8 {
wait for A_time sec, l* @* H5 ^# U0 p
end; ~: a$ u( S9 k- i6 Z6 P
end6 a$ W$ y( _# T3 J
4 i6 O( G7 q0 ~) D+ \$ v7 ~" T
begin P_induction arriving
, }7 d5 r" U8 S) P6 w4 H( P if A_induct=1 then clone 1 load to P_pick14 E, L* J( ~5 {5 v& `+ x
else if A_induct=2 then clone 1 load to P_pick2
* O8 F5 y' c" ~ else clone 1 load to P_pick31 K/ I1 g1 W! ]0 `: O
end( U M( k/ O* o9 ?( j+ P
0 w' m4 {$ a: H. J6 k4 k
begin P_pick1 arriving7 B5 ?- M5 A2 E2 h) ^/ A/ P; `
set A_i to 1
3 `* b4 H# b& m( W( L) j/ e5 I' | move into Q_induct1
3 n% G2 P" p! ?0 `. t move into pickaisle.induct1
& z3 r5 }+ G8 f/ Y# K while A_i<=30 do begin5 ^$ o2 }& d1 ]# o% o
travel to pickaisle.con(A_i)
; R$ A5 ]. w7 G$ [- p5 j' \. N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 ^1 M0 ~+ }8 f+ @
else wait for 10 sec
* }2 d3 |/ w( C& b7 e/ t/ V& F if A_i=A_leave then send to die
$ u7 A0 Y9 F( P) Q1 D( I else inc A_i by 1
% P6 [ P- T' A8 X) w' S" P" p end4 v3 t) W, g9 c ?
end
& a! Q/ Q" l7 d5 L
% Z% N- w' w* J! v8 U$ Obegin P_pick2 arriving3 i7 e/ g; _1 d+ b7 ?) Z& t
set A_i to 11 Z& g, T( ~9 L8 b
move into Q_induct2
/ ?6 e+ K1 p$ s move into pickaisle.induct2
6 G4 ]* V+ s* ^& B1 i while A_i<=30 do begin: x9 b: _7 x8 S% z% p# N
travel to pickaisle.con(A_i)
' K/ [" U( r( x6 T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 H( D& o# h* ~) c; E else wait for 10 sec
4 r% B9 P, D. l$ R9 R( ] if A_i=A_leave then send to die* g6 l" L! J# h. ^
else inc A_i by 1- |, }; Y3 F+ p+ L3 Z+ o
end9 g3 Z1 s6 |" K
end4 N8 |5 q* j, Z& c7 T/ _; K+ v
) f* A- ~; F7 ^% y! P
begin P_pick3 arriving) Z, \# q' N( N! y3 V! _& q
set A_i to 21
* _# p! s/ s" ^/ _2 n9 p& _ move into Q_induct3; t3 g8 ?2 t( J4 E" m* s* @4 W
move into pickaisle.induct37 s* j3 }3 K! i8 ?3 Z
while A_i<=30 do begin. Z! R+ a" q$ z8 u+ M0 Y
travel to pickaisle.con(A_i)$ ?6 ?( b4 ]9 U. M: u
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 h. k9 F8 L0 O8 W+ `. x/ ^. p else wait for 10 sec
8 f) ^4 F& c& z9 Z" p5 u5 R if A_i=A_leave then send to die! A5 I6 \% t6 D3 h
else inc A_i by 15 Y3 t# x0 N" [( r! ?& R2 z
end
8 ^ C, ^, z# x& X( @& T( Y$ Uend |
最佳答案
查看完整内容
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,其它按你的 ...
|