|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ f: j! _5 i1 ~& l, |1 y
7 [) O( {9 V& q" K5 p8 I我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 ^" S' l, y u) u: Q& |6 P; J
3 P( K) m. s: M* [" k' ]6 M
begin P_read arriving
# Z! x {) [; Q0 B# |& z' n( ~3 M9 p8 r# z while 1=1 do begin
, S1 F4 v5 L5 M0 O' L read A_tote from "data.txt" with delimiter "\n"
0 b! ^: X% a" ^. W/ g) h6 u read A_time from "data.txt" with delimiter "\n") H: p5 W3 |% B) g! Z, M: G& R
read A_leave from "data.txt" with delimiter "\n"
" E0 j ?: [2 ]$ Q3 T4 V' K& O read A_picks from "data.txt" with delimiter "\n"
# y8 N8 D& G0 I/ Q$ X) h H set load type to A_tote1 h* k" e8 x: x3 M# n8 b$ `
if A_tote="tote 1" then set A_induct to 1
+ @- @% |" n. h: x; K: N else if A_tote="tote 2" then set A_induct to 2
/ P2 t, }8 u, D9 ]) W else set A_induct to 3
* K) s, z1 C( Y, Z" b set A_i to 0
7 ]1 T- I, f0 i: c: ~5 f! q clone 1 load to P_induction
2 y3 J2 y1 P/ ~. r) L wait for A_time sec z G8 o( c h7 X% }- _9 ^
end. q2 L% \- C' l P
end3 }7 l& o$ v7 I% L+ X! N- c
: B0 x/ d2 I- m- C% lbegin P_induction arriving
& H; e$ g6 ?- [/ c' u- k if A_induct=1 then clone 1 load to P_pick1* D, ~; c/ F# Z8 A
else if A_induct=2 then clone 1 load to P_pick2( S+ q0 ?( V4 h" O) H, O
else clone 1 load to P_pick38 P1 N) Y) E* Q# d6 y' S5 \) N& @
end _: ?7 ?8 H7 R+ }7 }* ^: J
- j9 u8 `- T8 q" j; V+ D, y
begin P_pick1 arriving& w4 | J% W u! \; _- {
set A_i to 1
c% w0 u4 V4 m- R) V move into Q_induct1. K& L8 t! f% X( ~- W( ^( c
move into pickaisle.induct13 }0 o& M) S; q5 `# e
while A_i<=30 do begin
/ ~! p) d3 u2 |* p% q4 c1 i travel to pickaisle.con(A_i)# L' ?+ {- u) @2 Y% K2 F
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& S" x9 O- u% w: v1 X
else wait for 10 sec
: l" {; q/ I& h+ v0 L$ d if A_i=A_leave then send to die
4 a! V! Y$ g2 M( e" ~- I5 R else inc A_i by 1
. K0 k) i( i; o5 f end) R1 J6 ]& [* ^& v+ z0 C
end
9 H& T: S7 q4 C' D/ N
, z3 N( r" G. C- ^/ n# ebegin P_pick2 arriving
2 z1 C4 M: l- z set A_i to 11
$ I: M: \* X. a% [/ g" E8 q move into Q_induct2' E' a1 [8 N- N$ j t: k! A2 d
move into pickaisle.induct2
4 m+ d6 B( i2 @7 A; i5 J& O# _ while A_i<=30 do begin+ c) W8 i: _$ S7 p' F0 f/ ^
travel to pickaisle.con(A_i)
) f( N/ g7 N5 A( b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 t- F' U' P" I2 |
else wait for 10 sec
1 n4 x( i& @. B$ l5 n6 n if A_i=A_leave then send to die k6 K' ], U, T. u
else inc A_i by 17 Z2 e5 O D) I+ j5 o
end |7 _4 p0 Q& A1 \0 T3 I' Y+ F' Z/ E
end
1 R: o% q" j$ `* U) p2 U9 G; C: `7 t! C' v0 E v) Z
begin P_pick3 arriving) |- K2 k: _+ \% u7 l
set A_i to 21
3 R2 U. B3 ]1 u+ c move into Q_induct37 F! K2 V/ I. ?9 B4 T& \
move into pickaisle.induct3
, O, O: I# @2 }1 Z) J: q6 O while A_i<=30 do begin) c/ p* |2 O9 y2 ^8 k" Y5 E. r7 F
travel to pickaisle.con(A_i)
0 i* u, z1 T X# E/ { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# U. A/ s* R9 k% A6 t3 N else wait for 10 sec+ I; ]; x* {& q9 S ]3 r
if A_i=A_leave then send to die" w& l0 a9 O+ m
else inc A_i by 1
; J3 a/ t0 t6 {+ x5 y. N end
. s, V8 F6 B* uend |
最佳答案
查看完整内容
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,其它按你的 ...
|