|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. z7 F4 [! T' o' \* M: S* e( `2 q! ^& r
' f/ A/ K' {) Y( f* f, x S* s
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ ^7 {& R2 i, |( H0 L9 {9 @' w
begin P_read arriving+ W1 E; X9 a; x& S
while 1=1 do begin# R2 \, x \! k% R% w$ a
read A_tote from "data.txt" with delimiter "\n") \" {5 z& R9 e+ O4 Q
read A_time from "data.txt" with delimiter "\n"; q- k9 }7 W4 O0 P4 x
read A_leave from "data.txt" with delimiter "\n"0 B) M0 B1 W% x$ S* u7 G. [4 j m
read A_picks from "data.txt" with delimiter "\n". M' f- ~; K0 L
set load type to A_tote
7 r* v8 m- |* J if A_tote="tote 1" then set A_induct to 1* s. s, I( ?& f! y% U
else if A_tote="tote 2" then set A_induct to 2
4 `2 [& ~1 H( \7 H( m else set A_induct to 3 " H6 Q$ Z; A/ W" s& {
set A_i to 0
* o H/ L* {: m- D# R @. w clone 1 load to P_induction
% ^6 T. m- P" D' Z4 T wait for A_time sec0 ` S/ J* W. }# M) C O6 j9 S3 K
end: [7 {* ?" m0 H
end
Q' d, `( [% O6 X4 m! r9 P
' Y- Z! X( L' W& \. f) G* J: xbegin P_induction arriving3 }4 l/ W- L, p4 X: M. M
if A_induct=1 then clone 1 load to P_pick1
# m% ~$ k6 |6 `9 d4 {, [ else if A_induct=2 then clone 1 load to P_pick2
( ?/ b( U" K8 A5 P else clone 1 load to P_pick31 n9 f* X6 X! F p0 T) J9 ^; I
end0 V! D5 M1 q! I+ D. ^3 D* q$ |
$ ^5 f _+ B$ ?' { s) O
begin P_pick1 arriving" A# L$ ^! C8 D# n
set A_i to 1% y% d8 |- l, T; ]+ W
move into Q_induct12 _ M0 f3 ^: ^+ }" E% B' `
move into pickaisle.induct1# j6 v% z: C5 B8 a. F( ]8 T" R
while A_i<=30 do begin- T2 M8 S" L# p
travel to pickaisle.con(A_i)8 H7 S3 _* P* r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 g% f% N# U7 v
else wait for 10 sec5 |6 f" X* p, C- Y) U
if A_i=A_leave then send to die
; D6 C9 j, h5 k% [6 `0 {2 D else inc A_i by 1
6 l2 b. P" _4 [; X end
0 e2 P l: J* O) u; ^end5 R& V# M0 `5 p5 e/ f
: J* B" V2 _! j: f
begin P_pick2 arriving& B: i! h5 @) Z; u& m" ?
set A_i to 113 V* H$ c- }( a. m4 f
move into Q_induct20 P& N- n4 o5 h1 O5 q8 x' R+ {7 ^
move into pickaisle.induct29 C; s; h6 v+ ?# `5 z
while A_i<=30 do begin
, q/ `- C9 g& C% S. a& X: Z( r0 T travel to pickaisle.con(A_i), S f% i* w$ y. o# v! F2 A$ m. i9 C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* \+ ?# N5 J/ ?
else wait for 10 sec4 Z" n" o+ t5 _: s2 K, z& Q
if A_i=A_leave then send to die
2 f# y* m- r% ?5 m, E else inc A_i by 19 g! R4 p7 c9 {5 E( {2 p
end$ Q: Y; z- M3 {$ K( t8 }
end: b' N2 e. Z1 T, k' A' I0 X: h, a
3 D; \5 t5 I- d/ c8 S% @begin P_pick3 arriving* }' l1 N h8 z z* ~! O6 o
set A_i to 21
Y& d S9 @% T6 Q& f) ^# @2 J/ m move into Q_induct3 P* W: S! ~: G: t4 Z* S
move into pickaisle.induct3
- }3 Q' @2 m( A( [/ I5 H9 i1 o while A_i<=30 do begin
% {0 \3 r& f3 | N: A9 `' V travel to pickaisle.con(A_i)5 B6 D! W- R; W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* o( Y% ^2 q! g) U* v3 ^ else wait for 10 sec
8 {! t# w) u- q+ Q' d/ c if A_i=A_leave then send to die- N& r9 S" ~7 G
else inc A_i by 1
6 C8 O( g4 p! M7 ?- u end
- a9 ?- U# t' z5 o; Eend |
最佳答案
查看完整内容
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,其它按你的 ...
|