|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% ? j6 @- l3 q+ Z2 Y6 Z, L. @( ?6 J3 ]1 |3 c' B" `# C
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 Z) H& E5 I2 A4 t
# S9 w9 Y" E- g: Pbegin P_read arriving* z% c' z# i" s/ d$ B% n2 j
while 1=1 do begin
3 g; P/ R+ `# I$ b read A_tote from "data.txt" with delimiter "\n"
7 ^: ?* h1 l2 T; v4 s. h read A_time from "data.txt" with delimiter "\n"3 D" k( l2 \7 p, j" j% f) s: X, r
read A_leave from "data.txt" with delimiter "\n"4 t& ?" h$ L2 a8 X# R+ H+ H
read A_picks from "data.txt" with delimiter "\n". L6 J$ V8 V& h6 j" G# E0 i
set load type to A_tote1 Z( S# B( ]. P, {7 ]
if A_tote="tote 1" then set A_induct to 11 C: T5 J. M9 S, ~" w) Z
else if A_tote="tote 2" then set A_induct to 2
# }! H* U$ w+ |* Y- ^ else set A_induct to 3 , r% c3 T; f2 o4 x+ p
set A_i to 08 l6 X" f1 E0 ?2 P5 D# B
clone 1 load to P_induction
+ S; o( \. [7 C i% y, d wait for A_time sec
: @$ J! [9 t2 f: x6 B3 o& K7 _ end. g9 Z1 z/ U1 U8 \! ^" a# F% {
end+ V) X6 D, }, u& v
) K3 J4 F2 k% ^begin P_induction arriving6 t. O$ E: K- o
if A_induct=1 then clone 1 load to P_pick1
+ E% Y0 S% h( x' N. K2 W6 \0 c else if A_induct=2 then clone 1 load to P_pick2
3 ], { m8 d3 ~$ u else clone 1 load to P_pick3
) j( y' v6 T% j" g/ n' \3 Dend
/ r) @4 ]( q" W7 K+ w& f
2 t N$ V, [; Y! u" wbegin P_pick1 arriving
% w. L1 ~, m# q0 X$ z' Z# J# ^ set A_i to 1, W) S- q" I$ c" p! H. Y: h
move into Q_induct1
* r* o7 r8 J5 i7 e6 _4 ^% T% ?+ D move into pickaisle.induct1
0 J9 }# X5 U) H `0 F3 x while A_i<=30 do begin
3 I5 s; m, R6 S7 O- |3 K0 q! h travel to pickaisle.con(A_i)
3 ~% R) d: F- u% h" R& U- \ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, V1 ~! @& j: I4 Q* Q$ k
else wait for 10 sec
0 \- C/ L- _1 b+ i0 \5 t if A_i=A_leave then send to die: Q9 M3 ]. N* G' D9 K, |) ?4 s
else inc A_i by 1# `* z- Z( ~7 x" E5 y
end$ V/ T5 S$ ^' A0 z1 z- u
end" n, i! b8 k+ z0 \
# e5 L8 s8 h" J" _; Z x o) x9 ?
begin P_pick2 arriving
1 D) {1 w' a2 z3 ]2 q7 C$ _$ s set A_i to 11' Y l2 j. x; A/ ~& { x3 `$ D6 F
move into Q_induct2+ ^& Z. y/ P8 v6 D% U5 W' \0 D
move into pickaisle.induct2& F* [3 m+ g6 b) Q2 p0 l8 O6 \) n
while A_i<=30 do begin3 w8 \, _+ o, q5 j1 L. N) d
travel to pickaisle.con(A_i)9 i* S8 i" F( J, _8 e5 ^, s$ o
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) ? \( @5 I) t. v- V else wait for 10 sec$ H5 O5 c: o; ~0 v! x5 `* b& e* w
if A_i=A_leave then send to die; k: R& q& T; A2 n0 k2 Q
else inc A_i by 1
3 _! ^. P, @( k3 {8 A3 {6 Z end2 B. s- a% n9 E
end5 @& r" ]3 ]; j; r/ r2 v
5 O# d: @3 k( Gbegin P_pick3 arriving
2 q. W: W4 {8 [: X set A_i to 21+ U% P7 u) x- z9 L" y4 {1 F) u- F
move into Q_induct3( N5 Q t8 _7 I" N
move into pickaisle.induct3
2 S7 v% S; z! B; E- a* r while A_i<=30 do begin. \2 v6 j3 s6 D( ^# s# j
travel to pickaisle.con(A_i)
3 ~: f" R8 _. a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! V x1 l& D9 X else wait for 10 sec
( O3 b+ X% g' | m8 R: Q if A_i=A_leave then send to die5 D$ L2 v! k9 }" {
else inc A_i by 1
9 G7 j$ {; H7 M E1 o end
8 {3 l; Z5 o5 I( e) vend |
最佳答案
查看完整内容
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,其它按你的 ...
|