|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 W5 [, g, ^" r3 i* u; K+ L
. Q4 j0 s1 T4 J% f我的问题是,在每个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中的数值,不知道会不会有什么不妥。) M! B( ^, M) h5 r
! ?' c4 }- E v+ j( i9 e9 T
begin P_read arriving% {- E6 `* _" N) O* ?/ W
while 1=1 do begin1 t# h9 n7 f- ^* `7 |
read A_tote from "data.txt" with delimiter "\n"! [- O1 k; |4 z" O+ O, ^
read A_time from "data.txt" with delimiter "\n"4 z" `' t8 o L3 K |, J A
read A_leave from "data.txt" with delimiter "\n"
% m2 h5 v# g5 y5 B3 } read A_picks from "data.txt" with delimiter "\n") L+ ?. \1 G9 D" V7 J2 o
set load type to A_tote' d* B6 L0 L1 R/ C3 l0 H5 C1 d' Y
if A_tote="tote 1" then set A_induct to 1# }) s% g: S+ k
else if A_tote="tote 2" then set A_induct to 2! q- u5 X b1 R. w
else set A_induct to 3
# d3 s8 w2 ]: z, A) r set A_i to 0) d3 v$ a( b# ~# o
clone 1 load to P_induction
) ], D: s0 k; X wait for A_time sec
: ]- F+ d) X% @ k end
v) H* i- _5 x' D3 eend
* m3 b% e3 j' U7 G2 H
2 Q( ^* k( T- S& T8 Z+ @' Ibegin P_induction arriving D8 m$ W! M' a( K1 }
if A_induct=1 then clone 1 load to P_pick1
" M" l$ U: C( Z; B/ q7 C+ L! c+ v else if A_induct=2 then clone 1 load to P_pick22 a9 P# m. F: i4 X* Q5 E0 \6 h
else clone 1 load to P_pick3: p6 Y5 C( r, `$ U' Q
end4 R. n% V! l- o" X: ^7 ]6 j. r
* H: Y- p* T3 J; D* ^; t: n. J' i+ Zbegin P_pick1 arriving
& G) h) {0 @5 ]" o set A_i to 1$ z' _$ K! {6 r1 h3 \9 f
move into Q_induct18 W) ?- Y7 [9 X) L
move into pickaisle.induct1
7 ~% l& k( d4 U# H T# Q while A_i<=30 do begin
& T( ?- G1 t! e5 ^& ~6 ~ travel to pickaisle.con(A_i)
2 X6 f7 C$ ? X- Q+ w! f+ X4 E if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 j+ X0 ?' ~6 K( V4 n Q q) n8 e
else wait for 10 sec
1 J# f# h8 z# I1 T# i, ?( A. N if A_i=A_leave then send to die
! H0 r% C# l. o6 `; f else inc A_i by 1$ c" |5 Z9 J0 d! `1 o5 U
end
/ A& C8 g: h8 T4 M! b' xend
* [# v% n# F% D
1 S5 t' f2 r, ]5 S0 D G2 ]begin P_pick2 arriving
_2 N+ B/ h; D+ k6 ` set A_i to 11
1 j4 Z" [( ^& s6 B. |& x( L move into Q_induct2
) c1 F* b8 w/ S3 _2 d2 _, c move into pickaisle.induct29 Y: s4 B6 s* p' L
while A_i<=30 do begin
; c% O2 x) B: Y$ e, m! `% J travel to pickaisle.con(A_i)
! s0 S- g7 [! S+ L, _/ c* n9 i4 r if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ h1 K" ?- d$ T( h H else wait for 10 sec
& Q$ X# \3 m2 q; S/ i) A+ v2 X6 c if A_i=A_leave then send to die
6 B- ]. C. J6 ?7 [2 ~' b4 s- a else inc A_i by 1
! f s* I9 u+ J/ S$ x end2 C6 p( A% T: f2 L* ]4 n) t
end
6 `. j' v5 U! a- T9 m1 G6 T9 H
begin P_pick3 arriving
% Z) r) `& s1 t S9 x1 ^* v set A_i to 21
& [% z( w# v) a. _8 ] move into Q_induct3
5 P2 ]% a% O2 ]* _) R X# i8 \ move into pickaisle.induct32 F! Z$ c* y7 Y
while A_i<=30 do begin
# A/ x% t- Z E' g! z: o+ i- \7 \8 W travel to pickaisle.con(A_i)1 u$ |" ]- T2 H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: j- `) z# H: ^' s- [% j1 B" i& C
else wait for 10 sec- M! m; ^; e& I8 [" ]
if A_i=A_leave then send to die
+ [# f3 A9 f3 E% M else inc A_i by 1# V, M, i/ s3 _0 V% e
end" ~5 p0 y& @0 u, o, K! C, ~3 u
end |
最佳答案
查看完整内容
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,其它按你的 ...
|