|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) G% p. E; d7 y" V/ Z$ }$ E
2 b. j5 e. Y+ r; t我的问题是,在每个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 |9 a' r* B! E% f- k
. B, t5 `5 w3 K, |begin P_read arriving
: w) x3 R0 d! v2 L& f while 1=1 do begin- O: W3 f0 c) V* n) {* q6 k
read A_tote from "data.txt" with delimiter "\n"; f2 C5 F3 w3 \" ~/ U; Y
read A_time from "data.txt" with delimiter "\n"1 @4 X: c' t' i5 o, g
read A_leave from "data.txt" with delimiter "\n"/ n1 z& N* D3 O& T! Q
read A_picks from "data.txt" with delimiter "\n"
6 N) T& Z+ }; c+ i% N t set load type to A_tote
& A r- E$ X& B' [) I! x V$ w& Q if A_tote="tote 1" then set A_induct to 11 R0 D1 t% s' W$ |2 c, M+ {
else if A_tote="tote 2" then set A_induct to 2; G1 H. W$ a S+ v; r F
else set A_induct to 3 3 K9 E! d; T* v
set A_i to 0
, B2 H, P' X2 g" T; a clone 1 load to P_induction7 B7 \; m! `0 Z
wait for A_time sec
; O9 G. N, D2 q+ N# M+ \& B end
' V0 Q) H, g2 _end
. t$ s' l3 y% q4 z1 E5 @+ h
$ m& [3 \$ S+ | G1 ] |begin P_induction arriving% Z0 p% L+ t- E, G1 F1 @3 z0 w
if A_induct=1 then clone 1 load to P_pick1
3 Z/ M9 k0 b9 K else if A_induct=2 then clone 1 load to P_pick2
0 N: [2 I9 i5 \. B else clone 1 load to P_pick3
2 T. p9 W9 V* p4 {+ d% |# Jend! o* V0 ~" R/ k& c! Y0 O5 e) S
/ z, f& E: w; @
begin P_pick1 arriving
) g) z d4 x$ h& [+ Q set A_i to 1. ]& ^- A* O( _% g& |
move into Q_induct1
7 s' ?6 |3 s$ i* \ j$ E, k move into pickaisle.induct1! L7 v8 D0 v6 r" l# M2 r& b
while A_i<=30 do begin2 t j5 J' t- m: n% O# b
travel to pickaisle.con(A_i)
0 [6 Q7 Y6 b# E if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 }; t5 I+ m, i4 V$ n( b else wait for 10 sec
3 G6 o. o. X4 s0 b M5 |; G if A_i=A_leave then send to die6 v1 [. e4 Z8 l% C6 c
else inc A_i by 1# ]0 e3 d; j9 |* G2 L
end. o( @$ Q( k- g) e1 c0 K8 J, E
end
8 {1 v2 I {( t; k8 H& W6 E
0 u' v% Z# F! J4 g$ Bbegin P_pick2 arriving
4 a9 R( @- j- t* n5 @ set A_i to 11- z; j) ]5 E/ ^) U, T {1 t
move into Q_induct2
- {$ `: X' j/ {; q- J$ \ move into pickaisle.induct2
8 i8 E! E$ \5 M8 T& V- W0 ] while A_i<=30 do begin$ b' F: I9 z" f; |' Z
travel to pickaisle.con(A_i)# M- C0 v( c V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' v A! ^, s) I5 H9 t {+ d
else wait for 10 sec `7 D" r! b# O; {. T' Q
if A_i=A_leave then send to die
# z' s" Y9 T1 m, {! x else inc A_i by 1
' p! a& \1 p- F8 c8 c- g- w end# i0 M4 |) x5 [% C
end
. F+ n5 Q1 F4 F: Z* j
) e& m0 ]; X- F; xbegin P_pick3 arriving
9 x. V6 P* w: I set A_i to 21
( z1 O3 U8 b" y4 g+ Y( h0 U5 }/ P move into Q_induct3 r" f3 B" h: ?2 [, X/ D
move into pickaisle.induct3
! G' M" P/ p( }8 ^! S while A_i<=30 do begin& }* B( R/ b! k0 y+ ~
travel to pickaisle.con(A_i)
3 ~2 j" v8 ~% a# y7 W, M4 O2 \% w9 n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% ?3 n1 K2 Z" d8 K) |. U0 m" m
else wait for 10 sec# N1 b% o, r6 c9 w; E6 r6 ~
if A_i=A_leave then send to die1 ~0 x" C) r. T2 u# x* Y
else inc A_i by 1" K7 O0 u+ g9 {7 n
end9 n# b+ E$ x9 H3 I) F' S
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,其它按你的 ...
|