|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' ^* u( _3 M1 k* {# B1 p( h6 L2 J t/ N4 z5 B# Q8 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中的数值,不知道会不会有什么不妥。
! `! B' S: [' Q" c) x$ O* d/ r/ ^1 B7 K& ]% A" g1 ]& @) C- V+ N
begin P_read arriving
0 X7 |/ ?7 \, m4 ~ K# H while 1=1 do begin0 ~1 ?- z7 D; e3 h- z
read A_tote from "data.txt" with delimiter "\n"
2 \' y# ?' U* @& G9 ?$ P) T: r read A_time from "data.txt" with delimiter "\n"
6 L% r/ a9 g" ` read A_leave from "data.txt" with delimiter "\n"! G* S x% Z, g9 g3 Y
read A_picks from "data.txt" with delimiter "\n"9 E' A/ n3 {! P0 f! U2 j
set load type to A_tote
0 E- a( ^3 I( u$ E if A_tote="tote 1" then set A_induct to 1
y/ ^5 k4 M7 |2 B else if A_tote="tote 2" then set A_induct to 2
5 r+ e+ h; L w else set A_induct to 3
/ E, `; N: w9 L2 a! K4 V' ~8 _9 s set A_i to 0( [+ P+ f9 l$ c7 E
clone 1 load to P_induction
: {% F( P6 G. Q wait for A_time sec
2 l4 S/ z3 ?8 Z end$ H4 f. u% F% O: A
end
F1 T) V. \: X' I% ]4 Q7 l9 K8 z9 s. r+ s0 B- K* X9 z2 J
begin P_induction arriving4 i* J2 n |4 s
if A_induct=1 then clone 1 load to P_pick13 D( j; |% T5 w( r
else if A_induct=2 then clone 1 load to P_pick2
" s j, n( B; I" J1 x" P5 s else clone 1 load to P_pick3, r+ |4 K# ]" K3 G
end
& w- O; `! V: t9 |
! Q+ D% H# ]1 v/ h* r7 abegin P_pick1 arriving# e/ o& D6 q3 S8 L
set A_i to 16 h$ c9 U$ O& F; G- e
move into Q_induct11 z/ B! R: `$ x1 m, H" W2 T' s
move into pickaisle.induct1
) z+ q) }2 X: Y9 W" {3 h; @, X while A_i<=30 do begin
' e- [$ {4 S6 I- a4 v travel to pickaisle.con(A_i)
5 S( v& h a8 h) b+ n* G- ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- p! `$ P5 B/ n, N( p( E
else wait for 10 sec
0 z$ ^0 a/ r' e! g( o! ?# x if A_i=A_leave then send to die
3 V1 o1 J8 t! g' I else inc A_i by 1
5 g# n: R6 a7 g" k0 o( V! I5 v" S end3 L% U3 j# G4 H2 P5 T( @9 f9 V+ Z
end+ d* F+ O2 Z. ~
W5 p; e/ a" P0 J% S4 S# Kbegin P_pick2 arriving
% }3 H8 T; U r" [0 f7 ~ set A_i to 11
7 I4 A- ~- M1 b" G; t move into Q_induct20 R/ I; {; m6 J3 Z- g* U0 s
move into pickaisle.induct2/ z: x4 y- g6 L: u" ^
while A_i<=30 do begin
" B, T6 l, f, ? travel to pickaisle.con(A_i); B! c" l- E# m; B' r% K, U
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( g' g6 h5 M; u$ d8 h- q else wait for 10 sec- C5 T5 ?0 _9 R( p
if A_i=A_leave then send to die
) J: L! d6 g* C5 c4 u else inc A_i by 1
5 q/ [& H6 w8 F) g end
: n) ^$ i0 \3 h) k% `end. K7 Z9 ~8 u/ ~+ d# p C
) ? y( y4 A2 qbegin P_pick3 arriving9 {4 n7 {0 w/ l/ s$ M
set A_i to 21- [9 i" l2 u# e- w7 ~; b
move into Q_induct33 f, d: [: k( X6 T* R) d& I
move into pickaisle.induct31 O, R- l' {8 i. ^5 c
while A_i<=30 do begin
2 M" V4 O8 s7 f5 g8 y( A+ t# ~ travel to pickaisle.con(A_i)7 l8 c0 g* H# b- S1 J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! F8 g& }8 i% G4 t) W7 g7 \% \; b else wait for 10 sec. w9 F( ^9 V" n( O; N$ b3 s
if A_i=A_leave then send to die+ K5 j+ N5 C& N. w/ q3 C; c! {
else inc A_i by 1
! { y# ]# C9 c) E end
- q. Y' \) e% f/ Aend |
最佳答案
查看完整内容
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,其它按你的 ...
|