|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& b# f4 I: {2 x
2 V' u/ V2 M b% ^我的问题是,在每个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 u/ J( u1 X. x$ L1 A6 T. n& `0 R# a0 y+ _$ w* L% j& p+ c
begin P_read arriving. \7 Y) V2 f9 j! P. U* b
while 1=1 do begin; y8 Q, V- D1 t/ n
read A_tote from "data.txt" with delimiter "\n"
- V4 Z/ M! W' D/ D read A_time from "data.txt" with delimiter "\n"
# F- u# B* J; g5 @ read A_leave from "data.txt" with delimiter "\n"1 M/ A" O- @1 a' v2 `1 z3 ~
read A_picks from "data.txt" with delimiter "\n"1 [& G/ n' W# W( n1 ^0 q
set load type to A_tote
$ b f+ H* V+ ^( W( T+ V+ k( T if A_tote="tote 1" then set A_induct to 1
, A0 C' x7 x. t' s& T else if A_tote="tote 2" then set A_induct to 2
9 ]2 s5 ~ y) z2 h else set A_induct to 3
. K w" e$ K9 f! \; x" K* D0 y$ T set A_i to 0
: `7 f" w2 }, [1 z clone 1 load to P_induction
# \1 _6 K! L& R2 v. E# S wait for A_time sec* `0 ^# R- E0 v6 S. Q6 M
end
! k4 @+ E; \$ nend' o( z3 }! X" s/ \3 ]
* W* g- x. ^; O. g& }
begin P_induction arriving0 y7 n$ M* g9 {9 F% D1 M
if A_induct=1 then clone 1 load to P_pick1
% U5 z( `5 b/ W. b2 i4 V( S, ` else if A_induct=2 then clone 1 load to P_pick2
! e. m' G1 U2 z* w4 u else clone 1 load to P_pick3
8 q$ r( t x6 |6 L! P+ d& P, D, eend& S6 c% t* e; J C- C% z
3 C7 r$ h$ V0 \- w' H/ R. ]
begin P_pick1 arriving8 G/ ~2 n7 S9 L3 Z6 S* v% c
set A_i to 1
9 R: f- D" _% b# X- H+ s+ R" @* X0 h move into Q_induct1
! M. L6 ~4 f& u! p- k7 `# T move into pickaisle.induct1
- D) J: {1 `- r2 k/ A while A_i<=30 do begin/ M) e, U) S3 `' {& J5 F0 X
travel to pickaisle.con(A_i)
3 ~; ~1 f7 ?2 r if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: S' i1 F; y% x2 B M+ B) x
else wait for 10 sec
2 y' z/ }& N m if A_i=A_leave then send to die& L: G, M: L# {
else inc A_i by 1( W A) d+ e, Y
end6 c0 _: [1 O) E. p2 n, V z
end
0 v2 h, Q% k, V7 L8 j: E# j* I9 l9 l6 g5 n; n7 a- T0 G- U
begin P_pick2 arriving
. @6 }3 s U' K, k' I3 ^; R6 ~, N set A_i to 11
& C; Q z) Z9 \ move into Q_induct2
: _4 E1 ?0 k$ r" h* a/ F1 a2 U move into pickaisle.induct2& X b5 P/ T a2 A- O
while A_i<=30 do begin
% i# [# G, V/ j) p S% J9 N( R! d' u5 c' v travel to pickaisle.con(A_i)$ D' k* \) Y0 C* \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! q4 f5 f7 X1 K( A* C else wait for 10 sec
2 K; S+ ^& e* _0 D. {& s if A_i=A_leave then send to die! n* T% A% h2 B7 h" j
else inc A_i by 1
) h8 a+ @% I! _, H2 G end
1 ~6 ?) I b+ P( J3 eend+ E! {( ^5 Z5 D' i& C! I
9 z8 Y2 U7 s' C
begin P_pick3 arriving
* S! c( C1 t0 B6 S. |8 X set A_i to 21. g1 O) T, U7 c* m0 R
move into Q_induct3
4 N5 f' ~0 C9 T/ j9 {; l move into pickaisle.induct33 V6 f3 p' a+ L1 ^2 r2 n1 N
while A_i<=30 do begin3 _- j$ z K) j+ [5 e/ u
travel to pickaisle.con(A_i)+ e: h! ^3 U* c* ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 P$ f, a c1 U% E/ k. k
else wait for 10 sec
; L# d v! K: D; I if A_i=A_leave then send to die. O" v; O$ _( M# ]3 O3 ^
else inc A_i by 1
, Z1 ?0 M% E( X& X* Z9 T end7 v; J" y3 n F' K# t% d$ `) h
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,其它按你的 ...
|