|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 X5 \0 P+ C0 V6 }& N( L: u
1 @7 K8 N/ r8 @我的问题是,在每个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中的数值,不知道会不会有什么不妥。: F! S& U$ u- U( x7 A% H- p% d+ v
* e( [, s( k. A$ Jbegin P_read arriving8 o: i8 S& w' E0 `0 v2 O# t
while 1=1 do begin7 j+ ? I$ s( g5 L" y) v
read A_tote from "data.txt" with delimiter "\n"
$ [! L4 j2 A& P3 x5 g# i$ k read A_time from "data.txt" with delimiter "\n") ^; p8 E( @* P* m' H& g
read A_leave from "data.txt" with delimiter "\n"
: D2 M, k2 e# z! T& t! @$ E, k) W read A_picks from "data.txt" with delimiter "\n"
3 b' U( P- Z# S A+ J set load type to A_tote( `8 Q5 ?1 P* j$ a& o
if A_tote="tote 1" then set A_induct to 15 x9 Y3 |7 E4 w7 G
else if A_tote="tote 2" then set A_induct to 2. S$ `' P5 D* Z: S
else set A_induct to 3
$ V1 D7 c$ V& v+ U) _( U& A set A_i to 0
1 z/ v6 e0 E6 W2 X5 U clone 1 load to P_induction+ X5 z/ v* v7 ?2 Q& o" m5 {4 [
wait for A_time sec
0 H0 H: T5 I t4 {; @: N end
7 k$ g' C& j1 D4 U, v& `6 eend& F( b" k a) A. b! i' ?- h& O5 i8 h
6 E7 `0 N; |' F* Z/ ]
begin P_induction arriving: ^2 ^, b+ A( G8 P) u3 R( x
if A_induct=1 then clone 1 load to P_pick1
, s* M: p" K- U9 ?- { else if A_induct=2 then clone 1 load to P_pick2$ \2 N; D' k6 f/ m% n. u
else clone 1 load to P_pick3% P w8 a* y7 X5 I+ v
end5 D0 y, \/ Y, x# Y; v" _# o
. Y6 O- v# s. R3 A/ N1 Abegin P_pick1 arriving8 a/ q9 r6 N3 a' {7 K! W W
set A_i to 1; K; B; R d' U
move into Q_induct1
; R; W! @$ W& T/ \; e: D move into pickaisle.induct19 O* T5 B" T% h# `. H8 t8 R( I: G
while A_i<=30 do begin8 u; P4 G5 n, i+ L) f! J& A p% r0 a
travel to pickaisle.con(A_i)
3 e3 B; m8 W" Y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ D' ^: {4 I' q# s. A- o$ i! U
else wait for 10 sec
4 L0 R/ n' w3 V( x if A_i=A_leave then send to die
3 j' s+ i0 _$ d' H, w8 u else inc A_i by 1& Q* _/ E; O' {, C
end
4 V0 w5 v* y# I" Pend, g) E/ x+ ~: N" k% D. R
3 l% x) H) `1 j- c$ C# r/ pbegin P_pick2 arriving* m5 S, l* a8 `9 l/ A% j( t2 w
set A_i to 11
5 J5 F$ r. Z+ ` move into Q_induct2
$ D0 V X/ B7 y3 q( J, Y% K1 j5 [3 z move into pickaisle.induct2' k) p6 S2 u. ?2 t v) L" I
while A_i<=30 do begin. {2 i" H6 e* }* E- ]8 B/ ]% a
travel to pickaisle.con(A_i)% Z: H* A4 C6 B- d2 _, Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) C" A! _. x2 c9 R" i else wait for 10 sec/ {5 I7 o6 _0 Z
if A_i=A_leave then send to die1 E4 n$ k6 a0 X; ]; i
else inc A_i by 1
1 X ^( N9 ]! {) M# M) [8 b: N end- p8 A# Y9 W& n: V( S
end
. a8 C& c9 ?; }! O& n1 j! M& N5 _. i# S! F
begin P_pick3 arriving
) G, L9 R/ M/ ^# ?! Z& y+ X; q/ d set A_i to 219 m+ y8 B; `: s5 v
move into Q_induct3
# s6 ~1 q$ E; r" S move into pickaisle.induct31 p5 P/ @ T" `$ J
while A_i<=30 do begin
, c, ~$ I& O! y- N+ X! @ y( O travel to pickaisle.con(A_i)
7 u+ _2 g1 g5 ]4 i6 N9 e3 Z7 |! @ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( u! R( B% Y6 O8 \# V else wait for 10 sec1 v/ w+ ~2 o5 x7 E/ D9 C
if A_i=A_leave then send to die
, k# }: v" @8 c else inc A_i by 1& x& q: v* A5 e2 O
end
/ Y$ j- t$ Z( y# Oend |
最佳答案
查看完整内容
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,其它按你的 ...
|