|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- m) P4 ]. V" F. S
1 D/ ?6 s- ]" _) Z9 x: x
我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 Y+ x+ K" K4 n# D" |
) c: N% @2 s% R- e% n3 W3 xbegin P_read arriving3 w% g" ^& j5 J# K" K
while 1=1 do begin
$ J3 T. B0 A6 k& [* [ read A_tote from "data.txt" with delimiter "\n"+ o Y; c6 k9 t4 s9 Y b$ L: R4 Q
read A_time from "data.txt" with delimiter "\n"
, m- j/ ]2 x5 B: }* f7 n" W read A_leave from "data.txt" with delimiter "\n"4 j f% w2 V- c/ V3 p$ S
read A_picks from "data.txt" with delimiter "\n"
9 Y9 A( |3 Y+ L5 Z+ Q1 q; i set load type to A_tote* [$ G( u& l8 X# k, R) n
if A_tote="tote 1" then set A_induct to 1% p" |5 @$ k3 f/ |$ b
else if A_tote="tote 2" then set A_induct to 20 Z) P0 c( |! y' g6 B. e$ {3 E+ d
else set A_induct to 3
" K6 y, a0 L+ J3 T3 Y1 H+ k5 G7 X set A_i to 0. w w9 c$ R5 X' H9 }3 i
clone 1 load to P_induction3 Q6 m3 @; F/ N& J
wait for A_time sec
. ?5 x' ~* _4 p9 b: S" f& N' j1 V end
" {4 E- m: `3 N7 I3 iend
* _8 E, j! f0 c4 `. K" s+ N0 d8 u: ], r$ \" a, f
begin P_induction arriving; V( G, y& l' o. \
if A_induct=1 then clone 1 load to P_pick1+ B5 {9 m, f$ }) c p& _
else if A_induct=2 then clone 1 load to P_pick2
; F h2 [, h4 X# X/ ~* I5 v else clone 1 load to P_pick33 q( k2 U t0 ^$ ~0 Y0 ]6 F
end$ j4 l# a1 l) Z0 d" N. y
- w/ }1 S- X* h/ Ubegin P_pick1 arriving* U1 {. h# b/ O: r5 d
set A_i to 1/ \& u3 i4 B: K( w9 }/ R" s
move into Q_induct1
4 T z7 Q" p# u1 D* a move into pickaisle.induct1& c, i, b8 u' ^) q1 u
while A_i<=30 do begin" J# u9 c8 k) u1 E2 t G
travel to pickaisle.con(A_i)
7 B7 @; S! _5 {5 E0 v" m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, E4 _" T; j$ [9 f9 v1 r0 Q
else wait for 10 sec
2 w+ g0 I( W' J' E9 ?4 d* K if A_i=A_leave then send to die% \ U% l O6 i
else inc A_i by 1
7 O, Y# c- s) k8 D end
/ b- L% o9 s0 @5 _" {' Gend0 d' f& ^0 W3 d5 v' y ]& Z
R! o4 E/ G: w1 z6 ^3 h
begin P_pick2 arriving3 H) K/ v- ^5 i$ x' u
set A_i to 11
, d2 L) S4 Z$ Q& a5 ]7 f move into Q_induct2
" t9 K: K# p6 ?9 P: M( I5 R move into pickaisle.induct2% p% y. k( R+ K Z/ ?
while A_i<=30 do begin
& V" v' s# Z L' w. }( Y travel to pickaisle.con(A_i)
) m* {- i7 J0 _& k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 {/ Y1 y8 \, H else wait for 10 sec
7 `( c5 O' W9 H/ U' @0 C. | if A_i=A_leave then send to die
0 o! }& X9 A& c( w3 a4 X else inc A_i by 1
' ~4 {8 l. D( G* ^5 i7 p) X( z" [. F/ ^ end
/ ]& ]. \2 |1 p$ Q3 y1 g. ~+ A# Yend! V, `1 }! q# k. I; F) S4 b
, k0 a+ ^5 Q$ {3 u8 ?begin P_pick3 arriving- {- ]6 |$ ` t4 g& u4 j8 P. Y$ [
set A_i to 21
! S2 s7 Q$ d$ h4 o move into Q_induct3+ S+ ]5 S/ W# R8 q# N5 ?
move into pickaisle.induct3
, u8 e' N3 R- K" W while A_i<=30 do begin, H2 X$ v4 o- d, J+ p* G4 C
travel to pickaisle.con(A_i)6 c" x4 ?# R" }1 V% y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 j% B Q2 u8 p" M0 d& l) y else wait for 10 sec
9 m8 j( [9 U$ A if A_i=A_leave then send to die2 @8 z/ h1 n5 I) `# x
else inc A_i by 1
- Q9 \7 M1 M+ Z8 g: M% p6 }' E" _ end8 r1 I+ ~. [) y" F
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,其它按你的 ...
|