|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' I% h+ Q/ s+ _, i9 @0 d* h( @
. h5 N% F; h2 G8 h# 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中的数值,不知道会不会有什么不妥。: _( k q6 G1 R8 a
. w, I8 ]" i Z/ V* E" a
begin P_read arriving
C( k3 q2 R0 Q3 n while 1=1 do begin5 |) U) {. f8 k# T8 m& q; {$ |
read A_tote from "data.txt" with delimiter "\n"
4 O, q0 S6 g# U7 [; c2 Z1 a read A_time from "data.txt" with delimiter "\n"
1 W/ Q2 v4 C; F% O, W read A_leave from "data.txt" with delimiter "\n"2 v8 _# \1 G, u
read A_picks from "data.txt" with delimiter "\n"
) N( U2 E% s5 e4 Q- d3 P4 H5 u. L set load type to A_tote& M0 {2 x# O; K( b8 C$ H
if A_tote="tote 1" then set A_induct to 1
% X$ I7 @' D$ m4 v0 H+ s else if A_tote="tote 2" then set A_induct to 2
" ~3 `2 n2 X5 v else set A_induct to 3
9 u) |0 d( T9 D5 v- q5 ~8 ? set A_i to 0* I2 _7 K2 T, ]1 ?3 e" d
clone 1 load to P_induction
4 w' J$ o: H! r6 O0 b wait for A_time sec
8 @% f( ~0 d8 i6 e8 X! N end; F6 d5 |( M) M' J" z2 A
end
* c" j6 A% Y5 a7 g9 o! g3 V
* E* I( E- ~7 V, f' ~5 d! ]begin P_induction arriving! p& B5 V! Y2 w2 j
if A_induct=1 then clone 1 load to P_pick1
) R' e' @+ d: n# a. s( y else if A_induct=2 then clone 1 load to P_pick2
" t3 |1 w: T% b7 }" M1 r else clone 1 load to P_pick3
7 N' O1 U! d: m! N% ?end! I2 Y5 w" s# h9 ?! J L' T# @
5 m, _. Q9 r4 N
begin P_pick1 arriving I# N- Z# T. B" J
set A_i to 1
; y$ B2 C; z1 r, f( w7 A" X B move into Q_induct13 P- \& [) v: S4 v
move into pickaisle.induct15 o9 @" e% B* T, a% t
while A_i<=30 do begin
2 n- U1 m* _. O( h travel to pickaisle.con(A_i)3 o+ x+ W) L9 c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# ~" A: C& k% \, \2 T% W
else wait for 10 sec! @- V# i2 f9 G( K1 ^. E) s
if A_i=A_leave then send to die
5 ?) C0 ?' J/ F+ D; O2 J9 f, P else inc A_i by 11 h! G5 o7 g8 S8 c; O$ ], ~
end
( A# i* J# }, R. @" y; s# Cend i8 @( y9 F. B5 `. w6 u3 d
+ A' Y6 }5 Z3 L8 Lbegin P_pick2 arriving
3 n* U K& s7 c. c set A_i to 11! f. U" B' R. @ ~3 }9 h
move into Q_induct26 B# m* O7 d; @# O% R6 z
move into pickaisle.induct2$ H; k/ ^' N* ~" I2 ^% _) o9 Y
while A_i<=30 do begin0 D/ T# f* B: F! G: _( F
travel to pickaisle.con(A_i)
4 E0 ^: `" f" H1 I; Y1 u if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( e2 d2 S4 ^& b6 j' `* q. m5 Y else wait for 10 sec. l) l' r3 I' T$ h. c& r$ P
if A_i=A_leave then send to die# v6 p. {/ }" y8 i
else inc A_i by 1
; y: w% w( m) |& w end/ }' t& S* ]+ D
end
3 e' J1 @9 Z$ h7 p- q- _/ I" x# l! o4 o8 H! V/ U- M
begin P_pick3 arriving
7 m4 v$ I$ X4 U* o set A_i to 21
: e# n; V% y; ^& ?8 B) _4 z+ O move into Q_induct30 W) R3 W5 m1 l) ^9 Q" `+ f8 r
move into pickaisle.induct3* W( I5 C$ I# t& Y( k/ a
while A_i<=30 do begin
; f$ j6 p& u' | b# h9 { s travel to pickaisle.con(A_i)
9 B: }2 S1 _( Z8 X n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 S v1 p% V' G) b4 Z% O+ C, `% q. I else wait for 10 sec
; H5 F# O" t# P% j* _7 V; P- H7 ~; n) Z if A_i=A_leave then send to die
$ p9 N# K5 U8 T7 a$ I7 E' t else inc A_i by 1
# `5 }: `1 F- [, q& u- P5 d: [$ e end
5 d# f" B; C7 R& uend |
最佳答案
查看完整内容
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,其它按你的 ...
|