|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, q3 u0 F" [; x1 F& d8 t; A
! p3 Z; P0 j5 `6 O: m) g我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 _' A+ r7 r% p1 V' _, y1 d
0 c. g+ W& y( u( Z. _. J
begin P_read arriving7 P% z3 l* y. R5 f+ q" Z
while 1=1 do begin
_/ z6 r' g9 ]: T, M8 ?( e read A_tote from "data.txt" with delimiter "\n": V5 a( t5 j# h5 Y9 v/ f4 [0 Z
read A_time from "data.txt" with delimiter "\n"
$ {. t. b7 Q9 ~# { read A_leave from "data.txt" with delimiter "\n"7 s* Z+ I. [( ~' ~% f$ d
read A_picks from "data.txt" with delimiter "\n"
( V* F( l! ?- u6 S3 O; ` set load type to A_tote
6 v4 q! e) j9 | if A_tote="tote 1" then set A_induct to 1
8 d Z* i5 y8 [ else if A_tote="tote 2" then set A_induct to 2
0 o6 q- z4 A, ^% P else set A_induct to 3
: g/ D3 ]3 W: r) K* l4 V set A_i to 0
0 N! y; D' h7 L& a) k- q7 x( ` clone 1 load to P_induction" @9 L+ U( K' {0 `; U5 e
wait for A_time sec
- I, J4 H8 S1 m end3 X5 _% r8 U0 t% p {
end# p# t6 S- F5 k- }6 F' K O5 G
- o \; q: ?/ I2 Y/ u0 B
begin P_induction arriving: G0 f5 O+ G7 G; g& u3 E) H$ z
if A_induct=1 then clone 1 load to P_pick12 G2 Z1 C% f' A+ K
else if A_induct=2 then clone 1 load to P_pick28 A) M4 Y! `3 o1 F4 E
else clone 1 load to P_pick3
( M1 B' N) h( k" H; e- e4 P; N+ Lend4 V- x$ g3 F) j
' _, l5 F- K- y$ pbegin P_pick1 arriving* t$ b; a5 @5 x2 T+ e
set A_i to 1/ F/ X$ o+ Z. p) h9 I {: `
move into Q_induct1" I% \/ c) A' o" i, Z( L6 j/ v, @
move into pickaisle.induct1
* e% x0 u3 H% o& m while A_i<=30 do begin- |; c6 s" [. ^4 h) Y
travel to pickaisle.con(A_i)& r5 V& T$ e* U! ^9 X; K) M
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 V2 D( o* \% s, v# m3 E7 z' q+ ] else wait for 10 sec+ |5 b! E- C; F8 f0 a/ i, Y7 L
if A_i=A_leave then send to die
8 U: \5 ?7 D; d else inc A_i by 1; ^# B+ d# @! b- ]7 o3 v
end7 T: q6 j% ~# ]( F+ b+ ] d) w
end# P7 l) \2 X) F$ V' d, ^7 K
* U/ j% ^; D% d0 P
begin P_pick2 arriving, l1 U) n& N7 H6 C# I: j
set A_i to 11' Z2 T) `/ @! `5 s% \ U
move into Q_induct2
$ R% t) {/ d* f V move into pickaisle.induct2
! u$ K7 F8 v# X: C8 G4 x- j while A_i<=30 do begin- U: u8 Q7 Y z' K
travel to pickaisle.con(A_i)
, ]9 Y! ?+ ?" g& Z# R) c( F if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& e- [9 f: S; W3 p! Y1 t k& A else wait for 10 sec* A3 H* ^$ F% j, ~ U2 s
if A_i=A_leave then send to die
! H7 \# }3 c( } p8 K, z else inc A_i by 1( C- [ X) R! }: o
end5 F1 O0 f2 i$ v9 f- }0 t
end
0 Y* W& R( c6 s" I W# {; ~3 p! U5 Q; B0 a5 h5 i
begin P_pick3 arriving
* Z3 g% f4 J* r8 i( v set A_i to 21
( C9 R% t# m1 ^6 |+ Z move into Q_induct3
$ V7 j# v( W- S! J+ W move into pickaisle.induct3
& w7 Q) d5 S& C7 X& [ while A_i<=30 do begin
3 @ t4 I3 h' d0 \: h travel to pickaisle.con(A_i)
3 j, h T1 Y- V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& s2 d& P4 |. K" m( D; S
else wait for 10 sec
4 b1 \$ |$ R# q( \8 Y if A_i=A_leave then send to die! B: w# `, ^! r
else inc A_i by 1; ]- q- r1 b, O
end
7 p% J0 }# T' z2 v( aend |
最佳答案
查看完整内容
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,其它按你的 ...
|