|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 A1 n3 G) A# q9 T: j8 T
8 u8 i. G0 _% C1 w! g& q( z我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: W1 i. M& W$ @/ `& P( y
( c2 V. {$ G9 R3 U. k2 ?begin P_read arriving% L7 v& n2 ~# B: y9 M5 O
while 1=1 do begin
$ Z. u' ?4 l' S# ]2 C) \ read A_tote from "data.txt" with delimiter "\n"& p1 P' n& t- U( E0 i& e
read A_time from "data.txt" with delimiter "\n"
9 _% a, @6 r! f @1 Q+ } read A_leave from "data.txt" with delimiter "\n"
' p/ j9 H3 I+ G5 |: Y: V/ E% N read A_picks from "data.txt" with delimiter "\n"% I6 Q9 [. V) \) u: \- g) T0 U
set load type to A_tote, ]6 v$ S' U* [' A) v
if A_tote="tote 1" then set A_induct to 1, v2 T+ k% E6 l: [# q+ Z
else if A_tote="tote 2" then set A_induct to 2
: A. c+ H6 W- U" I- }3 A1 p, x else set A_induct to 3 5 R+ V3 `# |' \: V9 r+ n
set A_i to 06 d6 j* E1 T, ^! U% x. M" |
clone 1 load to P_induction
7 c! D A- T, L0 w) {8 E wait for A_time sec
: @& a% p8 m9 g7 Y# @ end
4 ]& v; S y; N! `% q5 b: gend
3 R0 \- j7 }$ B4 }, F
p6 ^$ h* t( c2 e3 R* qbegin P_induction arriving
B4 }$ m' G& M, _ if A_induct=1 then clone 1 load to P_pick1
; `- m" C: ]5 L& l else if A_induct=2 then clone 1 load to P_pick29 d- r4 c( \, N8 t
else clone 1 load to P_pick34 {9 e- s$ E' n$ X/ G' e& w+ T; ?
end
% d& r( l( R5 s0 {3 \0 ~* S
% M: U5 V3 Q: \8 nbegin P_pick1 arriving
S( ^! @ v* i% ]4 Z set A_i to 10 ~- g( ~3 l% ]
move into Q_induct1
3 `2 u8 I* O G P a$ d5 w" Z move into pickaisle.induct1. }& w5 e. H+ h+ U+ x/ b' c
while A_i<=30 do begin
! z# w) h0 x' L. X. } travel to pickaisle.con(A_i)
/ l: q3 q, x( ?, g2 v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& I; O3 C' S7 n4 c% O else wait for 10 sec0 ?2 B' W. d! @$ G8 u1 s% b
if A_i=A_leave then send to die
# B4 f5 t, B8 L @* E else inc A_i by 1
- H7 I! G+ K( z/ _* i ^ end
% H+ c8 s, e- G9 O4 @end4 C3 o7 }6 }# {: G
+ F0 R( |; l% r& |5 l8 F
begin P_pick2 arriving
7 ~1 }1 f# K% g: A3 f) X set A_i to 11
% e ?) b7 {5 S" N0 s$ O3 ^3 X move into Q_induct25 K! P) w0 K, J, S
move into pickaisle.induct2" L8 [$ X& {3 f% l) I' O$ v& q
while A_i<=30 do begin2 c4 j+ o- @$ M2 k* @ Y
travel to pickaisle.con(A_i)) j1 \+ R+ l4 B: f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 @& e( u: @ e5 G else wait for 10 sec1 w/ Z+ B5 W! P% s
if A_i=A_leave then send to die
8 u7 O' F2 u% _& f8 ~ else inc A_i by 17 B1 f- S% S; P/ N. J# c/ ]4 w& n
end& Z8 l. {' M4 P+ z; `+ U
end
( w; Q& o/ e6 ]% S
, ]2 s7 e+ \, M. U0 Ebegin P_pick3 arriving
+ L9 g' _! g7 A% B- @: E b set A_i to 21. R2 ^0 d7 F0 ?) `5 p6 n1 a+ Z7 B. v
move into Q_induct3
2 N% t9 l* Z( r move into pickaisle.induct3; I1 u* X! F/ }! ~" u- ?1 u; q+ b
while A_i<=30 do begin5 d- O; Y4 f; q+ X' p' u
travel to pickaisle.con(A_i)- F4 e) f+ y9 {0 G
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 f+ f6 \; R; U
else wait for 10 sec( J4 E1 u; b4 v7 y6 [) B
if A_i=A_leave then send to die
# }/ W1 n/ E. j* f( C else inc A_i by 1. d: g3 w' o, e: Z8 c* \) \( n
end- Z: _8 ^1 m. Z& u; ~1 r& ^; m7 l( K
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,其它按你的 ...
|