|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
G/ C" e {- u) b% h, l( V* U- M
# [: L6 ]. f9 R) J我的问题是,在每个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中的数值,不知道会不会有什么不妥。
p) ^; U4 H* U! R* B1 g- B/ [- J8 ]
begin P_read arriving
- g( O" \* F& V/ [7 O while 1=1 do begin5 ?) i1 J. \; B$ l7 Z8 O% M- A. y( ?
read A_tote from "data.txt" with delimiter "\n"0 h! g) P* d1 m! P' _
read A_time from "data.txt" with delimiter "\n"
9 G5 i9 E; g$ s ^7 g$ n( n read A_leave from "data.txt" with delimiter "\n"
" j; d4 n: P& ?# K7 f2 {+ s, | read A_picks from "data.txt" with delimiter "\n"% r0 L/ I! ?) ]- D7 N. n
set load type to A_tote
! {5 @, s, E) o: g" V if A_tote="tote 1" then set A_induct to 1, ?3 c- R; E4 @+ Q8 n* r
else if A_tote="tote 2" then set A_induct to 24 f) o4 Y$ {3 m6 }
else set A_induct to 3
; u( ~& y2 q4 q z( \ set A_i to 0
9 u B$ G7 v- {, q$ w- t1 D- |6 w1 w clone 1 load to P_induction
7 F8 C5 S! F/ Y# W% e7 ]3 I% p wait for A_time sec
0 e' a9 G6 _# \% ?2 o; I5 m' X# p) A end
/ m/ W# R) P5 S" Uend
) G, p8 L: u9 H+ l( `) I9 N
6 @, e" z, s$ N. ^" d& T. I( W, Nbegin P_induction arriving/ X% f+ Q+ S4 a, @. R3 H: [& d
if A_induct=1 then clone 1 load to P_pick1
4 V8 y9 U9 `" }9 p& d% y2 W$ L9 c& O else if A_induct=2 then clone 1 load to P_pick2
+ }) _- r5 n7 H! ]" r. C else clone 1 load to P_pick3
' Q) c, j. `" |* Q& |# Dend# M/ o1 M/ N) b
* V' z+ ~9 ^3 P$ E6 c3 Nbegin P_pick1 arriving1 b6 m! b4 n/ x9 I; R" V5 E% D
set A_i to 1* r1 p; O0 c' `7 C! ]. }- l
move into Q_induct1
: q7 U ~( m/ c. l7 { move into pickaisle.induct1; s/ l, X9 t' s" U$ n
while A_i<=30 do begin. f" r0 }4 l* W/ v" U2 s: O" k0 e0 Y
travel to pickaisle.con(A_i). \7 r/ U5 t% i# c5 D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec B0 o( N* `* r. Z$ g5 G3 v
else wait for 10 sec
0 Q3 u, O2 P1 \& r* | if A_i=A_leave then send to die+ d$ O# p; B) p1 w4 k
else inc A_i by 1) F) I* a$ ] t3 Z/ t: k( l1 K
end
6 i. {6 Q/ M# d4 [3 e2 Aend" I2 J* S, V. o( N6 ]( V4 Z. m! `4 i( M
. Z$ d) s! K1 {begin P_pick2 arriving; f8 s( m. v6 B1 e3 z0 \
set A_i to 11
# E4 S; Y; g k8 W move into Q_induct2
. v" x% g! q. F" @! c move into pickaisle.induct2' d9 _% {. P2 ~
while A_i<=30 do begin' C7 B( i2 ?4 i& P/ T' {4 Z
travel to pickaisle.con(A_i)5 T7 c6 H3 m4 @" E4 B+ l- P% o8 [( J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 F, V7 Y! d2 S2 C. X else wait for 10 sec
+ w6 e0 _/ F4 z7 z& B( C if A_i=A_leave then send to die
?9 y+ f! ^+ j- V! {1 Z' _9 y' @% e else inc A_i by 1
0 U7 X2 D; e2 {( t$ `9 I% n end
8 K6 }" Q. {0 B: W7 _end' N3 o; K, S; R* U
" C5 T' `' Z% B4 r! a: n. _
begin P_pick3 arriving. }- O: y! X3 ` E
set A_i to 21
9 L6 \ Z0 E+ s6 E move into Q_induct3& O2 h. R0 F- V' V4 B
move into pickaisle.induct3- n4 C" U, Z& ?. x4 r8 Y
while A_i<=30 do begin K. ]& F7 z( ?) F
travel to pickaisle.con(A_i)
0 h6 @0 p1 A3 Z) ~3 Q0 m. E j9 ? if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* M+ e4 W8 A, _) B else wait for 10 sec
6 y- q) @0 T+ j0 A: r2 {$ V if A_i=A_leave then send to die
% b5 F/ `! A' w* O else inc A_i by 11 X; k, P8 D+ M$ @5 }; A
end4 T% x' ]. \. 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,其它按你的 ...
|