|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 X% Y3 C6 c8 ]: x+ L3 `
8 k) l4 D) {5 I* y7 z我的问题是,在每个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中的数值,不知道会不会有什么不妥。' s: s, a* Q S5 E; I. e
: {4 m( R4 }; y, e) i. {
begin P_read arriving
- i5 J& j) x- o" F2 M! H+ S while 1=1 do begin
4 m% N& c. i( |7 w) l( l n read A_tote from "data.txt" with delimiter "\n"5 L; x) X) ]! M# _2 _ r! u
read A_time from "data.txt" with delimiter "\n"! r. `' d" u h+ p" i$ j# Q2 K" m
read A_leave from "data.txt" with delimiter "\n"
! R- Y7 ~2 c& s8 B: Z read A_picks from "data.txt" with delimiter "\n"
8 V, M' w$ \1 H set load type to A_tote& @; {* w* s) P/ f8 r( i9 Q s( `) [: r
if A_tote="tote 1" then set A_induct to 1) V2 |2 V9 K* w4 H' y
else if A_tote="tote 2" then set A_induct to 2
9 T$ V% S# d. A. a/ F2 a else set A_induct to 3 8 d T% F! l9 G- b2 ^6 {* C; \' [% e
set A_i to 0
1 {2 X# {! ~' F! T9 X8 w6 X( S clone 1 load to P_induction) q, G1 d+ t; D7 P6 M6 b
wait for A_time sec6 G) t& d7 [, \7 q( Q, ]. K, E* i
end( d& g1 G5 _5 K- _
end# p3 x8 \% m3 h$ W: G$ @; Q8 P* `% D
@7 T6 W f1 O' J5 p* T( x2 N6 d; W
begin P_induction arriving
8 a7 \$ \' |- R+ T+ p! [+ O if A_induct=1 then clone 1 load to P_pick15 L' r: v% g( ?# S/ c7 P
else if A_induct=2 then clone 1 load to P_pick2; e) @2 P- N7 ` {2 B i: U" g
else clone 1 load to P_pick3. i8 B* M7 o7 }
end) d( w7 X! Q9 }# u+ M( J
% [7 q$ O( J0 y8 z
begin P_pick1 arriving8 f$ H* V3 v7 z x: o
set A_i to 1- e( }4 o2 O, G- C3 i. _
move into Q_induct1
; B. A8 \! Z+ ], o& D& } move into pickaisle.induct1" U& o' l& y a( O! }! @" i2 H
while A_i<=30 do begin
& p w1 \7 V8 e; Y4 ^ travel to pickaisle.con(A_i)) W- {6 Q! K: `& q$ W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& j. u% l9 C1 V5 ^* D else wait for 10 sec/ m2 c, K) p$ u! A) V7 w) N! x
if A_i=A_leave then send to die3 I1 i6 O% K; ?( \0 C
else inc A_i by 1
$ n5 D0 g2 G; w, g8 I0 s0 ]4 p3 } { end
; n h, r* `+ _( Lend$ i' |/ M; w$ L) l1 y& G( w
0 Z( o5 T: ~- R0 x* _" H' z- u
begin P_pick2 arriving4 x$ g$ ~5 R# `3 \( s k4 y8 ~0 u
set A_i to 11: u& F4 A7 `% f3 h2 j/ o3 q
move into Q_induct2, S$ c; |' u) J1 G* n- X
move into pickaisle.induct2
2 ^ I. N' S# i; j$ ? while A_i<=30 do begin
+ t4 S% C6 |* f4 Z" ~# I travel to pickaisle.con(A_i)
! p0 ]/ d* m* D4 f7 d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& d4 j$ i% z7 J/ ` b n
else wait for 10 sec
: o( T* [) y3 Z" u, e9 B) Q if A_i=A_leave then send to die
1 N% W- U% [9 \; u9 r else inc A_i by 1
1 ~, S+ l# A( F( u# R end! o& m% B4 @3 @; F
end9 i4 w' }3 i6 c5 E. P' i* } T: o
) ?! I; t0 x9 C5 A8 p% e
begin P_pick3 arriving
% T _# \* L& T/ G* K. M1 { set A_i to 21& Z1 Q- x# ~# ~7 I/ M1 k2 |
move into Q_induct3
* t# [" X! i! Y move into pickaisle.induct3
" g1 y9 N- B( r6 S; h. P& Y4 J while A_i<=30 do begin+ ^/ z" O( w3 \5 d
travel to pickaisle.con(A_i)
; h1 H D# k9 I& O# h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 B: P3 G1 |5 t2 F- l
else wait for 10 sec
; K1 q4 s: |0 O: Z' Y4 Y% t& `' E# X3 c if A_i=A_leave then send to die8 L" K3 t( _8 T7 I8 W+ G, g* Q
else inc A_i by 1& i: {- v" T$ R8 r' D/ b$ V
end$ B1 T7 h& e4 f" J8 }
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,其它按你的 ...
|