|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! J' h3 ^5 W/ J* S
( b$ C$ I* s) m5 r( ^0 Y' _# U我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: q/ d+ r0 Z) M3 O- ?" H) x# l1 t1 x5 K/ C( X
begin P_read arriving
0 f0 C# K! |$ i( K" Q while 1=1 do begin3 ~8 `" ?$ i; D/ S
read A_tote from "data.txt" with delimiter "\n"; E4 m+ F2 w/ ^' j+ l$ J
read A_time from "data.txt" with delimiter "\n"
- D6 f" i2 n3 X' k read A_leave from "data.txt" with delimiter "\n"
( l3 V+ \6 D; v1 S" A read A_picks from "data.txt" with delimiter "\n"
0 k5 h3 G: ^- ~) C set load type to A_tote
5 U; v2 W; {( d if A_tote="tote 1" then set A_induct to 16 E* d" ]7 u- S0 H3 ?# J
else if A_tote="tote 2" then set A_induct to 21 T w. @2 @8 f3 ]+ @6 [
else set A_induct to 3
1 W# [8 ?8 ^3 O2 J, \ set A_i to 0
! e4 I( g/ V: e& u clone 1 load to P_induction4 ^# d2 i q( n4 J3 I7 A
wait for A_time sec3 j9 J* [; V6 O4 i* A
end
+ p% y/ }& A& m: O4 Z3 t3 jend) @( C4 f+ Z/ G$ b* y4 d! n% O) w
) r" e F& h4 C& I
begin P_induction arriving) @4 O0 u0 ` g9 N- Y5 @7 x& e' W
if A_induct=1 then clone 1 load to P_pick1( m6 R, B6 U: F# V
else if A_induct=2 then clone 1 load to P_pick2% m: k* V* C% u7 ?0 V$ h
else clone 1 load to P_pick33 p' S2 r7 p! }) ~! ^; ~8 Y' j% a
end
9 K* |$ ~9 q, F5 h# l; ?0 \& ?& G: ?6 u
begin P_pick1 arriving) [% b) l$ {9 ]) |
set A_i to 1
; E8 \& _5 g! f' E; t J1 {; n% x move into Q_induct1; M9 B; j' p3 D: m) W
move into pickaisle.induct1& M% Q. R0 t7 I! h1 o# d
while A_i<=30 do begin
& C5 j( v! S! a travel to pickaisle.con(A_i)
% `: _2 `1 R5 g+ x% k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ [7 h: O0 x5 {( V
else wait for 10 sec! U0 G# }0 s/ ~. s1 K( \# D
if A_i=A_leave then send to die
- h- ?8 @/ z; A @ else inc A_i by 1$ ~. g; Z. N, s8 j! v4 G+ U
end
- X3 V. n; h. r- U5 L; A! `% v2 i" Aend7 ?# A9 o* K$ s8 y m; S; @
3 K6 m1 Q& Z- _8 j5 ^begin P_pick2 arriving/ M4 [) n; e+ d: s2 y E) G9 D, m
set A_i to 11
: v; {" ]# U2 E% o9 S9 S& A2 V( s move into Q_induct21 W5 }: L$ @- b+ a7 i& O
move into pickaisle.induct2
: i# z2 f/ t: Q/ T! V# z& q while A_i<=30 do begin
w$ Z7 s/ T# T" V9 Y+ J3 I travel to pickaisle.con(A_i), | R# `! j( j8 S' Q) P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 o4 \( Q k! w( z ?
else wait for 10 sec
; l1 [/ W* K( P! p, U/ D: q4 f1 ] if A_i=A_leave then send to die$ K& j+ l( b( v- m5 S' m; C
else inc A_i by 1
# G1 }0 d) m I0 B3 R6 K2 x end
2 m b/ B* _, v3 I/ @& ]) Iend
2 v% L3 w- Q8 B6 z: B! \
7 c. }- w; B8 T' b6 C1 n& q1 rbegin P_pick3 arriving
, C% n) v7 w) i0 Z7 u6 k set A_i to 21& C/ U9 O* Z0 O8 ?7 q9 E
move into Q_induct3' x2 W3 q' @/ y1 L/ X, W
move into pickaisle.induct3
9 S& c, d/ a1 l/ h5 |! R while A_i<=30 do begin
: N; I# l# g" \# J$ W r( ` travel to pickaisle.con(A_i)4 t$ x; F" P+ Y! x: ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
T5 A. i9 G1 U) H7 V- E5 C0 T else wait for 10 sec
+ G3 m& ?! {* s: h- z if A_i=A_leave then send to die& A) d( Q! S+ I+ u5 u0 s) V$ O
else inc A_i by 1
& |# K, o& Y2 K( O# I. ~ end2 x( y. n# \3 S W$ n
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,其它按你的 ...
|