|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 _4 t' I& B7 v7 b+ Z0 @7 v6 Z4 V* W4 n& r
我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 A. R2 L8 c T
; u- U. \9 ]0 I, H/ s' O+ P b0 P
begin P_read arriving0 F x! X& d9 b+ f. d
while 1=1 do begin
& R3 @8 u. a( h* F# c read A_tote from "data.txt" with delimiter "\n"7 c4 D2 @+ @" k! W, d& h2 j
read A_time from "data.txt" with delimiter "\n"
0 { t" \; Q( n+ t read A_leave from "data.txt" with delimiter "\n"
" P& ^9 `6 O) F) \% B. o( n* F* A read A_picks from "data.txt" with delimiter "\n"" i7 C5 C9 c% ~; b8 } I- \
set load type to A_tote
6 r" I! ?2 H+ r) g* s8 f if A_tote="tote 1" then set A_induct to 1
f3 Q& l) E W! |) W else if A_tote="tote 2" then set A_induct to 2
; p$ ]: N& J- U2 ? else set A_induct to 3
7 L$ F& J6 N4 P, T set A_i to 0
& P0 T- D) u X' i clone 1 load to P_induction% p, B9 m m+ e# J* U
wait for A_time sec
- s5 F) ?7 k. J$ B$ h$ L) W end! M2 V6 G4 `0 D- ?' r
end
" d0 H' |1 A8 L- l }3 ]
$ }: o8 ?5 p4 s3 |# ] { d* Gbegin P_induction arriving
5 I8 K8 z$ P/ l& R0 r! T if A_induct=1 then clone 1 load to P_pick1; y5 K4 a# G/ F) Z# v- `* ?; k
else if A_induct=2 then clone 1 load to P_pick2
3 D. |9 M9 L3 j3 y: O3 I; Y/ m, B else clone 1 load to P_pick3# H, h$ M( W9 t+ K; r5 h" V: F% e
end
; R1 K/ p+ W- j
- i/ s9 ]+ @8 S) t& dbegin P_pick1 arriving) }$ R7 S1 I6 C2 o; g, T$ R
set A_i to 1& M: \' g/ t& _; V" Y
move into Q_induct1
4 Z8 h) e2 s$ A& a, u4 f1 O+ I move into pickaisle.induct1
7 \3 G V( I4 h3 k while A_i<=30 do begin
4 \/ x& D0 [2 ~ g f3 p5 u travel to pickaisle.con(A_i)9 {5 ^9 I n% g: X
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. M0 ]9 ?. {" D" x* V6 V1 g9 k3 d else wait for 10 sec
# ?0 ], @: b1 u2 m# m; h if A_i=A_leave then send to die. v: ]. f. M. H4 A W" v( c6 Q
else inc A_i by 1
; x7 a1 V/ w; m. E4 [ end% B O" E7 J; C0 Q5 P* m8 S; x. b
end- s9 `/ U3 A% _# `' U
' Q. H( s8 w! o4 J+ T
begin P_pick2 arriving1 Z& i8 Y5 a3 W: g9 O
set A_i to 11
& z' n& p6 p' g9 G5 J move into Q_induct2
! E" f2 e, c+ Y- b" a) G move into pickaisle.induct2
; z0 e6 Q- L; _: c) e while A_i<=30 do begin) o5 N7 g# x: `
travel to pickaisle.con(A_i)
/ d | i# p) ]: M/ k2 x if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. r" L) T6 a: ~) B+ d+ A else wait for 10 sec
+ z# E. K. u6 V% D if A_i=A_leave then send to die
z/ |% S4 S8 c _" D( t! m else inc A_i by 1, l2 c' @: Y6 |; L! c. z
end
9 s/ b7 X) c* H4 pend" s! Y1 S7 P6 g5 y3 M6 ]8 {
( L% t% T3 m3 n9 v jbegin P_pick3 arriving
9 `- v# F% U6 |8 S. B% `( U set A_i to 21
' p) @7 x0 }" o- p# U. |+ [ move into Q_induct3
5 R% p4 x9 P- D/ z% K9 i move into pickaisle.induct3" K/ t( l' p9 s5 Z- Q
while A_i<=30 do begin
' [$ h2 \/ L5 H+ R- p* i% I- Y, K3 ~5 h% f travel to pickaisle.con(A_i)2 j" a; n/ N7 _; `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 Y L2 H- {5 E' w, f- L: C
else wait for 10 sec
. \! N2 q r$ L5 g [1 K/ k/ }8 j9 e if A_i=A_leave then send to die. z+ N. _! `6 U4 s( L
else inc A_i by 1' I; O" m! y* X- L
end
3 U2 F6 ~' I2 M! qend |
最佳答案
查看完整内容
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,其它按你的 ...
|