|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 T. {- E2 m0 i* W& V1 C& q
1 c) \- O! A% g( v. t$ I
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. F+ [7 H, |6 w' f5 ]2 f" y( n' I' p/ h
begin P_read arriving3 N: @7 ?7 R1 y4 E
while 1=1 do begin- v0 s2 F) B4 S- r) H3 H
read A_tote from "data.txt" with delimiter "\n"5 z! `: \& v; d& U/ f
read A_time from "data.txt" with delimiter "\n"+ s1 Z/ \& |; o- i, T3 F, W
read A_leave from "data.txt" with delimiter "\n"
7 H- {! q+ E/ H9 }5 O read A_picks from "data.txt" with delimiter "\n"
# i' g' u. C1 d; K7 Z set load type to A_tote8 J0 ~$ _4 w' \9 g. j3 L- @7 u8 G: O
if A_tote="tote 1" then set A_induct to 18 W8 X2 S' R: M4 y
else if A_tote="tote 2" then set A_induct to 2$ B p3 G4 P* w0 g+ X5 G
else set A_induct to 3
F8 Y) z# c; X6 ~7 n set A_i to 0& _0 S3 _9 A0 b6 n8 m3 Z; l
clone 1 load to P_induction! e& |. u3 V m8 }" W0 J
wait for A_time sec/ Y9 O' @- ?1 a- E
end" U5 H: i2 y; g/ L. H) P. r
end
1 n6 b# T$ N/ [; o4 g# @" `8 W3 {1 h6 B) o3 f6 ?. f) e; n8 V+ p
begin P_induction arriving) l' w/ G+ i) k, I& S3 F/ @
if A_induct=1 then clone 1 load to P_pick1* x0 w' O9 H% K. A# o( X! Q
else if A_induct=2 then clone 1 load to P_pick2
J7 P) q. t6 B8 i else clone 1 load to P_pick3( P q5 p& g( ]7 @! x3 N7 j
end( ?3 n H6 \- c. {
% b5 P3 K1 f0 X
begin P_pick1 arriving K5 M7 s( l* O, m# c0 b
set A_i to 1
1 W+ s. k6 h! }6 U" C9 h5 T A move into Q_induct1
, s* [% S) e& b7 } F move into pickaisle.induct1+ o& }+ j5 Z& [- u6 n
while A_i<=30 do begin' U! {5 ]" w& N
travel to pickaisle.con(A_i)
) g$ ^* p& U$ n% I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 z9 K+ n5 K3 W* `! v' U else wait for 10 sec# `% Q2 X- J* _$ b* b9 }
if A_i=A_leave then send to die1 I$ K$ a4 j- Y3 O5 ~! w2 A& _
else inc A_i by 1
& f* O. K, L3 K end
" K1 \1 d9 h9 V4 F J: s nend
+ i2 r, W" W+ _) f( _) R* n6 q2 S9 t$ d ]5 I% q. { b/ Z
begin P_pick2 arriving
0 O& H4 {. V+ D; v' P! U set A_i to 11
; K* Y* K$ Y% s* K/ y6 {: N move into Q_induct2% v, ?; [% m- _' J* y
move into pickaisle.induct2$ V5 a1 q& t) V2 U+ q3 x
while A_i<=30 do begin# C |- U! \, \, J
travel to pickaisle.con(A_i)! P$ w( B: X4 S0 l5 v# x% \6 {' x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& O+ }' t1 [7 z: U else wait for 10 sec3 b8 v7 M4 m* |# a; L: B1 m5 q
if A_i=A_leave then send to die
4 n% o- m( T1 J+ t" S else inc A_i by 1
! \( C8 r6 S6 u4 J end2 ^# g& c4 k8 ]& @7 u& I- t
end1 H: ~$ ?1 t, A9 T; v. e9 W
% t3 U0 Z$ m6 Y+ }
begin P_pick3 arriving o# k4 f9 U7 R& H5 c3 ~
set A_i to 21
1 `, Y. D- R! V" h5 x move into Q_induct3# P/ |# n$ S9 N: D, v
move into pickaisle.induct3
5 _" d; T3 h1 [7 U while A_i<=30 do begin9 N8 r. B$ h2 `0 i
travel to pickaisle.con(A_i)! y j; D7 N& c* C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 W; k# N+ j! h' p) b P' ] else wait for 10 sec
# ~% X8 M3 }, g6 I. {* L if A_i=A_leave then send to die( h N$ c+ v$ M: A7 V; d
else inc A_i by 16 u5 @. I6 l. O2 l3 Z! ~" z! G
end
2 I4 h7 g2 }& n P; \- Nend |
最佳答案
查看完整内容
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,其它按你的 ...
|