|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) v! ?* j4 g. |2 j' u' L
) {, o; T8 H4 Y4 Q我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# u$ X8 W+ O+ ]5 }* w9 d6 z8 |. {5 z- v4 ~4 T
begin P_read arriving! N4 |' A$ E6 l
while 1=1 do begin
+ Z s$ ?5 L$ ? read A_tote from "data.txt" with delimiter "\n"
3 f6 B! Y1 A8 c4 m1 K read A_time from "data.txt" with delimiter "\n"+ H4 w" K. x7 m4 y5 ^& e
read A_leave from "data.txt" with delimiter "\n"
0 V+ z5 x3 V6 c# ]) s. w read A_picks from "data.txt" with delimiter "\n"& ?2 Z# u& r l) s9 k
set load type to A_tote* T" S; }; V1 q3 R% \# i B
if A_tote="tote 1" then set A_induct to 1) t" Z7 j. I; N
else if A_tote="tote 2" then set A_induct to 2$ x5 o! @" Y5 m \" c
else set A_induct to 3
0 c4 G0 H# O' @: S set A_i to 0
T) c) F k/ X! I: e6 S4 }. }. Q clone 1 load to P_induction
7 h @" t3 A8 H3 [) H: Q- Z1 L wait for A_time sec8 E3 d; p4 R" S H0 l7 Z
end+ Z' b: Q3 C8 i+ @$ Z& s
end* a( H, q* b& c6 `- Q
: N6 [2 {4 ?/ }1 i/ Jbegin P_induction arriving, _& A2 O" D' X/ }% G
if A_induct=1 then clone 1 load to P_pick1" H d2 @9 R" b, F- T
else if A_induct=2 then clone 1 load to P_pick22 I) H9 L: L! {4 t0 c$ b9 K
else clone 1 load to P_pick3
- u1 P' G; Q$ a4 @8 _2 Aend
/ F( d; V0 f8 y8 ]7 Q$ D) k
, Y4 U, ~: |& O3 k4 A: H5 Y3 pbegin P_pick1 arriving( @( Q D8 m4 w1 z1 u8 c% e+ u
set A_i to 1
) q* u* s' y$ b' X; n" V9 n' c move into Q_induct1# F0 X) z6 c, i. t5 o4 N
move into pickaisle.induct1: t; e& O; L2 l7 l3 D8 b) r
while A_i<=30 do begin; s, }& B$ z' C( Y o
travel to pickaisle.con(A_i)
L7 n9 |/ R; |* l2 A' b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 p3 \0 a, R. U& A
else wait for 10 sec
- y+ m; R, G/ `1 O7 p if A_i=A_leave then send to die
+ B1 g3 i9 @" W u4 e$ b/ m else inc A_i by 12 w# c' L( u7 v+ m
end' A5 x5 ~' N8 J
end5 R( {; X- C5 @
' X& p1 H: C: k& }$ L
begin P_pick2 arriving
) _! V* L' n/ G- s set A_i to 119 F3 q/ D7 b- I! A9 f/ D# W' n' y
move into Q_induct2% \) Z. Q% c3 w$ v- i0 ~
move into pickaisle.induct2
{7 ]$ {3 Z4 O0 E3 h, p! r( d while A_i<=30 do begin* l/ l/ y5 S9 o4 ?1 B0 n4 n" J' ]
travel to pickaisle.con(A_i)3 h- ^! b, [# u4 s
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ v5 C& `3 R/ A/ l" ]- J. x
else wait for 10 sec" {1 q0 Y3 b3 R
if A_i=A_leave then send to die% K' w$ f! a' a+ Y& o2 s
else inc A_i by 16 h. F3 c' \2 f. ? A) X
end7 ]4 X+ l0 E4 ~* {! h* m8 p
end8 E3 u! k: G, H
% b7 b! T) P: B4 K( A1 {. U
begin P_pick3 arriving
9 A+ j: e/ x3 ]. X: M! ^ set A_i to 21
1 r1 Q" d9 a8 [# q) t move into Q_induct3, H9 q9 Z: I3 h* G
move into pickaisle.induct3
, H( c: w7 o! [% N) a2 N while A_i<=30 do begin0 ^/ n. j' G A3 G' G: g* V6 `; _
travel to pickaisle.con(A_i)
) G1 d2 d9 e( q3 M* u" z- X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% ]5 t1 g4 A+ g' N5 N8 D8 V else wait for 10 sec ] p6 D( A) a0 ~
if A_i=A_leave then send to die
4 A) R/ ~) h' @3 n. [2 E else inc A_i by 1
2 D7 Y" F: I7 f \7 y) N+ ?, y end
" U* d4 c8 W( m/ M; Y5 R3 Pend |
最佳答案
查看完整内容
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,其它按你的 ...
|