|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" `* z# [% L4 K" h1 J4 U( A
/ X: K, i8 G) F* g8 Q我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ e z6 R k. S5 j5 X8 P: D1 m. `9 A* f: j. @5 O
begin P_read arriving4 U1 \# i) `% l+ C' M1 A3 R- Q, w8 y
while 1=1 do begin
' m$ {8 Z* a8 H7 K. a' ?; O+ c) Q read A_tote from "data.txt" with delimiter "\n" L' J: G, o @* D+ M- ?5 y
read A_time from "data.txt" with delimiter "\n"( Z5 |( y% k* }, q
read A_leave from "data.txt" with delimiter "\n": M4 `: U; [$ z5 L3 ^8 p
read A_picks from "data.txt" with delimiter "\n"
* c' M1 N( \0 c7 E) h3 O5 j set load type to A_tote, y- |( g2 _0 N/ b! W+ U/ k4 {
if A_tote="tote 1" then set A_induct to 13 t8 g) b4 g$ p# N( N
else if A_tote="tote 2" then set A_induct to 2
% P5 f% K9 G; q4 V' S) w9 Y else set A_induct to 3
! A9 ^% P+ x* V. P" t set A_i to 0
6 \% ~9 C! b, ^ {5 R: L8 h, P clone 1 load to P_induction
/ \ X. K9 R# V5 B$ v# P( {5 U |- L wait for A_time sec
6 c- T2 ^) q7 g% H4 @ z+ P end
6 F+ D7 L! m. aend- G/ r1 X3 W& C
# d9 t* P5 n( t$ W
begin P_induction arriving
0 g3 `* L+ f! O if A_induct=1 then clone 1 load to P_pick1" j+ `6 J- T( x
else if A_induct=2 then clone 1 load to P_pick2( o* g; Z: j$ C% q; a+ D
else clone 1 load to P_pick3
; X# Z6 _2 h3 I: Aend
( x5 c: p4 ]9 b* g- z% N! G- z; W- h# T* C
begin P_pick1 arriving
- @# T" u! ?9 ?9 f set A_i to 1
" K6 ]- v, k3 h5 P move into Q_induct1
/ {- n! q. D1 K/ L move into pickaisle.induct1
) O' j6 o Q) Q, | while A_i<=30 do begin! C0 V- O- O5 @' `" ]& n4 Q8 ?
travel to pickaisle.con(A_i)
2 D! v( k% u5 W9 U; u% a, K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& r# O2 h9 s1 ?" h1 V8 F+ M else wait for 10 sec; P7 W; B) h3 J) B2 _
if A_i=A_leave then send to die4 X3 Q6 g8 ?1 H9 b1 s
else inc A_i by 1& u" \1 u. {7 |4 ~7 E
end
: e, z" X4 e4 tend6 |& N% {2 _$ i. P
, c' |' x! T9 Z/ r
begin P_pick2 arriving
" H& C8 _! R' k) v set A_i to 11, Y, x( u. d/ T/ Z2 y
move into Q_induct2
$ ~( A$ ?/ C% {# L1 S move into pickaisle.induct2
/ o4 O% J# K2 W5 q, A. f$ \& C while A_i<=30 do begin
! M& k" V a5 \; I travel to pickaisle.con(A_i)4 B" g d0 [& H1 [# s4 Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ k9 P1 Z2 Z7 P9 m; O7 F' D f else wait for 10 sec; P: `; A2 O- A( A+ F- l6 v
if A_i=A_leave then send to die
2 I% J3 x5 W& x# j8 Q7 i( u- S else inc A_i by 1; B. C2 A, n- s% C
end8 k# h) G2 h7 d. _( k
end) y7 h# L4 ]1 m5 h4 G5 I3 p
, u! e. @5 }3 a" k( qbegin P_pick3 arriving
4 y I: W. x0 \ set A_i to 21) O9 L" p; H Q, i+ ~. u( p) t5 S- w- ^
move into Q_induct3& \0 z* z+ I" d; Z1 r9 @
move into pickaisle.induct3/ |" B0 m; Q5 H, {4 v7 k0 |
while A_i<=30 do begin
9 p% G; o0 E/ O travel to pickaisle.con(A_i)
' V5 S( y- s1 Y" a" L7 q4 u- j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; C* _2 p6 L7 S" f; P5 R- c
else wait for 10 sec
. J/ j; U3 w, \1 X/ M, I j if A_i=A_leave then send to die
( y2 ~. i% S6 Q! o% |9 \+ o' ]% _, s | else inc A_i by 1
" A. F* {# R8 r) X& T" \3 z# X5 U end
2 `/ d3 P4 a7 M% `5 @; Tend |
最佳答案
查看完整内容
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,其它按你的 ...
|