|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: S4 X/ f1 Y! J8 P$ K0 i2 W" d/ v G
/ w9 W! w/ |; @我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, `3 `4 o$ k( W- W
5 [) @# l& L; Y5 I: t& X# _begin P_read arriving0 Q! [% r; G9 B" f8 J# F& x
while 1=1 do begin" u- T& z& ?2 |) D8 @. E( R1 e( P; p
read A_tote from "data.txt" with delimiter "\n"/ p! t+ X& T5 P; Z' p
read A_time from "data.txt" with delimiter "\n"
% X, }% D! X2 n. |( f read A_leave from "data.txt" with delimiter "\n"! y: S% p. }) G" a9 |" f7 I& G
read A_picks from "data.txt" with delimiter "\n"
4 l; d9 L. Z4 b4 C set load type to A_tote
* B6 N! M% N b8 h! o3 z2 L if A_tote="tote 1" then set A_induct to 1
% x3 S5 t- I7 F8 B& g else if A_tote="tote 2" then set A_induct to 2( x- u& O5 C1 s4 x& n
else set A_induct to 3
8 H! s5 g5 W! g) A; d set A_i to 0
' g1 R) s" d! m6 L, x clone 1 load to P_induction! l' w" s/ P: v: v1 L: Y' U$ E, e
wait for A_time sec. a3 _7 n' W( w# N# G2 t. E# Y4 T
end" g7 L* j1 N* b0 c8 k
end x2 X7 [+ W0 o4 ~# v5 A: m
W/ B& l/ n! N2 A6 Qbegin P_induction arriving* Z$ x0 u9 m8 E: Y
if A_induct=1 then clone 1 load to P_pick12 d- ]9 `2 r3 Y: p" @/ J7 O
else if A_induct=2 then clone 1 load to P_pick2
" F. F9 N- t% a# D" [; c6 x else clone 1 load to P_pick3
" Z. t/ n" U1 f# ]; h* C, U) s. mend5 Z) ^5 {7 N* |1 v" u6 o
' t" ?+ t, t9 d7 K' {
begin P_pick1 arriving
4 P% ^1 Z$ `4 [( Y1 X y2 c. W9 [ set A_i to 1
& t1 m9 i; Q& [ move into Q_induct1: O/ N) R% I+ _8 f# `% Z; Z
move into pickaisle.induct1
0 G) d7 R# `, a while A_i<=30 do begin
0 e! D; T; }! j) }" \/ O travel to pickaisle.con(A_i)
& q* y( N3 O/ ^! U: \/ L4 d1 ^6 E if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 M1 }0 e. ^; Y& |' a
else wait for 10 sec9 C6 R( J% d. W
if A_i=A_leave then send to die1 z: s& L& g3 _6 V
else inc A_i by 1# \: x. B5 u* ?, w ?- z" `
end( k+ z! L' S: Z
end5 p7 q# [) i1 i6 E% b
7 W. T. ]$ R3 k' x" B/ mbegin P_pick2 arriving
4 p1 k" E5 W) N% R' H5 a/ K set A_i to 11
, t6 ^1 p4 R$ T( M move into Q_induct2
9 x2 W! ~/ e3 A1 E$ V1 J) W move into pickaisle.induct2
7 X1 U7 L. F5 r, ?8 L' o8 r while A_i<=30 do begin+ p$ [8 v0 W& T! }( m1 ] B/ S
travel to pickaisle.con(A_i)6 B% q0 U2 \ G6 e- c& v, v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 y$ e* [# @- F8 b# q7 K/ X
else wait for 10 sec
/ d5 E% d& | x9 n1 { P if A_i=A_leave then send to die' V$ n2 U1 H* q
else inc A_i by 1
- l" y, @6 }1 A' K end
; `% o/ p8 C" _" L1 m c5 aend
5 S! Z/ P& Y. `6 {/ v: s! _" g! z; u' N S$ S& R: q
begin P_pick3 arriving# l: o; Q$ a0 o: ~
set A_i to 219 t( @% d" v# K) |& _) S2 R( g
move into Q_induct3
% \; F- R! @$ U* H move into pickaisle.induct3: T' K4 w5 q7 t* t: _
while A_i<=30 do begin" V& G/ l4 }% C+ @8 K- e' }
travel to pickaisle.con(A_i)$ ^0 C! s& w# ?: X' `- k- v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- g0 _8 v+ ]! ~' l6 b
else wait for 10 sec
% k. M( e% e! U- m2 f if A_i=A_leave then send to die
6 l% ?& E# T0 K, o9 z" n2 H/ w else inc A_i by 1
' q0 p \; x6 q4 d" F end
1 j8 b0 r( ~+ L6 M, C' ]5 X% Zend |
最佳答案
查看完整内容
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,其它按你的 ...
|