|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 w/ c) e2 G' ~/ Q! \
( T: w2 A( M2 m. O' 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中的数值,不知道会不会有什么不妥。
9 S( r- B6 q" B b
% x7 H& x# H* H6 F$ Dbegin P_read arriving
' y: _+ [1 w8 R ^3 u" E+ z3 E while 1=1 do begin' u$ L p! n" c3 i: W
read A_tote from "data.txt" with delimiter "\n"
( q4 S9 w0 V/ B [( \: [" E! d! p read A_time from "data.txt" with delimiter "\n"
! h* X/ m5 y& j/ _9 ` read A_leave from "data.txt" with delimiter "\n"# g( E3 ]: f5 h7 ^$ z
read A_picks from "data.txt" with delimiter "\n"
8 q6 b% J, u( g% _$ g5 Q0 |0 T set load type to A_tote% Z. V7 M P. i. u
if A_tote="tote 1" then set A_induct to 1$ Q7 j$ y3 u/ P4 \0 |0 m4 z/ r
else if A_tote="tote 2" then set A_induct to 2+ j1 A& H2 ^5 Y6 ]3 D3 L4 K& L! @
else set A_induct to 3 , v% B2 X* ~$ C: T5 G3 L- t
set A_i to 0
. u' U$ H J0 k+ {- c1 L clone 1 load to P_induction
. e9 O* t4 b9 I- I! K wait for A_time sec
" J( H- `3 u" W& o/ Z end: E" |" f& e. H6 } m* R' I
end
' \; n1 \0 J- |
$ s1 X) j# j1 O4 O$ |' x6 b& F! V0 Bbegin P_induction arriving
7 D* n( @1 ~* W* I3 u. i if A_induct=1 then clone 1 load to P_pick1
$ f0 @/ D0 i' A else if A_induct=2 then clone 1 load to P_pick2
5 b2 a6 `% J( ^% ]% v8 i4 \ else clone 1 load to P_pick3
6 v2 G' k$ G; d- v1 m! l9 K, Pend
% a6 M: v% S, ^, r% [3 X0 r' e
0 Z' i K. G/ I( Abegin P_pick1 arriving
- ~2 @: c8 g9 A0 R; { l set A_i to 1# R ^% n/ y7 R
move into Q_induct1) C" z0 {! j+ S( H
move into pickaisle.induct1& }* U! H" W5 }/ P. q; N
while A_i<=30 do begin2 G) z6 w2 D5 f. X) o. {
travel to pickaisle.con(A_i)4 r9 u: Q* B. s8 [; B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 \$ T) k3 R+ y# P8 m6 F
else wait for 10 sec, V8 Z$ Y6 u7 K, [ B+ C# L
if A_i=A_leave then send to die
0 E+ Y* K' I2 {0 K else inc A_i by 1: y* Y( ^1 }& m5 G' j! s9 {
end6 S7 ?/ v" s& G* S4 f( L
end
" G$ ^" m1 K' |8 l. c
: L+ a6 w! L8 |3 }begin P_pick2 arriving
8 q, m2 Q \2 j/ D$ D set A_i to 11; {1 _( R( | j' u. ?$ Q& \
move into Q_induct2) ]! t( F$ e7 F P, } g
move into pickaisle.induct2
, e+ X8 j# g# |7 }0 h7 K' M while A_i<=30 do begin
: Q! F J. ?! h! y1 q7 O" T travel to pickaisle.con(A_i)
; a# r0 o% K( F7 I' {: G5 U3 k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ _: F9 Z1 O1 U" L) p. Q, R
else wait for 10 sec% u ?" A/ X$ \" d+ O( u
if A_i=A_leave then send to die1 O) G {* b1 E
else inc A_i by 1
& s% k5 u2 b8 z; q end
M, d! U' j# T7 r* cend
; u! k4 C5 p7 U! j, R0 x0 [( F b+ \
! E0 g# u0 z0 _ m2 K/ W' cbegin P_pick3 arriving
' C6 P. R5 G- N8 u( t& P set A_i to 21+ z# Q$ e K- A. c! l
move into Q_induct3& i+ o$ Y4 ~" f
move into pickaisle.induct3: d) d3 D2 q6 d4 i
while A_i<=30 do begin
' z2 l& b3 t8 z; ~* \ travel to pickaisle.con(A_i)/ c6 S% r) l% g' F
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 F, H1 l, Z0 M4 y7 }4 M# D H/ v+ ~
else wait for 10 sec
* @+ k6 j M. Z, \ if A_i=A_leave then send to die6 |& h! N5 ~( ~# A& O( a! o
else inc A_i by 1$ u$ W7 H8 {# |
end
/ w) ], ^: ?1 {& vend |
最佳答案
查看完整内容
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,其它按你的 ...
|