|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! f( ]( K# Z* A' I2 N& c [/ Z5 A
; x. J: Y2 f( B* k3 k' O我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' _0 L* x3 S) p- |0 U+ V2 U* ?6 d, ?( M1 {% h; F8 }" c; v6 B7 X
begin P_read arriving
8 @! d3 ]+ a/ `' f while 1=1 do begin
0 P' U7 s. I/ d: Q3 d read A_tote from "data.txt" with delimiter "\n"
8 _) n/ s8 d4 E" p/ j/ l read A_time from "data.txt" with delimiter "\n"3 s5 N9 b' }" a3 z/ _# F/ I
read A_leave from "data.txt" with delimiter "\n"! s- d0 d: {, o3 V2 o$ j# \7 `
read A_picks from "data.txt" with delimiter "\n"3 `9 A& @8 z0 D# b) \4 k R& ^9 ~
set load type to A_tote
1 N8 R7 Q& J+ {1 F. b if A_tote="tote 1" then set A_induct to 1
9 R7 H7 E# S6 N% {9 _" X; S% Z else if A_tote="tote 2" then set A_induct to 22 O/ R: v* Z0 Z; t( `
else set A_induct to 3
1 i6 C, N: c; ?, a& z, x( n set A_i to 0
; {. y* f2 A- q% d" X+ r. O clone 1 load to P_induction
0 J1 i' I+ R4 K* o wait for A_time sec: l5 N2 |- \: V- }
end
. S* c: `" Q9 N9 Q- ^end" I! P& t+ C3 [4 Q
, q" L, [1 v2 U7 {$ [begin P_induction arriving- p/ ~$ t6 a1 o9 F6 F4 {. Z
if A_induct=1 then clone 1 load to P_pick1
6 N, D5 q; D# s else if A_induct=2 then clone 1 load to P_pick2
! c( L4 ?& c1 _+ x else clone 1 load to P_pick3 h' d- V; P- _+ M M3 a
end
) o- V; |: }) \8 y; f9 j6 P! l+ A7 Z2 A+ n* l
begin P_pick1 arriving
( A- }' x6 q' \6 a9 Q) j set A_i to 1 R" m4 |4 v7 ~) u' A$ U* X8 P
move into Q_induct1
& k9 u" y; d2 O% r! |9 n move into pickaisle.induct1& i: W3 h: U$ \ g- n7 H
while A_i<=30 do begin! T! u% u5 A. m8 e9 S
travel to pickaisle.con(A_i)
% N" q% D( H4 A+ b8 s' V" z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ B6 F' q' F7 F9 D2 {" M9 R3 S
else wait for 10 sec
" B* w+ j' Y- B* `8 H& z# V if A_i=A_leave then send to die6 L& K5 C* S' g* Y
else inc A_i by 1- z7 x5 l$ ]* U G
end8 A" [0 _2 |2 d8 s5 ^# C
end
9 q2 I/ ^ q, t
4 u- n# E, n7 s* A0 F+ n0 y9 M/ _begin P_pick2 arriving
/ T$ Z# x& z3 f; h- O set A_i to 112 {5 B. ]3 \, e2 y) z# e# d
move into Q_induct2. i0 M: `# r/ h$ }: h9 _
move into pickaisle.induct2" F$ \# x6 O( |2 ~. b
while A_i<=30 do begin) i/ D5 s8 T) ]+ ?3 p
travel to pickaisle.con(A_i)
! x0 l2 X0 ?" T/ _ V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( R1 ~% ^# d6 m; P, E! r
else wait for 10 sec
* X$ I: h$ H( Y8 u8 W6 I# v if A_i=A_leave then send to die
1 d. D& } L. @5 X3 R, | else inc A_i by 1' u( o8 ^5 X8 K
end/ N, E+ W! X) J4 D
end
1 v9 D1 K+ G3 f% a4 A- C
; `3 r& `) w( w; s; E" g4 Z0 nbegin P_pick3 arriving
( c* B5 p, _5 b5 R4 a( y2 f% Y set A_i to 21- P& k- \/ ?7 @" S# V6 ~* d
move into Q_induct3
; t9 E$ o5 ^ J. ^0 v$ e7 { move into pickaisle.induct3; E2 l* \$ V. x* E' {: _
while A_i<=30 do begin8 x0 D' l' `/ g2 ?& m6 o
travel to pickaisle.con(A_i)! R* a& L$ ]2 Z2 ~
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( a. y6 c: w% p" T2 B% o! s) k
else wait for 10 sec
& W. p/ R' W+ q( s0 S& P T9 c if A_i=A_leave then send to die
$ G& X1 B1 a! V; X else inc A_i by 1
w7 M: c' [* a5 c. ^% Q* Y9 j3 z+ b end
0 E! X6 z% P( H' b4 rend |
最佳答案
查看完整内容
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,其它按你的 ...
|