|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: e4 `: Y! s/ O, s; S! m- X/ Q- ^: O" R$ H, u) s6 H+ o. b
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
; o1 O) u& F! m9 j7 D
* K2 O& {! }! ?5 J7 vbegin P_read arriving
" o/ @' F% S9 o: i while 1=1 do begin
0 S% U9 |; }) K( L$ c% [# {) B$ a& R read A_tote from "data.txt" with delimiter "\n"
0 }6 n$ Q- @/ r' J7 B' y( d: V read A_time from "data.txt" with delimiter "\n"
) l" l% n! U' a* t read A_leave from "data.txt" with delimiter "\n"
$ L1 Q8 q. ]" y( F! f) ] M" { read A_picks from "data.txt" with delimiter "\n"( f8 i* d% L1 A' E7 `
set load type to A_tote7 |: t; Z$ O5 P9 u2 `2 U
if A_tote="tote 1" then set A_induct to 1$ Q/ D, _2 M* Q5 O
else if A_tote="tote 2" then set A_induct to 2
" W0 N; `2 ^# V6 X( V; \ else set A_induct to 3
6 ?! L, L/ r- s set A_i to 0
, y7 F) w1 k0 N9 ^8 I clone 1 load to P_induction7 Z2 ?& K% _6 R. h- n1 A2 e% D
wait for A_time sec
% m% R( R$ @; c: j end
" y. C4 T* B3 l" c2 N1 Gend' g# ^& g7 @4 E! h
" a8 M ^# `/ n7 V; ]6 k
begin P_induction arriving
( K4 f: a8 o3 e. U if A_induct=1 then clone 1 load to P_pick1 a+ i6 ~9 V6 q
else if A_induct=2 then clone 1 load to P_pick2
; O4 ~5 h5 Y, Z. }' \7 M: F$ a& H else clone 1 load to P_pick34 \6 N6 A5 j( B0 P) C2 y' D/ ~
end
$ u& j& k- ~7 T7 y
x: o$ E3 I+ d3 x8 nbegin P_pick1 arriving
" T0 _3 h3 i, y* ~; s, ? set A_i to 1% g& M# y6 P9 H* q* l; S
move into Q_induct1
( B6 @. I2 x. @/ o8 u move into pickaisle.induct1
% o1 w9 P( D1 X& C0 X while A_i<=30 do begin
! G/ {" z$ X/ i0 S# ~, } travel to pickaisle.con(A_i)
$ l0 r' Q h. g, p- K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) D8 W; K* h) t) x P2 g else wait for 10 sec
" D& N( h! A! | if A_i=A_leave then send to die0 w6 b. W4 C# J4 o
else inc A_i by 1
9 d, ]" [: O5 P% ~, Q; m0 { end- f# U! m# t2 z$ J- |2 \, K
end
0 i; E1 f# Y) U5 {3 g
& ]/ G% `2 r }5 t0 G) j! L9 Hbegin P_pick2 arriving: i5 Q2 @- k* [. N0 o
set A_i to 11* C& B1 { V H
move into Q_induct2
4 d* G1 Y9 V, M5 {. k% n8 v move into pickaisle.induct29 F: E; [ D5 D
while A_i<=30 do begin
, N3 z$ ~# ?( ^ travel to pickaisle.con(A_i)
# ~0 f$ s1 o5 Y" y T, d0 X$ S' @ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" {, |6 d3 @2 [
else wait for 10 sec* l5 B6 q+ |# T1 o, U; [3 s9 p
if A_i=A_leave then send to die
: Z0 [+ q" ^4 F7 R8 R5 | else inc A_i by 1
2 b) B% N% o. i) ~ V# K- p7 a$ B. y/ ~ end7 f+ I9 e0 ^2 \; i3 i9 ~( M
end
r' @. z" }- t# {: y
# G& ]) s3 v3 T4 Z0 p hbegin P_pick3 arriving
0 Z4 l; W" ]- [7 c3 S set A_i to 21
5 ?' x8 t1 l4 |4 e5 X) T) H; a+ t move into Q_induct3
$ m5 s' w$ y6 k move into pickaisle.induct30 ?' V* y( N9 m' s6 w
while A_i<=30 do begin
6 P- k; B. Q5 i$ H9 H/ X% F6 l travel to pickaisle.con(A_i)! P4 l. A! Z. i& f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! Z8 Q& E F$ Y, y else wait for 10 sec4 y/ h+ m u' h) x U* J/ X
if A_i=A_leave then send to die
# a4 L: f r% M6 z9 y else inc A_i by 1
+ G2 ^% s6 \9 H end+ R/ |( x P6 b+ D
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,其它按你的 ...
|