|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 X7 H, M! \; J# w% k/ Y8 `8 ^+ j( r7 v* {
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' K, p" L) c" x8 C7 j" A7 z$ U; R8 S
3 }7 Q! r. s+ o# M" |
begin P_read arriving6 F5 r$ L6 e5 G1 A- u5 _1 Z W
while 1=1 do begin
2 \/ p. o6 Z/ w9 M+ D( r read A_tote from "data.txt" with delimiter "\n"
! b$ j. z0 P: Q' _ read A_time from "data.txt" with delimiter "\n"/ B# ?! ~* T- w4 a5 }
read A_leave from "data.txt" with delimiter "\n"
( Q; U. d/ X0 j% o! S read A_picks from "data.txt" with delimiter "\n"
9 g- u+ ]" G K e8 N+ I set load type to A_tote. B' u" G+ z x3 t
if A_tote="tote 1" then set A_induct to 1$ n2 K' F: Q: T% N) W f0 e9 ]
else if A_tote="tote 2" then set A_induct to 2
; M9 ]2 E1 N3 m O: }' V$ B else set A_induct to 3 # {5 r, J; Y. G# W
set A_i to 0 K% b& @7 Q; p" @
clone 1 load to P_induction* B, A6 Q8 p# S7 o, s$ k5 _
wait for A_time sec
+ K9 ^( C# e5 n4 ` end6 X0 V$ e" W9 x
end
8 R; x0 [& }( F+ P6 p; j4 K; i+ P% U7 ^
begin P_induction arriving- e9 z! z8 s$ \4 i: }1 N7 U
if A_induct=1 then clone 1 load to P_pick1: @) y& W! H+ G- p& V8 A, h5 {
else if A_induct=2 then clone 1 load to P_pick2' Y, @6 X7 T4 K( ?2 j
else clone 1 load to P_pick3
6 D. A9 ]; B2 s6 t! Zend
- }' _6 T+ ~( w) N; q
$ E' [+ m2 x1 O( _$ Gbegin P_pick1 arriving E* V% v, p$ X- r; }: ?
set A_i to 10 c' D$ J+ s7 o, Y, {7 ^3 t
move into Q_induct1
9 y! s( N+ n2 d. {. l% d move into pickaisle.induct11 G& }! M3 z* P7 n, m, C) P
while A_i<=30 do begin( a" G8 h! A8 T k
travel to pickaisle.con(A_i)
" h( o" O: }1 z; P3 K! I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 A3 h2 ?$ n7 j: G" u6 `
else wait for 10 sec
0 O6 f& L9 H3 T3 | if A_i=A_leave then send to die4 s+ H# u f0 P+ X. C3 c0 O
else inc A_i by 1
6 ]* B4 \3 [; K4 Q% c9 v+ G end
) f0 M6 L0 T) y$ m( d. [end
2 W/ x& j4 K7 L7 T) a# v9 ^) L1 e* M3 t) t: d z4 c! R
begin P_pick2 arriving6 ]. L. T: |" G U: m- k6 G
set A_i to 112 C: @+ f: n) x7 o a% s
move into Q_induct2+ o; n3 _8 n" X& t% U
move into pickaisle.induct2. B; l- P" `9 v) [
while A_i<=30 do begin' g/ ^! z( U' t N. b
travel to pickaisle.con(A_i)5 E8 E; N; b% ^ U$ n2 V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 Z0 N& H9 y, ?6 ?4 X
else wait for 10 sec
! H( h% u( v% h' ]4 t7 e h0 z$ [ if A_i=A_leave then send to die& ] m6 R# F V4 L
else inc A_i by 1+ h" S$ ^* T+ _
end: Q: |& B4 |3 B H& z/ ?, I2 F1 p
end
! H0 \ Y) V- j z0 i* H% F+ ~# Q
( M4 p# B; d. Q( M' b# A+ Wbegin P_pick3 arriving
& ]9 e* s5 p" d% Y set A_i to 21; U- p8 G# Z+ {5 O* y d4 N
move into Q_induct3# t; p' G8 U$ v Y4 S- R
move into pickaisle.induct35 ~* n0 g( E- G6 ^5 x
while A_i<=30 do begin
1 M/ m% }+ l9 | travel to pickaisle.con(A_i)
8 I0 f5 t% K3 G3 F5 }9 e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' v0 p& @4 b" Z: P7 ~ else wait for 10 sec
( ?3 c: o- O, ]9 [4 Z$ T) L" S/ f if A_i=A_leave then send to die$ _2 e: ^+ y2 K1 j: y5 p
else inc A_i by 1+ `0 u0 k# N& X/ b1 Y9 c
end
i$ `. G' y" 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,其它按你的 ...
|