|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 t; m: D+ W+ s P
& W4 I- E& Q: u) S+ P Q4 A我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ L- L1 ^ h' [5 l4 b
% R! S/ c2 k7 x/ E: `1 O! c B" ~6 ebegin P_read arriving* z3 Q" o/ B, _9 y& \+ v4 G9 e
while 1=1 do begin+ [! ?+ t; w2 e$ Q- y7 f& ~
read A_tote from "data.txt" with delimiter "\n"
! q& m; j1 C, g6 F read A_time from "data.txt" with delimiter "\n"
/ m! D$ L7 d3 h2 k# T4 f read A_leave from "data.txt" with delimiter "\n"
# N* L) m" s% O9 ?8 K$ j' c+ l read A_picks from "data.txt" with delimiter "\n"
9 T) R3 Q6 ?. o# U" v6 Y/ W% q set load type to A_tote
+ w- y# E- S P# M- l+ M if A_tote="tote 1" then set A_induct to 1# b- U4 i+ T/ B. U& r: e# a$ F3 K# a3 C
else if A_tote="tote 2" then set A_induct to 2
) r; ~$ D+ f3 k0 Y& E8 L0 | else set A_induct to 3 : a6 ?: a q- V# r( ?
set A_i to 0
2 k; x; c1 ~0 t$ O# W; c: W9 u- Q4 I clone 1 load to P_induction
+ |+ Q$ @) A+ q2 q# Z& ? wait for A_time sec3 o# ?9 @; a% [1 d. H& R& f
end
2 f( R5 }. {7 Q5 i. ?end
! J# D7 g/ R& H+ M" _
. k/ k; l( w) A2 vbegin P_induction arriving+ F" g* S8 R0 s7 u; Y, o$ h2 f1 O
if A_induct=1 then clone 1 load to P_pick1; l! Q3 c6 Y8 }# m w, R# |0 Y+ E
else if A_induct=2 then clone 1 load to P_pick2* T/ e1 m" B& P9 A/ N
else clone 1 load to P_pick3
6 f. n' K) q) k: n/ _0 k/ p# Gend
6 [+ J$ X3 j) m$ x: q. V% q; ]& b; D! B" J
begin P_pick1 arriving" T' P+ Q9 W8 A
set A_i to 1, w! _; l9 b& L- R5 g
move into Q_induct1
$ X# ]1 k" B8 A& M4 b- C) [ move into pickaisle.induct1; o3 ^, f- q( K' [
while A_i<=30 do begin
% t4 C- W: ]; ?2 {5 m/ X5 R { travel to pickaisle.con(A_i)
' ~2 h# j0 O& O) q1 ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) R) f& l9 ]1 E" D5 S) h: e else wait for 10 sec0 _1 z! {8 h9 U4 ~7 @
if A_i=A_leave then send to die
2 a3 a, `" K% {" h7 n else inc A_i by 1
v- r; Z% K" s end" S8 p8 [; M" K7 h
end
4 o7 {7 |" @8 }+ R+ c7 T6 k* _ W4 p& L1 ~
begin P_pick2 arriving1 l/ o* r" C$ X8 [
set A_i to 11) e J5 V! m# I1 M* q
move into Q_induct2
' ~/ K2 I2 L3 K5 _2 y move into pickaisle.induct29 u) O1 A% d0 N& ]& t; ?
while A_i<=30 do begin+ V/ O; C" p5 Y0 ]" a
travel to pickaisle.con(A_i)
) j8 T/ `4 p* n7 r if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, v! ?0 j- d: k# {) j6 m }8 ]
else wait for 10 sec
2 W6 G# T7 y) u! _) ]8 V' M f8 i if A_i=A_leave then send to die
' l, e+ N: S! [0 Q0 F! K% r else inc A_i by 1
, \% ?/ D2 K: o7 |3 J& | end
' _& b5 w% c; ^* k; c! D$ W, ~, B; jend3 k5 r7 X7 L: y% A+ T
# G3 U' y9 C7 K2 G( Q2 v
begin P_pick3 arriving' }; @& v: k/ p! ?7 g
set A_i to 21
: r. {6 M% a9 d9 p move into Q_induct3
6 n* n: ]" ]) t4 W move into pickaisle.induct3
% ~7 X0 w! k5 W while A_i<=30 do begin. Q! O6 a7 P: V3 t. ~: p/ f! z
travel to pickaisle.con(A_i)! d1 i' \5 u: ^$ W) {6 I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) b: Q3 H8 ^9 q3 i0 T
else wait for 10 sec
0 ]' X5 D- G B# E3 j5 v, H9 s if A_i=A_leave then send to die, \% b( w& j; P: o2 [! ?* X
else inc A_i by 1
$ U' N6 m+ ^4 B' r3 L# ~8 [ end [3 U' @7 g* {( d
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,其它按你的 ...
|