|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 l3 I! M7 Y% z; X
1 c) ?# c! ^7 E4 }% g. `7 X我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" h* c/ Z4 j7 |% }0 |; D( P6 j- D% m2 W- G8 q, @- G
begin P_read arriving& d5 G7 ]3 D0 ?5 X4 @& d
while 1=1 do begin; t$ w+ j% z( _* c7 x
read A_tote from "data.txt" with delimiter "\n"
# V; i8 y9 ?3 O: l read A_time from "data.txt" with delimiter "\n"
; t% n8 U& o5 z: E1 b# r0 N- b, y read A_leave from "data.txt" with delimiter "\n" v# X4 @9 b$ p( f. e$ p2 }$ l
read A_picks from "data.txt" with delimiter "\n"
+ o" ^& L+ r/ O: n, {$ F9 H [ set load type to A_tote
. W1 k7 T: D V4 ]6 b. L( T: z. o if A_tote="tote 1" then set A_induct to 16 N% {$ |( ]4 R5 _/ D; t2 m- |
else if A_tote="tote 2" then set A_induct to 2
0 Q6 x7 O R& K! ]8 M; q else set A_induct to 3
, c8 I0 Q% ]) i/ T2 n5 A set A_i to 0
9 \, X% c, G$ g7 `6 c: U$ y7 c$ | clone 1 load to P_induction
& A$ U) h) c! L- e wait for A_time sec- Q" Q' y8 Y% @: L1 J& ?
end0 A1 }2 S" M8 o' _; {5 V4 f o; W% |2 G
end
( a H! g6 O; d" b4 d3 r! X2 b, n( t
begin P_induction arriving+ }2 a. [$ a+ ^9 G
if A_induct=1 then clone 1 load to P_pick1; ?8 {4 W6 ?0 \# T, p4 ~: Y; z
else if A_induct=2 then clone 1 load to P_pick26 c8 N4 w' s1 n; M
else clone 1 load to P_pick3
7 f- t5 w: m1 ?9 ?( {, ?( Uend- i% l8 K% K: `9 ~/ Z' ]
" G* q7 E/ H5 C3 f
begin P_pick1 arriving4 \7 j3 v( y; B$ w$ y
set A_i to 10 k) a7 u9 y$ N8 E+ {9 i
move into Q_induct1& d& ~/ F3 P5 H( Y* ?0 P2 }
move into pickaisle.induct1+ v; y9 L* i' e4 b
while A_i<=30 do begin
/ S* ~+ Z7 b b2 v1 b travel to pickaisle.con(A_i)& ~. V6 I/ E+ s! e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ b* D& B" {/ g. o' O# q4 |9 N T
else wait for 10 sec
0 a+ z7 P/ L' @( _: s3 R& T if A_i=A_leave then send to die
! j% {0 {# g/ T, V else inc A_i by 1
8 K' y) e6 y+ \* f end) F: j! j; f0 v( l
end
* v6 p+ c$ I2 Q4 L1 y* l D( j. b$ H- a$ L( ]+ H
begin P_pick2 arriving
: j# N+ p. q0 v! \( w5 A2 {6 p6 ] set A_i to 11' e$ p9 \% {& x1 b! r# ^$ c" O
move into Q_induct2
' x- g- \* H! a- {& S/ H) h move into pickaisle.induct2- V6 X" G( A+ J9 V6 t
while A_i<=30 do begin% W* }) H. k5 n' i* A3 P3 |0 G0 z) u
travel to pickaisle.con(A_i)# C2 Z9 W" Z$ S6 G |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 B- J9 ? U* m1 {% {- S* y, h else wait for 10 sec
8 ^) O( R& B' O: F" L2 S1 ^. Y if A_i=A_leave then send to die
! d# R) l. i: ^( Q2 Z7 ^ else inc A_i by 1
8 b M% A5 n$ S! u" [5 Z$ v& ` end% N7 j% G; x" A* W4 C) C9 q
end
6 D- K$ B. F4 a9 ?
1 u/ q, Q- M" |# s: Ubegin P_pick3 arriving
H5 x7 p8 ?8 i set A_i to 21
" h0 l/ I3 N% U/ W0 D4 M move into Q_induct31 U% b% n& R7 M5 L) w5 F
move into pickaisle.induct3$ o8 u! R" u/ z" e! e
while A_i<=30 do begin8 s1 p/ O% r G; T) a+ J0 m7 i. t
travel to pickaisle.con(A_i)& \- n+ U) V& S* |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, R$ C" N# L# Y' j- l" M2 b else wait for 10 sec7 B& y& E7 E- W
if A_i=A_leave then send to die( R/ f5 ~& w" ~
else inc A_i by 18 b2 h" G7 j @8 h! Z3 ] N, A
end
+ x& f9 @; m }4 Kend |
最佳答案
查看完整内容
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,其它按你的 ...
|