|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 d$ A; m7 i/ z4 T
7 b, F! q+ s9 Q, P% C% ]# [( \我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 ~5 k1 t0 k8 L7 _! w$ k6 I' q6 [2 c1 W0 K3 Q
begin P_read arriving r& o& @1 O6 N2 _0 `
while 1=1 do begin: O$ w* }1 z& C! ]+ Z+ F: T
read A_tote from "data.txt" with delimiter "\n"
4 ]0 z3 L8 r6 p2 {6 s read A_time from "data.txt" with delimiter "\n"3 z* T% i8 P- r) R
read A_leave from "data.txt" with delimiter "\n"
( V2 L9 c* J+ O# r; ~ read A_picks from "data.txt" with delimiter "\n"
& V# a; C/ h* Y# s. _% j* N) Q. z set load type to A_tote7 Z; k9 o& k* J
if A_tote="tote 1" then set A_induct to 14 H8 u0 F# f& ?
else if A_tote="tote 2" then set A_induct to 2; @+ [' M- o: R/ d. B
else set A_induct to 3 # }: s; [( V8 E* k7 N
set A_i to 0* i9 d5 r5 f% Y( a; s. m
clone 1 load to P_induction3 p# j5 J2 v6 F6 t
wait for A_time sec0 @( Z$ v* L4 w! B( W
end
- y. U& [1 L* F; _6 ?- Rend
2 Y2 ^' X5 m- H! n8 Y, o0 N
, e1 P- W1 E3 |3 \ z( o y6 mbegin P_induction arriving
" E4 o2 W3 p( ^, E if A_induct=1 then clone 1 load to P_pick1) b7 Q$ z1 H# {$ e1 r) ^
else if A_induct=2 then clone 1 load to P_pick21 d, U$ a3 Y$ q+ h, r
else clone 1 load to P_pick3
3 \& K& F% z9 N$ qend4 V$ R3 v/ [5 m6 z& [/ g) d( H0 ~
) T, o0 \# [4 M. I/ z" Rbegin P_pick1 arriving6 x7 w! i* n) V% r" O; s0 D* p
set A_i to 1
: H1 @9 I3 c$ f& G) P# R/ i+ t move into Q_induct1! S e- U; i. w0 T8 ]
move into pickaisle.induct1
D; S8 L& P0 V \. i1 v+ m3 z while A_i<=30 do begin
. `2 |* ^4 i, }" x5 c" F1 q, G travel to pickaisle.con(A_i)! w. u: Y q+ T. X: R1 }5 o F$ W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ g1 n8 t6 s' Z3 \9 Z else wait for 10 sec0 k h+ M3 D, {! ~- c9 W
if A_i=A_leave then send to die( `, g0 G p; U$ p. a
else inc A_i by 1) c: H' a/ c: A+ O
end) d+ E0 O! F4 G0 c) Z! @
end
. d7 s, @/ }2 J) H
2 f+ Z* A- I0 a: F1 ybegin P_pick2 arriving5 g" G: F l9 q l
set A_i to 11
' `. S2 N9 M2 j- D: Z) D move into Q_induct2
- h" z0 V7 r* Y: s8 _# a move into pickaisle.induct2
4 v' R; z y( J$ S* Q while A_i<=30 do begin1 I2 A, I( r) ^
travel to pickaisle.con(A_i)
6 V/ J, }) J; J& \3 V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 N! M- n8 @" c% M+ t else wait for 10 sec& m5 w( D F3 a/ \
if A_i=A_leave then send to die
8 A$ A5 Q9 o: {5 t& x _ a else inc A_i by 14 o$ N0 H4 c$ y/ q' {
end1 _( a/ X' h! L$ K$ L: m0 O
end1 e% t% z; ~7 m, X' {$ J( a
# W; G \9 z4 s* h3 R3 k+ G' |
begin P_pick3 arriving
6 B3 m; J& P6 s set A_i to 21
& \% L0 X9 H; a- i6 U) ~ move into Q_induct35 W- T J! l# p- A0 [
move into pickaisle.induct3
# o' N) N6 t% O7 y while A_i<=30 do begin
5 t; A; N: \) x6 ?8 {$ d6 W travel to pickaisle.con(A_i)2 s: g- ^) i( L- V6 E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 `/ M3 E& w7 A1 e) ^ else wait for 10 sec& K3 N, d% w, o+ c2 ^7 Z( D- W
if A_i=A_leave then send to die
* G# x$ w" Y5 u \# H else inc A_i by 1/ ~8 E! f6 B! `
end
5 Y$ B/ G2 R+ J5 X$ [5 ]/ Wend |
最佳答案
查看完整内容
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,其它按你的 ...
|