|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) @2 w, u r( C0 x' S, b
, G3 O$ y8 v, v0 ~* W; 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中的数值,不知道会不会有什么不妥。 q1 D* a. ?1 {5 k
$ g. J& g+ H( p5 c2 Tbegin P_read arriving
$ F* @, {" @6 h1 B# E- w& E while 1=1 do begin
# O' ` W( e# _4 i1 h2 i) n read A_tote from "data.txt" with delimiter "\n"
" U0 P* d+ h% x' e0 O read A_time from "data.txt" with delimiter "\n"
+ e0 K+ S( f6 Z/ E# u# |: r( k* p ~' y read A_leave from "data.txt" with delimiter "\n"
/ {2 s% g/ K# K read A_picks from "data.txt" with delimiter "\n"! W' U8 i% c- d: Q1 U- l8 ]. v
set load type to A_tote; S7 R0 N) F0 a
if A_tote="tote 1" then set A_induct to 1
8 b7 ^$ } w4 ~9 y q# s else if A_tote="tote 2" then set A_induct to 2
7 t6 I9 I' x0 \8 M. E/ o# Z else set A_induct to 3
: c) P2 ~+ o+ n: i set A_i to 0& A2 ]. s: N: Q+ J! |) Y0 M# [
clone 1 load to P_induction7 u. C. Z4 |5 }) t& _
wait for A_time sec
6 ]8 v5 V$ P) t4 K+ B$ n% {$ } end+ I) }' X( s. [9 m5 H4 n9 I" A' p
end
2 q8 X" d+ e8 Q. y' c, H+ a% q- d
begin P_induction arriving5 p+ N1 k& u0 y3 e/ x& z% J& z u4 n
if A_induct=1 then clone 1 load to P_pick1
1 `" Z; Q* ?7 {4 Q else if A_induct=2 then clone 1 load to P_pick2
4 k N p1 Y9 Z% P# Y* ~" m else clone 1 load to P_pick3. s9 l! W6 ?& U
end
* x" q1 a6 u, C- Z0 u
' s- s5 ]# t7 n0 k; kbegin P_pick1 arriving5 @" D, t, T6 M: G7 J" y& u4 @
set A_i to 1
2 k# k `6 q" ]6 Y) L6 ?4 P move into Q_induct1: H X! g L5 t% J' J+ Q$ U
move into pickaisle.induct1+ s% c2 F, s3 F" @
while A_i<=30 do begin8 z( Y4 P( d: Y) Q0 W+ M/ y
travel to pickaisle.con(A_i)
6 K/ f7 s! L1 C! m; m8 e# O! B- j. G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, m. J3 v3 _5 H, d; H" V2 J
else wait for 10 sec
/ R* G" S* g5 ?. ` g. }$ d, m0 D7 F if A_i=A_leave then send to die. V5 y) O$ C. a1 B1 F
else inc A_i by 12 X1 S, R! R! x# ~
end
# ~0 _# { z0 Fend& w+ k B5 P9 y6 z% c1 |
2 C( k3 k4 p. r$ N+ c
begin P_pick2 arriving8 F. s* l k/ x8 m. k
set A_i to 117 B5 q3 a+ h9 j6 f$ Y
move into Q_induct2; x# V+ ]0 c0 j! _, m6 {/ n" c! p0 c
move into pickaisle.induct2
9 V' f E9 C% G D* [6 t- L while A_i<=30 do begin- x* |. T4 h& j: D5 a! O
travel to pickaisle.con(A_i)
: o. Q$ m1 \+ b$ M0 z; I8 \7 e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" v/ A1 e8 l7 |& w0 s: F% D else wait for 10 sec3 Q1 v8 J6 Y2 X2 g2 ~; y
if A_i=A_leave then send to die
& O) C& Y+ w1 o. |! D% i2 e else inc A_i by 15 P* A! J7 H* T/ v6 U
end
! B: v# H! @6 n4 s9 [: ^, xend/ N; Z# _- C" t
4 ?- z. s8 b, }
begin P_pick3 arriving# Y3 H# b( A- Z# j: m
set A_i to 21
7 f) q+ j. n4 T5 u" } move into Q_induct3
- y2 Q# A. X1 U( L' [+ D move into pickaisle.induct3
2 t( _1 i5 G0 B) F! h y6 O1 K while A_i<=30 do begin
; V4 V3 Y! D5 `7 p4 M* T9 _ travel to pickaisle.con(A_i)
, X6 p' N$ n! s: z7 K' v! h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& A* U* t. d B1 r. H' U; _ else wait for 10 sec1 H$ [0 C9 e; V l
if A_i=A_leave then send to die n, ]8 a. j. @4 ^
else inc A_i by 1* l: |* Q3 }1 W+ Q9 X }
end
/ n+ {9 t0 B* | j) B- Mend |
最佳答案
查看完整内容
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,其它按你的 ...
|