|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 T# U4 ~$ H n# K v7 r
4 H% f# d8 n5 L% b r$ 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中的数值,不知道会不会有什么不妥。$ L5 b W0 y# z$ i6 d
) X7 p1 Q) {, O0 mbegin P_read arriving
6 C# g$ H1 x% k |7 c5 A" k while 1=1 do begin3 O) n6 i8 V- q2 Q
read A_tote from "data.txt" with delimiter "\n"
7 v/ \. [! ?7 o$ R- X5 |' E/ J read A_time from "data.txt" with delimiter "\n"6 j5 p" n5 F, d, e$ Z! w! j& @9 o
read A_leave from "data.txt" with delimiter "\n"! k& q4 o8 e! K! J6 q
read A_picks from "data.txt" with delimiter "\n"
0 y8 q$ ?) p% ]2 c, p set load type to A_tote! g4 z& Y0 m7 b. F3 C9 p
if A_tote="tote 1" then set A_induct to 1 S k, R& X" f7 X7 p0 `5 o0 u* _
else if A_tote="tote 2" then set A_induct to 2
6 K# ^* [" b+ K5 ?) ~+ D else set A_induct to 3 - T' Y% W, {. e, d& v5 Q
set A_i to 0
- k9 h7 T! ?" v clone 1 load to P_induction
* X- \7 B- v" |( C, c- h% P wait for A_time sec
" o! s* l' _, B4 n1 P end% c( `0 d1 I0 n( G; Y
end
( O3 c/ F/ {0 S" z6 G. e5 {3 W
. ^# J# d C1 O9 D/ }& Vbegin P_induction arriving
$ o5 y' w9 p/ [% B9 e) W. x if A_induct=1 then clone 1 load to P_pick1
- Y3 U' b! u1 F; y. _3 K+ m5 X: } else if A_induct=2 then clone 1 load to P_pick2
`3 C, X- m" l) A3 t5 d else clone 1 load to P_pick30 F$ X! ~; |" c) y
end
% S; ]* ^% \2 g& t# F0 j
* u! E1 F+ `- |+ c# Abegin P_pick1 arriving* Q8 u) l" X4 }6 e
set A_i to 1
4 W' f5 C [ r8 v% z move into Q_induct17 m& Y: G2 f u
move into pickaisle.induct1
2 |& X; x/ c/ F6 H" ^ while A_i<=30 do begin# o1 c* v# I) C) R
travel to pickaisle.con(A_i)
( t3 k2 a& t) k' U3 ]3 o# }' l if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 b( z8 g& ]; _) K5 U else wait for 10 sec
I9 O2 U) K" |3 W: o' {9 [ if A_i=A_leave then send to die7 K& P6 C! m: W
else inc A_i by 1
+ H% {4 U6 F! s3 \! g6 K9 V end
, |4 ^% ~) R( {, K9 Uend3 F! K/ g$ Y4 Q; b
5 o- m' A* l Vbegin P_pick2 arriving N' W2 t, l t+ R
set A_i to 110 O) O5 O7 u6 i0 V. g$ U5 I' P# B
move into Q_induct23 q8 P: M8 t6 {3 e( M' c
move into pickaisle.induct2
# Z+ k5 H6 k3 O1 Z2 m while A_i<=30 do begin
( Y: r9 p5 }! W travel to pickaisle.con(A_i)
" R8 L6 W4 ~, S, a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' [2 {" A4 y& N; J else wait for 10 sec/ }) r# u% a' G8 ~
if A_i=A_leave then send to die
( U0 N' Q! H& @3 j1 i' s5 L7 a else inc A_i by 1
! c6 a3 ^% a$ E9 n end
# I' g! d9 c- U+ g3 Zend' g) A! P- L' S# O# `+ s
& ^; k9 t# f: |* S8 g
begin P_pick3 arriving# f- E; A2 H6 e
set A_i to 215 i' W( ?8 b3 @4 D& `' k' B
move into Q_induct3
% F' e9 n- C+ I; h move into pickaisle.induct3
: P" N& y* o) d( h1 L while A_i<=30 do begin
k$ [/ [7 D! u1 h" A/ E! X% ^ travel to pickaisle.con(A_i)- ?1 S5 H# o1 S# x/ m4 w* n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
h# C k2 z% R2 M else wait for 10 sec
6 H0 k9 R- u; b; [4 Z if A_i=A_leave then send to die) l, z: S$ Y5 a, ^3 ~
else inc A_i by 1
4 ?/ j2 {+ n {1 ~0 J, x end r/ k0 Q! ]3 x- {
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,其它按你的 ...
|