|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. y8 [3 J7 M4 D6 W; [/ `% q! A
9 ~1 J% O' H' [+ e% y我的问题是,在每个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中的数值,不知道会不会有什么不妥。, `: C0 A9 r- x9 T! b' ?
# p- S8 m% W: ~ [7 G0 Ybegin P_read arriving6 X) Q9 p: U. `" q, d
while 1=1 do begin
( {8 M, v# L# @8 L" _+ i read A_tote from "data.txt" with delimiter "\n"
4 b: `' X& @6 I8 I4 B* H* ^5 w$ J# Z read A_time from "data.txt" with delimiter "\n"
. C; L/ t3 J# T6 C( O6 E read A_leave from "data.txt" with delimiter "\n"
6 @6 \% e( ~( o( D6 I8 Z* e read A_picks from "data.txt" with delimiter "\n"
) `! \! q. g T( N! q) _; d' [0 H set load type to A_tote) ^9 G/ ?& ~: E) T
if A_tote="tote 1" then set A_induct to 1
" E0 Q2 h% z$ z0 S else if A_tote="tote 2" then set A_induct to 2
- I6 W: \/ `2 L* x else set A_induct to 3 4 i W: I; o! Z
set A_i to 0
: W$ g! v7 a( s1 O1 k0 z clone 1 load to P_induction) F( L5 W' D: I) b, {& g; K! |9 |* G
wait for A_time sec
7 p$ g$ |/ g2 Z! F end
; S; I, O5 _5 y+ \; aend6 `, g$ r* }# x( p& t) l
( I5 i& j& k& ~8 r/ G, I1 }) k0 Kbegin P_induction arriving
% s# Z2 L4 F& K% c/ w# }# {5 f' y" O if A_induct=1 then clone 1 load to P_pick15 j1 M9 z$ [- y% ^) `* ^9 w4 Q
else if A_induct=2 then clone 1 load to P_pick2
" Y: ?1 I5 m& i. `& a" M( k" V else clone 1 load to P_pick3
( u9 @ Q# ?9 E- C1 bend p; K x' z9 q7 i
& E; r1 H$ q8 ~
begin P_pick1 arriving( w0 l9 n4 u4 _5 T
set A_i to 1
+ Y, }% R5 K9 S/ S3 z& ? move into Q_induct10 `% `% t M7 n8 S H
move into pickaisle.induct1
$ d' e( I( H9 j* Q1 d% Q! m% | while A_i<=30 do begin
& p+ b# c% D U; o6 d/ { travel to pickaisle.con(A_i)
5 I0 H% |+ z; E! {: N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* c$ N0 x: ?8 | else wait for 10 sec% H, c* C: h; ^3 ?0 v; }
if A_i=A_leave then send to die
+ h; z2 b+ G* j else inc A_i by 1
! Y9 P# h; T5 {. [0 I6 J end
+ g) e2 r' ]; b% o3 E0 W7 W* Y, Jend
( w* W8 W, g; ^ ]) b5 M- @
7 \0 C; S5 X( r* G1 lbegin P_pick2 arriving4 g7 a" W, y5 [; P
set A_i to 11
/ L6 G: \# ?. U& r# W6 W% h3 ] G move into Q_induct2
1 U0 g9 Y b7 _& E; g* d0 f" j move into pickaisle.induct29 n& P0 u. s4 I. ^' R: t* B
while A_i<=30 do begin
; d/ C# K0 e/ S4 s! ~) i travel to pickaisle.con(A_i)
. ~/ Y$ M9 u9 b% @/ m8 S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" G# e, o Q" X) F! V1 M else wait for 10 sec; S: Y1 t" E9 G2 G+ s6 e5 t- V
if A_i=A_leave then send to die
% r0 }) _7 C& j, I; M6 } else inc A_i by 1
! l7 o7 |' |4 t. b end- m7 u$ |! ~9 _7 Y# o8 A5 p
end
! L- z0 A9 L6 s- j! F. i* x! s ^% q
begin P_pick3 arriving4 H$ b& V6 P: Q
set A_i to 21
- z( @2 D9 m% j8 S* x2 e move into Q_induct3- p+ t$ S! C+ H! v8 ?
move into pickaisle.induct3
% I1 s( J( C. S' P while A_i<=30 do begin
7 V" U& _) Q6 ^. q4 h travel to pickaisle.con(A_i)
( H; A/ I7 B0 A" u; l if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 I; A5 Y) ?- @9 d$ V else wait for 10 sec
, K* q! Q$ }+ J2 L3 b; U if A_i=A_leave then send to die0 k3 t7 F4 v' O" p o
else inc A_i by 16 c0 s' l t1 V$ u( d
end
& A" J, ~3 b5 D9 E8 j- y# dend |
最佳答案
查看完整内容
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,其它按你的 ...
|