|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" E# M: U; J$ K2 j! m. Q
9 _5 z( k6 G/ P& q% C* m7 T我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 a9 h+ h% t0 S+ x- N7 j8 {* s9 A- Q
begin P_read arriving
- M/ X0 ]% g% u while 1=1 do begin& R. T$ z2 ]: _# C# M9 m4 Q4 U$ n, x% Z
read A_tote from "data.txt" with delimiter "\n"
5 J& y7 N2 N5 i% h read A_time from "data.txt" with delimiter "\n"5 V/ G2 l& i0 B# S# J. P) \: p
read A_leave from "data.txt" with delimiter "\n"
! T* u& t9 A. {* C" p. K) l read A_picks from "data.txt" with delimiter "\n": g0 i9 d" [/ c6 t7 e5 N
set load type to A_tote
* k) q5 b) g7 f if A_tote="tote 1" then set A_induct to 1
% ~1 a8 j6 a5 G! T% { else if A_tote="tote 2" then set A_induct to 2
' w7 f* v! Y; M/ i/ r else set A_induct to 3 4 H1 ^/ i# Q3 h2 t- }$ F3 V
set A_i to 0
7 K9 |& [9 u# | clone 1 load to P_induction
# b2 p% W8 X9 W1 V( x wait for A_time sec
; z( L+ l% n8 [: I8 ~& f" v; B end
, x% N7 {2 L6 n0 Y" Bend7 I' q# K& O' B: n1 f+ c0 j2 }
+ q' i: }1 R# u; cbegin P_induction arriving2 N7 i% L8 \/ Z4 e1 p
if A_induct=1 then clone 1 load to P_pick1
. n: c" ?6 h, a' e% e8 C6 j else if A_induct=2 then clone 1 load to P_pick25 q0 j$ y! P% @3 w. @% `* ^7 y7 V
else clone 1 load to P_pick3( C$ \, N. x1 j L+ z* n
end+ T% g! n4 E8 _7 O
5 y) [/ a: U j$ e% zbegin P_pick1 arriving
0 u2 N+ }: l( z7 G# b set A_i to 1- g$ {8 v" c) M
move into Q_induct1
, R! f7 v9 S+ ^ move into pickaisle.induct1
2 V7 |$ K0 Y$ `: `$ V while A_i<=30 do begin
3 \- ~3 Z+ }( p* V+ I$ A+ p& T travel to pickaisle.con(A_i)4 m5 P$ c, y7 i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ M, u" y% k9 O0 D) P0 f else wait for 10 sec
$ K w5 S2 m$ g- X n if A_i=A_leave then send to die
* x" J7 x% f' N2 S$ d else inc A_i by 1- |( h6 L' D$ h* k
end
) d$ a H* y' Tend
' B H% @9 j# l$ S# ]6 G1 x8 l4 g: d; M8 h) B9 m2 Q4 g" R
begin P_pick2 arriving, L9 m3 T" g( }. v9 L6 a
set A_i to 11
! o0 T; L# u5 r move into Q_induct2
' x) j, q& K; j4 Z+ |4 C$ i8 F move into pickaisle.induct2
5 H; i! X3 B9 e( ?- K while A_i<=30 do begin
s8 ]: a/ W. V' F3 {* ~ travel to pickaisle.con(A_i)3 R8 u+ ~% _, E" ~( g0 O; e' [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- X0 s$ E/ t7 f- E, w+ T. K( b else wait for 10 sec
* F4 ~& b V* l7 h if A_i=A_leave then send to die: A; w, c$ u% B) y9 ]3 H: @) p
else inc A_i by 1
" i7 u( d- Y9 O8 ?2 k1 i3 F end
: J) C5 z5 w6 u# f9 [; }$ x: X7 {) iend! G- y, y0 V4 W) H
5 w B8 S, E f; e0 j8 x
begin P_pick3 arriving
Y7 N- C; d! i# ?. Q* s set A_i to 214 Z7 g, m9 o* G' E
move into Q_induct3& z W6 a ~4 [2 I7 C+ N
move into pickaisle.induct3
$ u" ~! K% [5 m: ]$ S7 u1 v! | ` while A_i<=30 do begin
$ A' B5 _9 _# \% L travel to pickaisle.con(A_i)
6 @; h K6 i% D/ |2 B1 H5 { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, C* |# ^9 L+ C. _ else wait for 10 sec" a+ M! A9 n% N! Z' B
if A_i=A_leave then send to die
6 j" i/ V7 @9 Z" g) |8 _ else inc A_i by 13 g' {: g3 ^6 J
end7 p/ f- a( J0 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,其它按你的 ...
|