|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: Y: F9 A/ s1 e/ T9 K7 N) o1 Q M
7 u, o" ^- ?# c* u7 R& }; d我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 i3 ?9 k4 J6 |! w% L
4 D' T5 s/ j. b! z/ V g
begin P_read arriving# A( ]' t/ a9 p1 w" y# o
while 1=1 do begin
' p- R; b9 l, h read A_tote from "data.txt" with delimiter "\n"
' \9 p. n7 X6 l; a read A_time from "data.txt" with delimiter "\n"" F* A) i2 m$ s' l
read A_leave from "data.txt" with delimiter "\n"
_8 H. U0 W4 L/ t# N# r) G read A_picks from "data.txt" with delimiter "\n"
5 F% p' f3 A C9 p1 Q) L- I: M set load type to A_tote
$ G5 u5 G+ {0 {( U if A_tote="tote 1" then set A_induct to 15 Z& Y, x. k9 L5 A$ s, _& x' V' i
else if A_tote="tote 2" then set A_induct to 20 R1 e" M G6 L3 N( r& ~2 ~
else set A_induct to 3
3 ], ~# p+ O; }) ?5 V$ S# G* h' P( f set A_i to 0$ I; a' l) u* F5 h( w4 K c" T. [; M
clone 1 load to P_induction! U1 Y8 O, _; S* X1 P/ ?
wait for A_time sec: a4 _" {. K: u' v7 A W: l8 D
end
0 k O. N: c0 a% T/ fend
1 M5 u9 e9 M0 P) h" |2 I
8 G5 X& @! X6 x3 @begin P_induction arriving
; H x' M, X7 Q9 f6 P! ?; k* M if A_induct=1 then clone 1 load to P_pick16 N& f* ]8 s& _. q1 F; N
else if A_induct=2 then clone 1 load to P_pick2
, f1 |; Y: O. E else clone 1 load to P_pick3: G0 a7 \/ Q" u# K' s
end. P: p s$ c- J( L
q/ A8 K; J; c/ Obegin P_pick1 arriving7 y$ F& [+ {6 {/ d1 B9 Z! H. J
set A_i to 1, d) t9 e& p, J
move into Q_induct13 H, ]! f0 r2 }, N. @
move into pickaisle.induct1" G; t8 }5 J2 J7 u$ e' c
while A_i<=30 do begin
5 Q- O3 U8 o6 k* X1 b% e travel to pickaisle.con(A_i). l, d5 Y3 j- y& f5 K9 v: i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 s' M3 S( a* V# Z$ l0 s else wait for 10 sec' U4 }' X; N) K% M% r2 n
if A_i=A_leave then send to die
- k7 m3 z* M+ r else inc A_i by 16 Z1 |- S/ w% ~ w, ]# l0 z
end& f) K; Q7 \4 G5 w
end* I i% b2 E4 f8 H+ x
1 O+ e6 X4 v2 o4 N' t2 Rbegin P_pick2 arriving! J+ R# o5 W O x/ A
set A_i to 11
3 K3 \5 ]1 M. j2 V move into Q_induct2
% {4 B J$ n# n# y( p, j! J: _6 j move into pickaisle.induct2
9 D6 K! M) |/ I/ L8 i( { while A_i<=30 do begin
$ `* f2 N8 {! J9 \7 L) p travel to pickaisle.con(A_i), a5 o5 u4 q) z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: x6 c; h! k O' ]/ E0 L+ W( V2 U else wait for 10 sec+ \) o& \$ Q. @% q0 w" i8 R# ^
if A_i=A_leave then send to die( ~) S7 S! {! u5 z7 ?1 D9 ` T
else inc A_i by 1
; g/ S& M5 r: {; D- O1 h end. V( [2 C! ^; L( _# |
end/ W" ` S9 i$ X4 m7 ^$ i
0 `4 H+ p: f3 {* X# i l
begin P_pick3 arriving5 J7 y" t- w' D: A
set A_i to 219 M# F5 S5 g" E" U; N9 ~
move into Q_induct3* `4 ~, F; ~8 |1 l# I' w! {+ K
move into pickaisle.induct3
- v( h0 Q5 E7 s0 _ while A_i<=30 do begin' ~3 h2 P8 t! v9 n
travel to pickaisle.con(A_i)# v/ l. F, F. N" |; Y! p
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. R* s f1 s0 e6 ]' @$ {/ c& | else wait for 10 sec
. d$ Z! r, @5 y; ^4 J if A_i=A_leave then send to die- M) P% q: U/ B5 i
else inc A_i by 1
5 q9 Z% z+ Z, Y9 C2 h' p$ `" i, D end
+ o" v. T- k- v4 p/ X/ K' mend |
最佳答案
查看完整内容
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,其它按你的 ...
|