|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 ^7 i+ X# e" H) p$ g( u
' a6 u7 @' g9 @2 [; g P1 T/ `我的问题是,在每个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中的数值,不知道会不会有什么不妥。
0 Q; [: \ i$ Y9 E# b
: P+ F0 h$ v+ R0 [! D) @begin P_read arriving/ ]$ ]5 A' W1 B9 f0 U
while 1=1 do begin
8 z$ l" Q5 E) U* _3 b/ j+ o+ @ read A_tote from "data.txt" with delimiter "\n"
3 k1 r' i8 G; A8 ^& } read A_time from "data.txt" with delimiter "\n"
5 ^# P. d7 m( [, a$ \9 g read A_leave from "data.txt" with delimiter "\n"
0 S' S3 z5 Z1 g+ e7 a read A_picks from "data.txt" with delimiter "\n"4 s3 Z4 D* o$ N E; E1 m0 X
set load type to A_tote
* j) g5 P0 V3 a if A_tote="tote 1" then set A_induct to 1
5 P u& o* J/ Y( G else if A_tote="tote 2" then set A_induct to 2- {5 L6 j$ h) X% |/ x4 F# H7 q1 `, t
else set A_induct to 3
o: a' W. P) V- n. C" o set A_i to 0+ h. w* C. j+ v- t
clone 1 load to P_induction+ r8 `3 a' t4 o1 D4 H; e! T1 W
wait for A_time sec. v8 ?' I, m' r! c5 W0 Z
end+ M2 @) p1 F5 `3 d0 L5 a/ \1 i
end
\5 W- u: w2 v t7 ~* x# q2 f6 m( w! c1 m, M$ D8 o; Q) n
begin P_induction arriving4 ? X1 E+ o( q* V6 w/ R" N
if A_induct=1 then clone 1 load to P_pick1+ G, d8 T1 o5 `/ f$ K) j
else if A_induct=2 then clone 1 load to P_pick2
# ]8 Y5 F# j1 a7 ]" j else clone 1 load to P_pick3' `: D+ }9 v& Q, _' x
end" Q% `% b% K% m
2 @% a1 f: O: S* wbegin P_pick1 arriving6 G0 Y9 R5 J% ?* I& W8 @. v
set A_i to 1
0 I& R: U0 G3 Z3 n b move into Q_induct1+ }! p- y1 t+ A/ o, u: e
move into pickaisle.induct1
4 _* {+ {! d: D7 T: Y6 d while A_i<=30 do begin
0 j! w* n _2 [4 S: K travel to pickaisle.con(A_i)
: J/ V. V) Z; R& B. ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* {% O4 \$ {0 N7 g- h
else wait for 10 sec
, b7 L3 q; B' v, K6 i% E if A_i=A_leave then send to die
1 ~: \! a" W, P; z2 c2 E6 w else inc A_i by 1. y) x# I( N2 h/ B0 \5 v
end
+ _0 b5 A# i- c8 i' A4 t: F Uend, ~, y: s+ d9 o4 g) r( b
% E' U, R) ~& m1 C
begin P_pick2 arriving
U: h5 b3 `. h$ N0 r set A_i to 11( l# @% U) I4 N7 R8 S& r
move into Q_induct2
' P& N* R6 ^" d f1 @4 A3 L move into pickaisle.induct2
& _4 {$ p4 G! r: J) | while A_i<=30 do begin
" c! E# \ x ?; B) S7 ~+ k travel to pickaisle.con(A_i)6 N, ? Q8 P7 G/ k1 |$ g
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ r2 _ \3 Y0 W2 T# J6 U+ g
else wait for 10 sec" f. Q* w L4 s2 ~' G/ c$ g! j9 v
if A_i=A_leave then send to die
" u8 [0 \* J1 J else inc A_i by 1! D9 U" W) B i1 E8 H
end
/ `5 x2 O8 x& d5 X: z7 K+ Aend2 r3 P- X4 n5 o0 R+ ?
% Y6 u- i5 X7 d$ V7 z" J
begin P_pick3 arriving
. L( O) k2 W/ z set A_i to 21' f; B$ K3 }- {4 F
move into Q_induct3
4 T- \/ A2 W* q1 X; O move into pickaisle.induct3
2 u, N* Y- ^! }% h6 W while A_i<=30 do begin4 }, ?- u$ ~8 L0 B( `( {" O. k1 m# `
travel to pickaisle.con(A_i)& B4 W% F" G, ]) @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 p- Y0 u# t& j# _4 ?4 a% E+ N
else wait for 10 sec
6 J5 C" G4 G: Q- A if A_i=A_leave then send to die$ k4 T8 l5 E2 m/ U& _/ a
else inc A_i by 1# n |' d& F' m7 A1 @/ K
end7 R) i0 k0 H; 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,其它按你的 ...
|