|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- c) K, q9 L! E. Q: H# ?8 x
$ j, W. `( T+ C/ }# d5 C: c. L我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 N6 ~" n6 n0 j$ r- `, F3 M6 C2 Q I# M! h/ W3 t
begin P_read arriving2 b8 m" c- v. I, C R% G* k" H+ z
while 1=1 do begin0 o( P7 d! Z$ s b0 A- Q
read A_tote from "data.txt" with delimiter "\n"
; ?5 ~+ v% }0 P7 w3 O. r read A_time from "data.txt" with delimiter "\n"
: j5 T0 `+ G) n( m! h/ D, H read A_leave from "data.txt" with delimiter "\n" F9 o3 g6 }3 s" u2 B
read A_picks from "data.txt" with delimiter "\n"
1 g8 L: d$ T w4 o6 B set load type to A_tote
1 ?- W$ j+ T6 }) q1 Q+ c) Q if A_tote="tote 1" then set A_induct to 11 r8 D1 \) _- i0 g
else if A_tote="tote 2" then set A_induct to 2' O5 y8 `& Z1 G' U
else set A_induct to 3 3 W; n2 s+ I9 V l* A
set A_i to 0& y! U; c$ K+ o1 s
clone 1 load to P_induction
- I% y; u. j7 ` wait for A_time sec
: c* r$ ]/ ^3 ` end) E+ o( Y, n1 z6 C
end
3 x; _; @* H: m. S
4 t! Q3 U7 O: A* p( ~) @9 j) f- ebegin P_induction arriving" L+ r* t" d$ p9 Z
if A_induct=1 then clone 1 load to P_pick15 r- X+ v( o6 r0 U% Y
else if A_induct=2 then clone 1 load to P_pick2! c2 f7 K# |$ ^: Q
else clone 1 load to P_pick3
% N& H0 x, p7 o) R. q; t/ Q; rend& W5 U$ i' Q- f) C$ x
# I! Z& H& ^9 q: P% M
begin P_pick1 arriving% |- [' P- [! r$ }6 O( q. H
set A_i to 1
- y: x* l3 u5 ~! t( d6 p move into Q_induct1% B1 p; k/ S' u2 {
move into pickaisle.induct1
' x, e7 i8 R; {. l, y while A_i<=30 do begin5 _) r3 B% `( f% J+ i& z$ M
travel to pickaisle.con(A_i)
% q% h6 p% i4 H' g. Q' v7 q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% ?5 y2 e6 ]( f/ L, p9 Z
else wait for 10 sec2 w) D# p5 t( p5 r
if A_i=A_leave then send to die' u; T3 h7 b% p5 m3 v. q: Q* O
else inc A_i by 11 P0 L$ j/ z' T z7 P( V
end
) \0 E) z8 {7 U: A0 ]end
! J2 P, C7 K& G% J( G: [% P3 \3 p6 B2 ^! l: M/ g" Y$ ?
begin P_pick2 arriving/ H6 b; M9 v% P+ s7 e" H* o* @' N
set A_i to 11* b8 y. P4 s) T
move into Q_induct2, F! N$ g0 [3 F c: B( U5 F# ~
move into pickaisle.induct2* M% A" [, j9 h/ r
while A_i<=30 do begin
1 F$ K& b: d h! O9 n" s: G travel to pickaisle.con(A_i)5 y# e. m- u J+ e/ z9 G+ u
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% a- K$ N! Y! _2 n+ ?( s else wait for 10 sec, @+ Y: v, m, u4 t
if A_i=A_leave then send to die6 I4 ?5 M/ Y6 c; U- E
else inc A_i by 1
, R: ~* N0 j1 O6 n1 Z/ X* Y1 c; d end
( o% i: n# ^' z# v8 B$ w# D( Fend
4 y5 D% K. r( a: a% S7 j3 @' k' o+ Z H. \: A6 C- \
begin P_pick3 arriving P# C% d4 P" u% g
set A_i to 21
# _' C3 L, s2 l# R move into Q_induct3* c( ^1 _$ c0 ~, X8 z! V
move into pickaisle.induct3
% }5 j! @- k7 z5 R while A_i<=30 do begin
) w( W( ?! G( d6 l0 C4 t, h travel to pickaisle.con(A_i)
3 j3 q) J2 i8 [ O# R0 V$ u if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 m1 w$ H/ P; i( s9 m
else wait for 10 sec3 g' q c/ B. o+ s$ d" j/ R
if A_i=A_leave then send to die
- J2 ], u# G) j! t. @- h else inc A_i by 1
4 w5 U* e5 z* `( ]6 W end
! ?) c; y. R6 z# Kend |
最佳答案
查看完整内容
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,其它按你的 ...
|