|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% ?/ w8 ~& k# @4 R$ R+ I7 ^
* @& B/ F, z- K我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 f6 ]1 }8 x I Q9 N/ P }; Z' {# l- a/ B
begin P_read arriving' ^4 M1 u$ J9 `
while 1=1 do begin! Z1 o9 e( G- O8 i% e9 V) q: ^+ L
read A_tote from "data.txt" with delimiter "\n"
! I: e, x1 \# s3 T6 L( Y6 f read A_time from "data.txt" with delimiter "\n"& S& [3 o- u0 U
read A_leave from "data.txt" with delimiter "\n"# C" U; \7 g Y b$ M# t- a
read A_picks from "data.txt" with delimiter "\n"5 d1 A$ k! u9 K' Q X' Z+ ~$ T( F
set load type to A_tote
# ~; J0 h' C6 J: J6 q3 R if A_tote="tote 1" then set A_induct to 1$ P+ U( _7 R8 E4 R3 G: f5 c# d# r; _9 a
else if A_tote="tote 2" then set A_induct to 2
& U3 E- z z' P4 O7 g& j else set A_induct to 3
0 g. C# z8 d" O: x" n K set A_i to 0
- G' V8 C, O- Q# x clone 1 load to P_induction
* ]% A, i9 _* O9 O' C wait for A_time sec& g# i1 ~2 o) t' T4 ~/ F5 ~
end6 Y& s x0 _" I
end& Z% B. `5 {( {2 H% ~
8 w8 }) I; R! p9 ?) S) J
begin P_induction arriving
6 d: N0 M1 q$ m4 U8 ` if A_induct=1 then clone 1 load to P_pick1
7 A F) w. T0 g else if A_induct=2 then clone 1 load to P_pick2
- K) X; [. K$ Q else clone 1 load to P_pick3. w7 f! w' I; V' A3 Z% ?( T
end
% K+ }, ]; V2 v: ]: S
: u5 m: t/ L8 d9 C* h3 e( W5 jbegin P_pick1 arriving: m7 o. n( s# D5 `6 i) y+ q) e
set A_i to 1
) @9 f+ I" s( I$ Z move into Q_induct1
& M R: Q# ]5 Y2 @6 x1 Q$ q! p, @& _1 q move into pickaisle.induct13 X2 w+ Z: G" J
while A_i<=30 do begin
* U3 j7 @3 [7 f. I travel to pickaisle.con(A_i)
% j6 C9 X; L: j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- W/ |' P3 |+ ~) x/ q5 u/ y
else wait for 10 sec6 r2 L9 m& [- V; N
if A_i=A_leave then send to die
8 @) C9 I) k$ z2 c" R0 Z1 q else inc A_i by 1, E& X R$ D$ @! Y% t
end# j& @: l7 V8 c! [2 O! `; u8 \6 |
end* Q+ c- }, o/ }
8 F6 S& ^0 l7 dbegin P_pick2 arriving
, E% P4 C+ q: l set A_i to 11
7 P; u* ]6 x+ Z1 k1 W+ T move into Q_induct2
/ V: W/ R8 d( ?- z( q" O4 a4 n# p move into pickaisle.induct2
6 V# O2 ? ?# S3 W7 B while A_i<=30 do begin
/ [' k w4 w `8 _ travel to pickaisle.con(A_i)
0 P, k% S% ]& K8 r" i if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ g) u! [/ h% F else wait for 10 sec
8 g- o$ p# U. m) L0 ~$ q7 P+ d# W if A_i=A_leave then send to die% V4 A. h4 u" U+ S& X# I
else inc A_i by 1* }# a" H: o6 y% ?. {. {$ m9 ^
end
% n, w8 u5 o% Z5 Q3 Vend
& ?! W' ^6 v7 _" C, E, _7 }6 O- d6 p" P |
begin P_pick3 arriving
8 o( R( r# ?$ m6 @ X% D4 R5 }; D set A_i to 21
( e; m0 d( M( k/ K k6 i9 l move into Q_induct3
1 d) z4 Z8 n7 P b2 u: u2 R move into pickaisle.induct3
1 e: W5 ?- _: K" B while A_i<=30 do begin* j7 ^" V0 M1 L5 S; i
travel to pickaisle.con(A_i)
: x* I1 I' ~: S( z% M/ o. { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' [2 U: A1 K- W, d
else wait for 10 sec
* ~5 a2 F2 P2 l" G, W if A_i=A_leave then send to die2 u5 x2 r* x) [$ I4 v) H
else inc A_i by 1
" z8 b# t7 b; }$ b end ~+ C Z$ [4 `2 }9 o
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,其它按你的 ...
|