|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, X) C, ^0 k2 F' m* \
: K( @( ^$ Q1 D4 O' X& O0 I我的问题是,在每个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中的数值,不知道会不会有什么不妥。; G# H5 ^" C( [3 }3 k5 W
: u- @0 n( L' u1 Z- ibegin P_read arriving
3 \7 `: J4 i) b, A, C' M while 1=1 do begin
- f, Y. Y1 h' u8 O7 K read A_tote from "data.txt" with delimiter "\n"
7 D( `! I6 j1 n5 [' E8 B6 t" i- i read A_time from "data.txt" with delimiter "\n"+ B/ y$ R: X1 w, N
read A_leave from "data.txt" with delimiter "\n"0 y( E( [% ^, |1 h4 y' ?
read A_picks from "data.txt" with delimiter "\n"! s- K( y) ?" b7 c/ \, [
set load type to A_tote8 k$ g+ U! h; K1 l
if A_tote="tote 1" then set A_induct to 1. n+ W/ M# s' N3 c/ Q4 ^2 f8 ?" _- K
else if A_tote="tote 2" then set A_induct to 29 p3 H9 l; j/ p6 R4 w$ V
else set A_induct to 3
* M# k) q# e# N7 I! Q set A_i to 0
4 z7 Q! P; z" @4 l3 ~3 b' ` clone 1 load to P_induction
0 j- Y P( R# a& D2 U8 ] wait for A_time sec
3 c r4 v3 ~5 {! w0 ~ end3 G! u. A& d( ~, z6 t- J; F' J
end
* W }7 ^% K7 w3 B8 X5 a7 u9 G \8 F* T
begin P_induction arriving- a1 E2 o. U$ y8 [# Z2 k
if A_induct=1 then clone 1 load to P_pick12 \: T+ f5 O. j; `) U6 w3 {
else if A_induct=2 then clone 1 load to P_pick2/ P- a, v/ Z( O" Q) _
else clone 1 load to P_pick32 b! e* r& t$ ^3 D- Z: c# Y
end
8 b, B& F$ ?" k: o# }
0 ]6 F- v' ^8 a+ r Y5 s- mbegin P_pick1 arriving! t) H3 N9 C- x8 X6 @
set A_i to 1& C* d5 o% {( s
move into Q_induct1! S) f" V$ J" ^6 {) v
move into pickaisle.induct1
; |% Z; x8 C0 V2 | while A_i<=30 do begin4 a* J8 J4 Q0 u1 D# n
travel to pickaisle.con(A_i)7 j. d) t7 ~3 U% L9 W4 P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, {/ V, s- @) ^, H: |8 s else wait for 10 sec' ]0 O/ F; l- Z2 S; Y5 Z/ _$ f
if A_i=A_leave then send to die
* L' ^6 _9 x& L; t# [4 {. } else inc A_i by 1
0 W3 k8 V, g7 g4 C end
+ h4 N; p1 O9 s( R! o8 l& \2 ?- |8 Wend# N, ?6 r2 h, H) P
! |4 |6 G) c5 c$ d# G* |, wbegin P_pick2 arriving
' n6 W8 O2 I( I& I9 I, L9 Y set A_i to 11
3 d9 p; K& W- }- f- h5 Z* ^% i move into Q_induct2
3 B5 |' s* ~8 W; B move into pickaisle.induct2
# w4 g0 Z# ~: v4 E while A_i<=30 do begin
$ h+ E9 V3 L" p6 L5 O7 b travel to pickaisle.con(A_i)4 N7 I9 L' l; t) ?: }
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 R- Q/ e3 j7 X else wait for 10 sec
/ m, p! t5 B" r _, H+ j if A_i=A_leave then send to die
# N8 m7 q& x4 K5 {" m0 Z1 ^ else inc A_i by 16 y' e. E3 ?1 J t- v/ F2 M4 j
end
2 G6 S+ w t. w; R4 u+ A( ^! zend
- H6 o# d/ o' R! G4 w: x% ^! h& Q+ V" |# X' x( k* \
begin P_pick3 arriving
1 B% k% R; S+ K+ Z- j7 j set A_i to 21
9 }$ X$ J D- V2 L7 N' j move into Q_induct3; H5 }& s1 w1 K6 ~
move into pickaisle.induct3
2 i% U! [3 |3 P+ G- |; N2 Q: ^ while A_i<=30 do begin" ^$ m, I) W2 ?% X3 [" h
travel to pickaisle.con(A_i)1 ^2 ~3 P% r( K2 x- t2 Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& _6 H! ^$ g1 y) M else wait for 10 sec
8 D5 b% k: T. w/ Q2 f+ s+ b if A_i=A_leave then send to die
! I) t2 e3 w0 s else inc A_i by 1
# I# G/ _# W0 ?, x/ Y, G end
) }8 p9 D3 q; wend |
最佳答案
查看完整内容
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,其它按你的 ...
|