|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 u' s9 {% R1 {! \ o# Z
* w8 ^" G1 T( ^' z( E3 o+ e3 }我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 L) q, X( h* d
m5 n$ c( H7 P. G! a S5 \begin P_read arriving
" S" K& ~. L4 {9 J) C( t8 E" I# W while 1=1 do begin1 }: Y1 F" _% U" v9 D2 F4 I6 u
read A_tote from "data.txt" with delimiter "\n"
1 q7 }9 V) s6 O$ f; p# a read A_time from "data.txt" with delimiter "\n"
2 z" M. j W8 t read A_leave from "data.txt" with delimiter "\n"
* X: u# `6 m" z" G$ m3 F2 S0 T read A_picks from "data.txt" with delimiter "\n"
# m2 c( M% V$ z0 i set load type to A_tote
+ n4 b, F/ K; y* d! d if A_tote="tote 1" then set A_induct to 1
6 |8 ]/ l7 q# S' } u& a else if A_tote="tote 2" then set A_induct to 2) H8 @. \# P2 [3 k( u/ I
else set A_induct to 3
" |% T! n5 V% G( y) i7 ~0 C set A_i to 0
" \: j3 U0 `( w5 ?( m- y clone 1 load to P_induction" d$ b6 G- O/ o% F3 Y
wait for A_time sec+ h" n# x3 ~; H- J4 ?% H! K M
end E; B5 s6 c6 s" ?
end
* T6 @: f" J6 m% N4 j/ j- b+ ?5 j/ l) H7 D* A
begin P_induction arriving
" u9 V9 @% g5 Q( Y/ W' w if A_induct=1 then clone 1 load to P_pick1
* f7 W. \* k M! `; D else if A_induct=2 then clone 1 load to P_pick2" n2 O; ?! g7 Q4 {+ [
else clone 1 load to P_pick3, x2 J+ V0 ?; I4 p
end
7 T# a& Z% s* _0 L: D& c- k, g2 i5 E2 |) L. m4 k0 g
begin P_pick1 arriving
9 T/ V( R9 k3 B% g set A_i to 1
8 Q4 k7 z! y) ?2 R& q, [ move into Q_induct1* c {( j; y' U' s! }
move into pickaisle.induct1
6 g% B' E3 p, r& @" S* }6 O: A Q while A_i<=30 do begin. K2 }" Q0 y+ k" C4 p. T
travel to pickaisle.con(A_i)
5 b& {! ?' r5 v) e" \" @" B if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) j1 y; H5 {: @2 h else wait for 10 sec
, l# f6 e3 z5 r7 T+ r0 J, r if A_i=A_leave then send to die
7 g8 Z* M5 g V' T, w! U0 _' h else inc A_i by 1
% F4 l1 t0 U. H, f4 l end
2 o! n! u9 x) d8 t2 ?end( S' d0 k+ r9 }$ f3 x7 M0 D
( e0 R* J# B; l! I: H8 ?9 i8 w, K6 Abegin P_pick2 arriving
) V3 J# Y9 c5 b2 T set A_i to 11
+ E' H; K! t) K move into Q_induct2+ K) V- a; |) m( D0 B3 w% E
move into pickaisle.induct2
6 ^# j" s# W B; [* c, | while A_i<=30 do begin
' B w. R3 h, ]- O% b6 M travel to pickaisle.con(A_i)
8 B5 A' T0 T5 p4 g* [1 d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 N! C3 q6 S" j1 A7 |
else wait for 10 sec
; \6 Y( N+ @3 C1 v/ P& ] if A_i=A_leave then send to die
$ h3 q& z/ `1 z4 ?% o else inc A_i by 10 C9 h3 c V* u$ {) y4 Z# n; ]0 d
end
) ?, l, U. b/ c6 ^% |end
! |4 L7 ^# V: g1 U& U9 @' `, b9 x1 J& I+ b; K
begin P_pick3 arriving
- Y/ F+ ]2 J5 @/ O, z* ], @ set A_i to 218 g% N1 I& v5 f6 e
move into Q_induct3. o( M9 n7 ~ P) i+ W; |5 p
move into pickaisle.induct3
/ b; M" J: Y5 y) ? while A_i<=30 do begin
$ D$ R+ h+ A' {8 V travel to pickaisle.con(A_i)
- G% y* z# N- b* b0 v0 _ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ X; d+ s5 A2 {, F. C& K else wait for 10 sec
, p/ X" j, [# A4 L if A_i=A_leave then send to die2 W6 d$ V% U% T2 ^+ o+ Z3 L
else inc A_i by 1+ l- ~% Z8 q! e, n/ x/ [/ ^
end
( B9 W" G- u' ~3 ^: c2 Nend |
最佳答案
查看完整内容
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,其它按你的 ...
|