|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 t" y7 v: t! v& U* E1 Z$ K( H2 {9 J! b2 I+ H# v% K K
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 W. R4 v8 Q* T. |+ |+ }7 E1 g9 c" p* J, {; a6 H" F
begin P_read arriving
& B: \9 O4 ^" i while 1=1 do begin
" I. M- }( ~' e, v7 } I( Q read A_tote from "data.txt" with delimiter "\n") t& J4 z; X4 R! H
read A_time from "data.txt" with delimiter "\n"0 I ~6 _" Z0 r, ~0 `0 T. B
read A_leave from "data.txt" with delimiter "\n"% M7 c! D7 j9 m3 X) O4 ?" Z4 b
read A_picks from "data.txt" with delimiter "\n"5 W$ }: t9 ]+ y
set load type to A_tote% V2 P+ ]7 B3 I* n
if A_tote="tote 1" then set A_induct to 1) t! `. P- G! F+ Y- x/ I ?' ]
else if A_tote="tote 2" then set A_induct to 2
$ p! F+ p0 z* n1 @1 [# m. q) P else set A_induct to 3 $ x4 c/ ]& C7 ]) i( @# L
set A_i to 0
- o) G- C7 ~; \& Z clone 1 load to P_induction8 U- K' ]0 o" w- H4 l0 v y5 N$ H
wait for A_time sec
F' |1 [0 E1 H/ M7 n end7 {" c2 g# [+ n
end
! V; t9 y& N, P9 I/ h5 h5 t" ]/ v# g: J
begin P_induction arriving. B1 {% w: x$ u& K! o# O
if A_induct=1 then clone 1 load to P_pick12 u2 H% G, ]9 ?$ v9 n
else if A_induct=2 then clone 1 load to P_pick2
w D$ I3 _9 j2 J+ }' ] else clone 1 load to P_pick34 i4 D8 l% N/ K5 F W8 \. a
end2 {" `* f& B; x8 F2 W
2 E" v5 R$ K; @$ r' L8 O5 Xbegin P_pick1 arriving
( k- j; d% b7 C! \' p set A_i to 1. ]( l6 A4 Q! H0 |! o5 H0 a
move into Q_induct1
9 `5 e2 H$ h* k% i* r, ` move into pickaisle.induct1
0 x. l( X! t, [ while A_i<=30 do begin E2 W: y* f- @& r
travel to pickaisle.con(A_i)$ s7 G) l2 g ]5 x$ F; Z/ b- g& W6 y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' ~& f% g" |) A else wait for 10 sec4 x: u: _* o4 Y9 ?4 M) V @8 Q
if A_i=A_leave then send to die0 M8 f5 h# h; l* e, O1 y8 {( I0 O, h
else inc A_i by 1
( l) b+ ~& s8 Y) g( l end
6 k3 B D6 Y( {7 Wend
% b2 ]. @) b, i: l) B9 a
0 M9 ]& |" V! J" s. q0 sbegin P_pick2 arriving
9 y n) o& H# k2 u7 [( x) P. ]1 F set A_i to 11( k: Z) d& D7 p+ O, D. d z. x" n
move into Q_induct23 k8 W, g1 S. }) w9 H% e5 D
move into pickaisle.induct2
, g- ~- h+ m3 [$ H while A_i<=30 do begin* J7 o1 c8 J8 q/ S
travel to pickaisle.con(A_i)& f3 R$ G+ l0 X2 x4 u `8 ~; B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# E) Y/ Y8 u7 u
else wait for 10 sec. q" Y% M$ n1 d! N( o
if A_i=A_leave then send to die; b; R5 Z" G0 i; y8 N
else inc A_i by 1& u& D+ N' N- R! |
end
4 V4 m/ W* \+ _: qend
4 P- N2 m2 m; I! x
7 ?; x( |9 S- L! g4 wbegin P_pick3 arriving
3 a7 V7 _' R+ E% f/ p( y2 Q set A_i to 21
) \9 m ^: S; Z% Z& Q9 H move into Q_induct39 t' R+ T U/ p
move into pickaisle.induct3& h; g4 ~& G6 O: ^& K* ~
while A_i<=30 do begin
1 {" ?% B d& @4 ?$ _. } travel to pickaisle.con(A_i)! T, v0 ]& o3 i9 A3 {8 A6 i/ Y- m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: ]% W' G0 M# Y4 b8 |
else wait for 10 sec& h: [' Z( K4 R/ }, \& {& M
if A_i=A_leave then send to die+ l- z" u# a5 d
else inc A_i by 1
" F/ E. j+ R+ K4 ? end
7 g! U7 _9 N; `; d: m8 ?! q" i1 \2 Vend |
最佳答案
查看完整内容
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,其它按你的 ...
|