|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 i6 u! f) F8 }0 B. p8 Y
3 @6 O) X8 {; L5 P2 j o我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 z) Y6 S! {! _" W% v1 s! U5 K$ B- W
begin P_read arriving. N. b# U# e9 {2 A5 @
while 1=1 do begin( M8 |$ C( v% l+ k# z
read A_tote from "data.txt" with delimiter "\n"3 P% ]: L; @# k( u3 R- U4 b# N: T
read A_time from "data.txt" with delimiter "\n"
) k. `3 K- ~, X1 l read A_leave from "data.txt" with delimiter "\n"( [; ?9 {4 r- L8 c5 U' |2 q6 ^& |1 O
read A_picks from "data.txt" with delimiter "\n"/ i/ E) a! V: C- a5 V: n; v
set load type to A_tote
! B6 `6 Q, @" v# f; i4 p if A_tote="tote 1" then set A_induct to 1
0 S4 j+ Y* Q" q' ` else if A_tote="tote 2" then set A_induct to 2$ P( a( ?0 O: ]+ v! D
else set A_induct to 3
, A+ ^3 ?1 d' ]( ^ set A_i to 0
( J( d3 m3 V5 H; k6 J' h4 ^; ~ clone 1 load to P_induction/ S# d' e# R' q( E8 n E4 j6 \- Q
wait for A_time sec8 x6 s/ Z5 g/ g1 H- r& S
end
7 W- K* {/ y A9 W Gend
/ I3 V- E7 j' i- T! p- e& V; N( }6 F g7 S
begin P_induction arriving) c3 {* U8 N% G; F: S) n
if A_induct=1 then clone 1 load to P_pick18 ]' A! j" l8 q; N
else if A_induct=2 then clone 1 load to P_pick2 ]% r9 T" U( L: n0 k7 {" t2 j
else clone 1 load to P_pick3" n* J! a: T/ h6 ^ A1 a
end
5 [ y! B6 C0 ?5 q# @( W
: ^/ j- r! ?/ x+ d3 {2 T* h; Jbegin P_pick1 arriving
3 R' f: y- G8 P8 R set A_i to 1% ?8 V7 K, q) }3 m3 L5 p n
move into Q_induct1: [3 s. v: N' F9 S0 Y u$ q
move into pickaisle.induct18 u6 [( S" `( Z/ c& x
while A_i<=30 do begin
8 i0 C2 h) P. q2 L2 I+ f* M; N) q5 r1 z travel to pickaisle.con(A_i)1 @. s% `. M' y( w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) R) Z: g" f$ B( a& O else wait for 10 sec
8 t. s: ?. F3 G if A_i=A_leave then send to die
' Z, `" X" \/ q. L" |5 ^; P! @ else inc A_i by 1/ I) \- z, V& ]2 P3 o5 J$ m9 [
end
1 b3 f+ o/ n% yend
) Q/ U/ {7 e$ ~% L& x0 `+ Q5 g6 n& _1 ~. f
begin P_pick2 arriving
$ p$ H/ F, w* x, G0 A5 A7 P1 ` set A_i to 11
+ E0 t5 F0 _' ~" D" F- { move into Q_induct2 |/ @- `( G& c2 C+ C' U
move into pickaisle.induct2
% c$ a$ e2 E) O3 g while A_i<=30 do begin) Z$ U( o( j+ M% T% m9 u1 ]
travel to pickaisle.con(A_i)* A0 }5 ]2 e! u; I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 T4 s6 M4 _ y else wait for 10 sec0 _- Q" n8 }" @: J/ E/ c
if A_i=A_leave then send to die
K5 N9 P/ b. F& m: w else inc A_i by 16 J: H6 R9 F# i1 Q- m
end
. C; K3 o4 d5 r. F9 T- r, h* Nend) [ q, ]) h9 S# H
# b) Q Z5 H, w/ A+ B! K/ J- T2 O
begin P_pick3 arriving+ p% f3 M. m9 E8 f8 j- c
set A_i to 21/ j3 D# V: V. ?1 @4 H
move into Q_induct34 s5 E* S9 {/ T( @* [( z# k3 x) Q
move into pickaisle.induct3
: |" Z5 s% z' w5 b ?. C Z: g0 ] while A_i<=30 do begin
8 y& t; w- L/ m) `- I travel to pickaisle.con(A_i)/ S l$ z# z5 v' {# o6 Z& ]/ |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" N y% O3 ~ N, @ else wait for 10 sec" _' b# D1 A+ x
if A_i=A_leave then send to die7 u: G7 V/ I \6 ]: b
else inc A_i by 1; Q/ I( b& p: x: E! z& s
end
& W; |7 f9 ]! T3 V; R, Q* s6 B( Vend |
最佳答案
查看完整内容
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,其它按你的 ...
|