|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# i8 q: `- ^, l4 ?9 t6 ~% v4 j( E6 x8 P3 l5 c, Z, E
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ N- z, Y# ^. U" t* B) V# i/ V. y4 \4 D" A$ C m' I2 [
begin P_read arriving
. b9 x% {$ K# B1 X2 |% i while 1=1 do begin! G& h/ J6 v, c
read A_tote from "data.txt" with delimiter "\n"4 H9 V" |* r% {+ x. L; F# [
read A_time from "data.txt" with delimiter "\n"8 b; X/ I0 \- b1 L+ E/ w
read A_leave from "data.txt" with delimiter "\n"
5 }$ [1 J; A ?4 H, } read A_picks from "data.txt" with delimiter "\n"
) n" O# p4 b) G) { set load type to A_tote
! A( ^( m" f, `4 R% S if A_tote="tote 1" then set A_induct to 1
+ _& Q, `; W y9 A8 ~; j @4 M9 p else if A_tote="tote 2" then set A_induct to 2
) C! e* L" `% q u$ W6 i else set A_induct to 3 & V3 {8 b$ g$ A1 C
set A_i to 0, L' f& t1 Z2 [' i5 D- f6 e
clone 1 load to P_induction
6 X7 w/ ^$ B5 I( n9 y. c1 y% k wait for A_time sec
+ c# T- h! A3 }1 c* J! A end
5 j. W0 s ~2 V6 i) iend4 _* Z z; x* \. F% t& @5 Y( N; W8 v* j
5 l: p7 ~5 s4 F7 Y" w* l
begin P_induction arriving# F) `7 |/ L8 V0 P: f( s8 i3 P
if A_induct=1 then clone 1 load to P_pick1# G$ t) u$ @7 f0 p& [6 n( U
else if A_induct=2 then clone 1 load to P_pick2
7 q8 i# c) R3 y$ B5 M% J else clone 1 load to P_pick3
* |+ S4 @6 `2 M G8 Y+ T `* ?end$ N! Y# R8 J' z
( E! L0 e* N7 lbegin P_pick1 arriving- g- v, W1 b2 _
set A_i to 18 w, {* p# `6 z B6 O$ U* f# ^
move into Q_induct16 J* d3 m" k+ b/ X! o1 K2 }
move into pickaisle.induct1! e) x2 { }3 \8 ?
while A_i<=30 do begin4 g( a/ r: C' {& w$ p
travel to pickaisle.con(A_i)
; G& n, _) G9 u5 @" V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 n) U5 h" m8 @6 T else wait for 10 sec" H+ U" K4 i3 f1 X
if A_i=A_leave then send to die5 i, |/ r' I" M
else inc A_i by 1
2 f* i4 D: k! G: M end3 y$ \/ s8 l# t: u6 B
end1 s# q: \$ l8 o4 |& \+ f
" p( }; w1 C. Z( Y( e: Abegin P_pick2 arriving
7 L0 u6 Q( I! f, J' R3 f6 u set A_i to 11 S9 E. b* K, x& x
move into Q_induct2
. w( n8 S; X, m; {0 I3 i move into pickaisle.induct2# f* \, S. U1 H( { V1 T3 K5 p
while A_i<=30 do begin
: T3 g2 u4 I2 ^6 M& {/ U' F travel to pickaisle.con(A_i)! o7 W4 F9 j k6 X) ]) {) y; M
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 D0 A) x3 p* i" k' J else wait for 10 sec
( i# o% g, X# l if A_i=A_leave then send to die
" W( U7 }4 D6 S2 o else inc A_i by 1/ V6 D, x" c! Z% s2 e
end
2 ^$ O+ O$ J f! k! A3 hend
: l" `4 V2 ?6 L& N g: `; j- ~* U
4 Z1 u- I3 @! Ebegin P_pick3 arriving/ n9 j& S! n( z6 `: H: c- D
set A_i to 21) [; w; t" i+ J2 s" E' ~
move into Q_induct3
+ N( p$ W5 s% w+ ^ move into pickaisle.induct3: W6 D9 p% E; X- N3 ]
while A_i<=30 do begin
* W. }% A8 g* w9 A- Z- b! \3 U travel to pickaisle.con(A_i)) P! V7 {: X$ }" Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* ?8 Z2 W; f' V$ D
else wait for 10 sec
) Y6 f, b+ l- O0 r* t0 N6 N: X if A_i=A_leave then send to die+ ?) R; u; o" `5 D) |7 h
else inc A_i by 1
$ U( ^' ^0 O" e( j) ^; L& [ end8 Q T# Y$ b% n+ Q# O
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,其它按你的 ...
|