|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& P' E# _% l7 j! z! X0 v
5 a* V7 N* u/ T; n! z% y; g我的问题是,在每个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中的数值,不知道会不会有什么不妥。" j! g, f2 r& n* F- |
0 d+ N" I# v# K+ ?begin P_read arriving1 Q m b5 W1 ] K7 ^
while 1=1 do begin
+ [ m. P# d# M! ]; J+ W* e read A_tote from "data.txt" with delimiter "\n"
s( {4 s; M/ h& W* X8 l read A_time from "data.txt" with delimiter "\n"
. M/ u( B- X7 D8 B9 b- P read A_leave from "data.txt" with delimiter "\n"
0 ~1 a S0 K. w% R7 k read A_picks from "data.txt" with delimiter "\n"2 N7 k% A" P; C' o: `& _5 ^) _% G
set load type to A_tote% e* h9 }) H6 P. q$ {; @0 g
if A_tote="tote 1" then set A_induct to 1
! H$ w# W k7 b2 m9 y g else if A_tote="tote 2" then set A_induct to 26 V3 R% B' p% |, q) p; R2 ^" a
else set A_induct to 3 + n. o1 F+ q( {7 _
set A_i to 0% s e3 I: E# F: Z I7 w8 b3 @
clone 1 load to P_induction2 S7 _ E- J3 f4 S7 [, T6 D6 g
wait for A_time sec
. U0 N9 r" W3 G) L W8 n! W end
( m) d F' ^" W, D l* }end
+ w+ _, o5 k$ T2 x
' M- V" ?' @) g# n! b# ubegin P_induction arriving
6 }; P1 d/ g. Y8 H if A_induct=1 then clone 1 load to P_pick1$ R7 E' G( X" t+ U1 n
else if A_induct=2 then clone 1 load to P_pick25 q( @$ ^4 s+ Q2 V, u* f, `3 V4 f
else clone 1 load to P_pick3; x1 x1 H3 R: O9 K4 T( u
end
`. _: `: l5 I3 [7 p6 @. s0 T
4 W" |7 A5 N# d$ E7 B, J; Ibegin P_pick1 arriving5 {. u( s: e, H% D7 H
set A_i to 1; o, h; f7 v n+ v, o: Z V1 G9 a; \: |
move into Q_induct1. I# Z; \: C$ z4 _& T
move into pickaisle.induct1
- H# D7 e8 V$ l8 e' X, Z while A_i<=30 do begin
! l1 u7 M9 y( N$ w9 J5 i0 [& Y5 c travel to pickaisle.con(A_i)
4 J% Q& d/ G! o3 t' X8 s if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ m* O) O$ {9 Z1 {8 F2 q _: u1 p- a else wait for 10 sec
" _3 ^! [0 D2 a. y if A_i=A_leave then send to die
1 R5 G' I" |8 y% d# j0 h [9 K1 z2 J else inc A_i by 1
- m3 U! _# \$ g3 L6 X) F/ z! E end, W! V8 v- o& l' g6 ?* h- j* y
end
! i( q, B- P$ d+ s1 m: f1 @3 W6 R$ _" l. r
begin P_pick2 arriving
9 V& r/ L1 m/ M, P$ U- d: F set A_i to 11
6 f( X" n7 V: n Z5 T$ C move into Q_induct2$ t6 R$ ^% g" e: `9 \4 x
move into pickaisle.induct25 E5 Q3 B3 D3 L. A% `
while A_i<=30 do begin" ~. M5 j. G0 _- D3 P3 l
travel to pickaisle.con(A_i)
7 D; S1 r0 X, g% O6 k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
Z5 d+ j1 Z! E O else wait for 10 sec& i8 P# q- i3 f3 R; a5 i
if A_i=A_leave then send to die% n) g4 @- U. ?# S- Z, X
else inc A_i by 17 ?( a3 V* p5 z7 B* Z( ~
end; `' A9 _" ?" w' t+ g' y
end
+ ]9 o6 e9 @, R `/ g$ J& j# E) T1 V. Z8 x. F8 k; I; b
begin P_pick3 arriving
4 Y# [; ]3 r' \ set A_i to 21
8 A( F; t% k3 w2 A4 j" @9 ^! g# D( D move into Q_induct3
2 Z( t8 Z6 E( Q1 \. w" |8 c1 f/ u1 n" y. Z move into pickaisle.induct3
! [1 f' t- I' u j* R while A_i<=30 do begin
. t( n6 S9 S @4 L7 R# \3 m" G5 K travel to pickaisle.con(A_i)
/ k) s3 O7 g' ]4 ~9 J7 P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 X3 C6 N/ b! Q6 z' Q2 R else wait for 10 sec7 D* d& C [ l( n
if A_i=A_leave then send to die
: }# s+ d4 r' V/ l% }/ p# {# Q else inc A_i by 1
; _9 {; ?- G% Z7 K end
9 O! w' d2 _' ? xend |
最佳答案
查看完整内容
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,其它按你的 ...
|