|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. s, J2 ]' D& W$ H5 ~
+ H( t z' u6 `- P5 A& l+ T
我的问题是,在每个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 e& C- I3 d# \1 T! F% o8 p" A. ]7 V7 S( E! p+ O
begin P_read arriving
4 ?8 s7 _; g6 G" i) ?& W" Y1 o while 1=1 do begin# `" V, A/ ~+ ~
read A_tote from "data.txt" with delimiter "\n"
1 p; p3 v+ s9 o, \ read A_time from "data.txt" with delimiter "\n"
' _# L9 w" A+ j% l4 }' d read A_leave from "data.txt" with delimiter "\n"" X# P6 H! d. O- l$ x! J/ I9 B
read A_picks from "data.txt" with delimiter "\n"
2 B, }! s' `* Y) R4 T" E' M; J set load type to A_tote' i( |+ N& o4 ?
if A_tote="tote 1" then set A_induct to 1$ Q j3 R* t+ D" \
else if A_tote="tote 2" then set A_induct to 2
" w! X" t8 j& J" U9 N* a; r0 Y7 W else set A_induct to 3 & ^/ p" A) F- [/ F$ w
set A_i to 0
" `) T# k; l r5 X Z8 |# J9 q clone 1 load to P_induction c9 J% y/ F. Q/ E6 m" W
wait for A_time sec
* l2 ]9 A @5 A {7 ?2 M& Q end4 X! D/ x g S0 y" q' T5 A
end* t5 x- L' }4 x9 G
- Z3 t: h$ H' Y) _
begin P_induction arriving
" \/ A' O% A" [9 a if A_induct=1 then clone 1 load to P_pick1+ D% V" S1 ?9 k7 w7 o3 T. _9 {6 O
else if A_induct=2 then clone 1 load to P_pick2
. H) Q- \$ a0 W: ] else clone 1 load to P_pick3
5 @% D% Y' W$ k x. g- u; r4 h: Y. ?end
% m \+ R4 p) ?8 f" e7 g
6 h" r% ~7 O4 s$ F1 j; Y$ C7 kbegin P_pick1 arriving; o: Z+ X& `+ Z, [ \0 }+ H
set A_i to 1
; {! u: o6 T0 m) |& O- u& n move into Q_induct1; x* l8 P( s& x/ Q" p( F5 g' O
move into pickaisle.induct1
9 R- F) d! g/ ^8 b4 t' `3 n/ J while A_i<=30 do begin+ N' A! }) Z- m- V& z/ z+ _
travel to pickaisle.con(A_i) o+ c0 ^3 d! p; M8 D5 O5 W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ Z5 c* u/ S6 K$ ?) m4 I$ m3 P
else wait for 10 sec1 a/ W3 p8 V1 i% a& R# G
if A_i=A_leave then send to die
9 Q/ o0 R9 }% r* Z7 `& h' L else inc A_i by 1
5 h8 \( p0 N. K6 C' ` end
3 |5 X7 F" \ d* ?" ~8 D1 ~5 _' D( tend3 _7 b: ?6 I& z
6 v0 {2 n: N8 t" S2 _
begin P_pick2 arriving. b; m" C% `6 M
set A_i to 119 ^+ H1 [& {0 S/ {) O
move into Q_induct2
) z- s; I. X" t" R move into pickaisle.induct2# h8 s8 I; N* B% C: F! W* ~
while A_i<=30 do begin
7 n+ d, U0 Y4 h/ \- L( U2 R travel to pickaisle.con(A_i)
7 @# c* c5 X! S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# W9 ~" ?/ w% r% f* m
else wait for 10 sec
$ R! Q% v4 s& \% |. G( S if A_i=A_leave then send to die
, ~" H- h, e% `' W3 I' K2 y else inc A_i by 1. t& M U. w7 ^" _$ X2 Z
end. Y3 z, I. `: G6 { I
end
" q' @& p0 f Z) r% h% M' ^: B: K( \( a# n! j% e/ ^6 _7 t
begin P_pick3 arriving
/ Y4 @$ p8 P) m+ l7 t3 [ set A_i to 21; P7 W; W, {1 ] k7 F. Y3 o; O. F
move into Q_induct3
( U; W( t8 J1 H f8 _/ w move into pickaisle.induct3
! B' x( e8 K1 h8 e while A_i<=30 do begin2 E3 p# Z5 B! j8 @/ y4 Z
travel to pickaisle.con(A_i)
# W0 O$ i) E. t0 n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& n' k, e$ _7 n else wait for 10 sec
, `6 K! q) I$ t6 |' @ if A_i=A_leave then send to die' W3 L3 `8 i/ G6 B$ y: S9 f6 R
else inc A_i by 1
9 o& y+ f, b' \ end
% s: l/ h1 l# @; @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,其它按你的 ...
|