|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 @( a: i4 Z* B$ ~
2 W" @( W* u1 f% ^# h8 O9 F2 e我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( @5 e5 r( g V8 j* a. X! P( H1 O
" C4 Z) F8 p4 B& m" qbegin P_read arriving3 u5 ^/ A# D9 e* R# N
while 1=1 do begin
+ Z* O" [7 F/ P2 ?4 M2 d$ X% F read A_tote from "data.txt" with delimiter "\n"
$ Z2 O2 K' f1 K, i1 m) ]* C read A_time from "data.txt" with delimiter "\n"9 z6 Q0 U9 o1 s" n$ F
read A_leave from "data.txt" with delimiter "\n"
( B4 k! \" X9 g" p read A_picks from "data.txt" with delimiter "\n"
/ }+ t. H% j; ?3 u set load type to A_tote: N s1 j5 O% r2 v9 e4 d4 T
if A_tote="tote 1" then set A_induct to 1# U9 p- o) \5 f6 b- B. t4 U
else if A_tote="tote 2" then set A_induct to 2
3 m! S+ N2 J! \- e" J2 F else set A_induct to 3
6 z) `/ r$ Y3 p7 _9 n set A_i to 0! }0 l. j! S" D! q5 L; j) B; ^
clone 1 load to P_induction
! R$ B, o9 X6 q& j0 v2 W9 Z wait for A_time sec+ y& @) r+ L' D2 Q% w5 e7 `6 e4 p/ e
end
4 O3 L; @0 Y" {" D' Z% p6 v& yend
9 ^! x3 ?. \6 e! _
, c. Y' C' U* l+ p( [( \begin P_induction arriving1 h$ N) b0 Q1 {- \3 F( B& t
if A_induct=1 then clone 1 load to P_pick14 _2 b1 j$ _. t6 A) W$ t# O1 Z
else if A_induct=2 then clone 1 load to P_pick2
+ F4 }) q. M. P. n# e/ n7 c5 E else clone 1 load to P_pick31 {9 V, [* s+ {4 A
end
2 E7 h. \- k6 Z1 X
: A5 W& ~: z0 A {" [+ nbegin P_pick1 arriving
& L( q9 [+ g+ {) X+ d set A_i to 1
( e1 j, e6 W8 w' h move into Q_induct1 w5 u: d2 h+ t
move into pickaisle.induct1' \' }3 R, Y9 ^: d. F
while A_i<=30 do begin
$ c& U( Y* e# A travel to pickaisle.con(A_i)8 v4 L- k; t9 {8 @! {3 @' b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 e/ y7 b7 k% g% j9 x
else wait for 10 sec% e5 z4 V7 y! d; z+ x o
if A_i=A_leave then send to die% Q/ W9 v5 X4 s# |: {7 t# G
else inc A_i by 10 u( m9 p) R) J0 H
end/ u" ^0 P) A) Y8 S. i, l
end; X f3 {, X7 L7 v: k
2 F: ~1 ]1 }! |" n# @1 q" lbegin P_pick2 arriving1 Y, C2 @* X2 N% f1 P; d
set A_i to 11
0 U. X# @9 A7 _- A8 K# ?# Q move into Q_induct2
! N5 Q5 b7 J: G8 Y move into pickaisle.induct2" a* X" e4 H* i1 l2 f( o6 X
while A_i<=30 do begin+ ^$ X* u) b6 P8 j' w. C
travel to pickaisle.con(A_i)" ^0 Z( g8 W* `- A4 O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, K# z; `' S% R else wait for 10 sec$ M& C T( I! Y: ?1 e- B4 |
if A_i=A_leave then send to die! ?2 K* j( Y7 z p* z+ q
else inc A_i by 10 |) z3 c' @: S$ Q. E+ g9 s
end
0 M- X% H$ R/ }7 \7 q$ q# Y% pend* U# z) O* m: t/ d! q" ?
0 B7 j2 k- m! _' d3 u
begin P_pick3 arriving8 o. {# A8 c7 ]! T! Y
set A_i to 21
H$ ]2 |. K1 j, j4 j8 x+ s move into Q_induct31 F1 I" f9 B4 ?( s' c P1 r, i" I
move into pickaisle.induct3
" v" b! e$ z' v6 a& u while A_i<=30 do begin* h: i/ C6 C" _$ D
travel to pickaisle.con(A_i)
8 a$ I) v- p) u$ j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 {! u4 t$ h5 Q+ f% _5 \ else wait for 10 sec3 f; V9 b" C; r; p1 F8 l+ A
if A_i=A_leave then send to die( D" Y" j+ T: w* O4 U8 |$ C
else inc A_i by 1
( s' H4 W6 j# x" |+ r end3 v* g j+ d) l# r0 P: O* Y
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,其它按你的 ...
|