|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" m! p7 J+ Z7 u
6 ]/ i8 b# E; A4 n4 `! C
我的问题是,在每个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 h9 k$ x. }/ G; [ j3 o+ D
/ g* M3 N9 Z4 v2 jbegin P_read arriving
+ F2 |9 M% M4 B; n/ e while 1=1 do begin3 N4 i4 G, g' T5 d! z- g
read A_tote from "data.txt" with delimiter "\n"7 H8 k4 V0 d% i/ b
read A_time from "data.txt" with delimiter "\n"
9 B8 }$ l: S! a, ] v% P read A_leave from "data.txt" with delimiter "\n"
4 a& R$ t* _ y7 ~3 a read A_picks from "data.txt" with delimiter "\n"0 ]1 U. p/ ]0 \3 g1 x7 T! z" i
set load type to A_tote
* g1 w5 W( {8 w" K$ D& N$ l if A_tote="tote 1" then set A_induct to 1
" I) N' Y/ H7 m! A else if A_tote="tote 2" then set A_induct to 2$ ~6 k7 G' E" _( `4 L* k
else set A_induct to 3 0 D1 l# B! B1 j6 P# t4 G, f
set A_i to 0: H6 p! S7 ~) g4 I& F9 ?) d2 Y
clone 1 load to P_induction
% b+ }9 r0 Q5 @7 }9 D8 g8 p wait for A_time sec; o! H- B: r {3 a& e$ f7 s
end7 B9 d( }: j0 Y; a( Z# I$ t
end
4 w0 v7 q3 z6 K* q
- r2 P4 G9 P# K& l/ L; i H# Obegin P_induction arriving0 ] |- p. w- S7 x8 l' v1 B
if A_induct=1 then clone 1 load to P_pick1' F8 K3 U0 V7 L
else if A_induct=2 then clone 1 load to P_pick2/ u) v3 j( `2 G& \1 z$ j" R& ~, \
else clone 1 load to P_pick3; ]! t6 k9 R! }1 Z9 S$ X6 m; ?
end2 M4 W" W) w( T5 j. G7 ]
- }# `* P6 \, H. w8 Q9 ^4 g/ [
begin P_pick1 arriving
0 p8 @) g" B' V! | set A_i to 1
$ X" ~8 t" j4 o/ O7 g+ X! e& L: ^ move into Q_induct1
. g/ G$ w9 I) c, ]1 j" P move into pickaisle.induct1
6 A$ r1 q: x* x# g- [2 I while A_i<=30 do begin) w/ b+ {) m' p+ t8 |7 v
travel to pickaisle.con(A_i)
7 I, E. x, D5 D3 G+ Z2 K$ g3 C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 Y. m$ Z, h2 ]
else wait for 10 sec
. c3 m+ {* g( ^4 z0 e: t, x if A_i=A_leave then send to die4 _" E1 m, D% K- X! o
else inc A_i by 1/ P z- a0 |) v' O0 k/ Z. H+ i
end
9 E' F4 ^8 s8 Z) D& x1 [! Y# c( Z% iend4 `! m, b+ t$ Z$ j! _$ g0 n0 \+ P
; H- S$ \" k, m4 B6 |begin P_pick2 arriving
! T L' T0 q/ [" M' m" O m set A_i to 11" t: F/ g: ]2 _/ c0 i
move into Q_induct2; s3 [$ u$ B# Y! \
move into pickaisle.induct20 h$ y$ o6 {! k! ~1 S) {
while A_i<=30 do begin
8 I J1 Q, C7 k+ {' c2 u$ s | travel to pickaisle.con(A_i)
( N. P& M/ k4 J$ P* ~2 U$ \ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- z0 K* }: M& L" a8 u else wait for 10 sec2 b- _# ^* B" c
if A_i=A_leave then send to die- X& f) u# z7 h z$ D5 J
else inc A_i by 1
+ k( t: a) A2 S3 E, h8 p W1 |" [ end3 R9 A3 z- q4 S w0 }
end
9 s6 \ x! B: Z+ s: V7 A( r- C
' O. R d3 H, V, C1 V0 [6 pbegin P_pick3 arriving
8 F5 c" Y h( {# {, v$ k, F2 h( U set A_i to 21
3 D8 J7 v) h$ @0 } move into Q_induct3
) e) k$ V1 n, i move into pickaisle.induct38 G5 A: K$ t! L! ]5 W
while A_i<=30 do begin
* X9 P/ J" l6 W travel to pickaisle.con(A_i)' {% D) ^0 V) i4 h0 O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ A/ K5 e/ D e2 c else wait for 10 sec
+ M [6 X/ s4 b, y5 w if A_i=A_leave then send to die
4 {8 Q' a5 ]; g0 _0 D+ }# o else inc A_i by 1
5 B8 ?; D N# J/ F: X end
; x; W5 ]4 Z. g* B! p* S6 Z7 _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,其它按你的 ...
|