|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& G l) C1 E* W6 I4 o" s- |: K! e$ a5 Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
L4 W0 H# F8 p* Q5 `0 O1 z
) n/ U! o1 {7 z1 `begin P_read arriving
, E7 T2 {: m1 ]7 X while 1=1 do begin3 h: J0 {& u0 A8 K4 a/ W% F
read A_tote from "data.txt" with delimiter "\n"1 Z& Q" Y2 V4 N3 O% E3 u
read A_time from "data.txt" with delimiter "\n"+ q; g4 f8 g4 ?! ~7 K5 F/ F
read A_leave from "data.txt" with delimiter "\n"8 p2 w% Y. ?8 n$ {5 G! m
read A_picks from "data.txt" with delimiter "\n"
! `) i8 j! D- ?3 C' q set load type to A_tote+ w2 V/ J* b7 ^( [# b) ?: j, E
if A_tote="tote 1" then set A_induct to 1
. M2 [) ~# Q/ V else if A_tote="tote 2" then set A_induct to 2
. `+ d. c- j+ ^6 i else set A_induct to 3
7 y1 _5 \ f/ w7 { set A_i to 0& J: Y& H& R/ M- A# w5 `
clone 1 load to P_induction
9 M% @) `. N+ K wait for A_time sec
. T3 G8 L' W' {6 Z+ s. t end, W! G$ M0 @6 B3 U
end- s0 @6 c. C' R# P( d+ j m4 ?
) d; B2 g; s8 ^* D/ nbegin P_induction arriving
; X! `/ B) K/ G( z/ | if A_induct=1 then clone 1 load to P_pick1
$ E9 U# @2 I& a& g else if A_induct=2 then clone 1 load to P_pick2& y3 {, i8 |. c" M- F! X6 k' G
else clone 1 load to P_pick3
$ D0 g$ r5 d- x! xend, T. q8 V4 u" `0 S7 q( B
7 H0 D! o A+ e9 O3 j1 bbegin P_pick1 arriving: G0 x3 w6 s$ K; j0 P
set A_i to 1
9 u; i* K; n- O! i0 ~ move into Q_induct1
9 v( j6 j% I! D F( U2 u& C move into pickaisle.induct1; k9 P5 |( l, m: O/ n O$ J
while A_i<=30 do begin4 e1 Q/ @4 v% Y: ~; t6 O
travel to pickaisle.con(A_i)
) y$ I% b+ _8 D5 N+ P. b5 s if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 t L0 ^2 S4 u- t
else wait for 10 sec% b0 B. L' M: T$ }1 k+ x
if A_i=A_leave then send to die# z9 S4 ?! @/ a' G" {
else inc A_i by 1: \. J5 b! [0 O2 S9 H' H1 i
end
, s4 u6 O# O3 j- [) ^$ _8 ~end
& g$ j2 u, P+ o$ j+ ]
' S; h2 ~) u3 q( X: P3 x; X/ j4 }) Tbegin P_pick2 arriving
( v- Y' C3 E7 c9 w set A_i to 11
/ d, _1 m7 S u }8 L4 E8 d1 J move into Q_induct2
2 P0 k; C5 j( |) j move into pickaisle.induct2
% I. U: T8 m1 n while A_i<=30 do begin0 M" {/ h4 z- `2 K% t8 B
travel to pickaisle.con(A_i)6 F+ ?. D7 | P6 E/ O2 j
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) e. Y! g% B7 x6 I: Q* o. e
else wait for 10 sec% I8 x: o1 F( s: ^
if A_i=A_leave then send to die
- w( s6 U' T5 Y% V& j else inc A_i by 1
; n: h6 O* z5 Z end
8 S# \' R7 C4 v0 ]end; t/ G5 ^/ T5 M7 e' H' x
; o2 b- c; w: g) T
begin P_pick3 arriving
3 A- v+ A$ S7 H# q* Y% E9 P set A_i to 21
- W" Z* a J# k) @# g' y' u move into Q_induct32 S7 r. T5 H, n
move into pickaisle.induct3' B: w7 |6 l! R+ a! u# A
while A_i<=30 do begin
, h: O+ e9 @7 C7 A( F- c! \ travel to pickaisle.con(A_i)
: d2 e F: V& L. I+ l if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" c7 D" I0 h2 |& E7 _7 y
else wait for 10 sec
- r! {- g* O9 L% q if A_i=A_leave then send to die
. z& X; n$ ]. \6 Q3 m+ I else inc A_i by 1# Q+ \; U5 Y) e+ @* L, w" H" h9 j# b
end
! x' v4 y7 \' k8 E) k, K# Iend |
最佳答案
查看完整内容
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,其它按你的 ...
|