|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% K; S/ n9 F6 C, y' j' N
7 \6 _$ T9 ~1 }7 M9 C! W) R我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: b, n3 J) H) C( |
7 A! ~4 u3 Q2 o1 `* Obegin P_read arriving
1 l9 W5 i3 g5 B& v while 1=1 do begin
: z5 B' n; f$ _& @( E) r read A_tote from "data.txt" with delimiter "\n"
* S6 p3 w! N }+ d read A_time from "data.txt" with delimiter "\n"$ a; E7 x& ?0 n) k
read A_leave from "data.txt" with delimiter "\n"+ s- S2 l; H% G# K4 J( E* X$ [5 Y- P
read A_picks from "data.txt" with delimiter "\n"
( p b9 y5 T1 ^# ^- l% t( h# R set load type to A_tote5 T% ~' h6 M# S- f, s$ i8 v
if A_tote="tote 1" then set A_induct to 1
6 ^! W1 J9 n2 Q+ R) @, Z( U4 p else if A_tote="tote 2" then set A_induct to 2
' G# n& G+ x( h9 { else set A_induct to 3 - p! c) p) B- D, z8 ?% z4 p/ x* l
set A_i to 0
! [1 h: y* w6 i clone 1 load to P_induction# b' P6 H* `( P6 V+ k- D/ r3 M3 _5 X
wait for A_time sec& ]5 ^2 K0 R7 j- {8 D3 N7 R5 ~) ^
end* ?7 I6 ?/ K4 L9 I5 o3 S
end$ ~, j: G& Y1 O0 |0 r& b& E/ ?
4 p4 Q" O- i m$ ]begin P_induction arriving/ n; {) [. a; F( Y: L
if A_induct=1 then clone 1 load to P_pick1
8 c2 ^- T. Z6 _0 v" J$ Q else if A_induct=2 then clone 1 load to P_pick2
( H) G& Y! M2 D else clone 1 load to P_pick3
, G& ?4 p8 O/ U2 eend# w# ?) x3 N) Z& ~
3 }- e q4 Z$ `
begin P_pick1 arriving
# M( o6 _1 j+ e4 W4 V# L set A_i to 1/ R% J7 M$ @" R' s: c; `' ^* Y/ M+ m
move into Q_induct1( V! E# G3 m$ D. o5 f
move into pickaisle.induct1; e' J- N0 V! F5 l
while A_i<=30 do begin
% @" m, C0 D6 {. b7 T8 m travel to pickaisle.con(A_i)
- d) p1 a2 u h# I9 w5 a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# `1 t; d+ F- a else wait for 10 sec
5 s3 Q; J$ v7 l$ I6 ~ if A_i=A_leave then send to die6 O4 L; a$ C+ Q. f- ?+ h
else inc A_i by 1# D4 D7 N) U# |% \
end
* i: D% Z. S. Dend
/ X) V6 f: q$ \) ~7 f8 `; _9 ^) k L3 T8 o- O2 w7 A# U8 h
begin P_pick2 arriving, k0 u2 U; q( H% w! b$ |; s: o* t
set A_i to 11% r/ M- Z, C* L
move into Q_induct2
" N, Z& G" v* ^ move into pickaisle.induct2+ s* P# {2 }/ W) X- {! [) F
while A_i<=30 do begin$ Y. p% [ s; Y/ Y5 d# f; C5 D$ a+ ~
travel to pickaisle.con(A_i)
' \1 z _& c. u0 Z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 a& F8 i: D7 v1 l else wait for 10 sec- }9 o: {, Z3 E1 d. v
if A_i=A_leave then send to die! m! M g/ m& F" ~+ `5 |0 w4 X
else inc A_i by 1- j" F/ `8 {: J$ ?6 G' U$ {
end. m0 I0 N8 r$ i' Q6 u5 V% @: C9 L
end7 R8 h4 H" L0 D' y/ n
# x0 L/ v% }; ]2 b; ?% Wbegin P_pick3 arriving
6 F# e; s0 H* ~) ` set A_i to 21
4 T9 e. c" B! s; s3 G& _6 A move into Q_induct3
! M2 u9 L: j9 ]( Z4 S7 C move into pickaisle.induct3$ g7 n" m0 U3 h( O4 L* _! ^$ F
while A_i<=30 do begin! \: M9 }" G+ s
travel to pickaisle.con(A_i)- J4 c+ p+ j0 f9 T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 j4 |' C: }* s4 z* K else wait for 10 sec. `* ^" H6 a: u) ?- h6 r7 `4 `
if A_i=A_leave then send to die
& @" G! m6 j3 @: \3 g2 h else inc A_i by 1
% G0 |5 J1 M/ h end& l1 x7 f9 d' h$ R* Q2 C7 N
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,其它按你的 ...
|