|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 ~6 E, q4 K( w& @4 G0 R$ y( y7 C0 V0 m0 P! j
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& o( {) B) |% D& {. D* I' r% q* C! @4 N( k) [: u$ R% r4 \& C1 m
begin P_read arriving
2 J3 M; S" L( l6 U while 1=1 do begin" ~' c; u; m! F+ f! _
read A_tote from "data.txt" with delimiter "\n"
2 U$ r8 C) i, u1 K read A_time from "data.txt" with delimiter "\n"
% D1 {5 g) t3 M) q% D9 j read A_leave from "data.txt" with delimiter "\n"
: @% d6 g% z4 j1 T8 _9 |3 ` read A_picks from "data.txt" with delimiter "\n"$ @! D8 q* I/ ]1 B$ m
set load type to A_tote0 E8 k- A8 U6 V4 @/ n
if A_tote="tote 1" then set A_induct to 1
/ E$ a3 U- | x* A else if A_tote="tote 2" then set A_induct to 2
* D) L3 p, r4 m) C else set A_induct to 3 + g7 O% X2 M1 X4 i% j$ R
set A_i to 0
3 ~" G4 c6 ^* j. H. |) N7 T clone 1 load to P_induction
- {: B! J% ~) q/ k( d" ^ wait for A_time sec
' b; t' b. q0 n! i: G end* q( Z: q# X& V3 ]& i: {& ~2 Y* [( \
end
' c m* J9 o. z1 O3 D: w& L' c% _8 L$ [: s! ^4 K3 B
begin P_induction arriving
. {$ Y9 x' B& w( @ if A_induct=1 then clone 1 load to P_pick1: C6 J( e6 z+ q. ^0 A9 T
else if A_induct=2 then clone 1 load to P_pick2
: v. U: b: i8 x else clone 1 load to P_pick39 e. o1 d4 }( d& E6 |# ?
end
. ^& e0 t y* X: f( Y4 l5 l
+ j1 b1 J- o! s$ wbegin P_pick1 arriving
6 ]- W4 J( n/ c" |5 ` set A_i to 1
! m! D4 J4 W7 w: p( j" g" Q3 z move into Q_induct1 }" E- K8 M& _% Q+ x6 L. ?5 A3 c7 {
move into pickaisle.induct1
z3 p8 p/ M1 ^7 f- d% t% X5 A( Z! R while A_i<=30 do begin
! w" D8 s0 @3 f' ] travel to pickaisle.con(A_i). D& L. O4 F, c# C5 N4 q5 T% c6 Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ ?+ I" y& l& }6 _* g3 z# I
else wait for 10 sec2 h/ V- Y2 k' [( V- B. R+ a+ W: d
if A_i=A_leave then send to die
& w* w4 Q! c( y6 {. V; {& B else inc A_i by 1
3 n* u3 O$ e! V1 f( _# w end
8 T$ L9 W3 C# M, S$ n0 ?end
/ [4 S5 L) z9 w5 h2 ^
/ z0 u' h) W5 |+ [9 N% a S hbegin P_pick2 arriving
# j. V# F* I( w/ }1 D2 b1 Y set A_i to 11
5 \2 c7 S4 v/ N0 C( L b move into Q_induct2
/ y3 y# @4 T7 ], }# y move into pickaisle.induct2
* C( f8 T( [' e$ ?' W! V* } while A_i<=30 do begin: ]' {! ?2 R9 @- d+ [( F
travel to pickaisle.con(A_i)
0 Z+ w7 g, {$ o7 I& [ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 C- r/ x' X* B, e else wait for 10 sec
' u4 q7 E6 N+ g if A_i=A_leave then send to die+ C8 U1 p6 z8 S+ f) A8 H: |9 Z
else inc A_i by 1
( V: d: @" m- o- j. o5 Q end r. ]# [/ v/ q5 H
end
" \% k. Z" \ _/ g0 u9 m: d" u4 l7 O; J0 f3 ?6 r$ {
begin P_pick3 arriving
( w) c! z7 j/ J5 ` set A_i to 21
/ P# u* p5 A K move into Q_induct3
8 m+ H/ Q, H, @% R T4 U3 w3 N0 F1 c move into pickaisle.induct3
0 W- A% m1 u3 B1 V+ q* ~1 B' G while A_i<=30 do begin
% W3 Z! U2 A' Y* { travel to pickaisle.con(A_i)+ w' c' J) C3 k. O, t
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! _: z! q% O7 {+ m8 }
else wait for 10 sec7 w: X. D0 y% N1 s; o
if A_i=A_leave then send to die* ~3 o3 y9 b3 i6 |. n% m
else inc A_i by 1+ g- g0 [ \) H! m+ @
end
; @% f$ i! J# V0 ~7 ?6 C$ B3 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,其它按你的 ...
|