|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 W& t7 J7 X) Y- U0 c' u J% U( O" r) U3 o- @3 i' }1 \
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ i" s P) Z9 \- S' h3 r0 ~+ i
4 D. v0 h O$ s& T6 ?begin P_read arriving$ {& W/ x5 M B- ^
while 1=1 do begin
# {$ [. N: `+ |3 ~4 ~ read A_tote from "data.txt" with delimiter "\n"
3 H" p4 A; G- ~. i% `+ g; `5 C3 { read A_time from "data.txt" with delimiter "\n"
; o" H W" w, Y+ F2 j: y; Z read A_leave from "data.txt" with delimiter "\n"
& W4 j- D5 j4 }# y: |9 k& I1 W read A_picks from "data.txt" with delimiter "\n"
" [/ p; n7 V, ^ set load type to A_tote
) x0 \2 h& @ a8 b; c, l! b if A_tote="tote 1" then set A_induct to 18 z+ W9 X- G% Z( V) X; _/ p
else if A_tote="tote 2" then set A_induct to 25 ?/ ?0 f* i1 c4 G. Z
else set A_induct to 3
% g) l/ I; s- F1 y4 i# f& M set A_i to 0$ t8 b& b2 O: }: A) T2 J
clone 1 load to P_induction' b' e8 y. `, ` I V
wait for A_time sec, p( H3 [ r4 Y- Z
end
5 F4 l: x4 C. m/ [3 y: Oend/ j: ~) c" v' ~0 e$ x8 T
& s5 G5 M' X0 W2 K, Hbegin P_induction arriving; s4 ~3 \0 F& n0 F5 M" O$ N
if A_induct=1 then clone 1 load to P_pick1" b) q/ m! h9 I
else if A_induct=2 then clone 1 load to P_pick2
+ f2 P$ z+ C# s, q' @5 T else clone 1 load to P_pick36 j, ~+ F1 U: v% _
end
Y1 ?# W6 a7 V6 |% S
" a# c% |8 j- N2 T j" Mbegin P_pick1 arriving
5 D0 w7 X& p1 u* b+ P! M$ o set A_i to 1# w+ m% p; Q. c- D# l
move into Q_induct1
8 X: s j2 n/ ]' a+ r! @1 b( { move into pickaisle.induct1
) T) Z/ g" B! {) e, L! K while A_i<=30 do begin. L, H' l- y, @% \$ o
travel to pickaisle.con(A_i)+ A( x S7 c# t& B# ?9 h
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ n6 D% A. }$ ]) p/ b9 B9 k& l
else wait for 10 sec
4 a5 N6 ^+ |" c y' ] `0 Z: {6 i if A_i=A_leave then send to die
5 F4 Q6 X8 P& A1 @7 E( R else inc A_i by 1
v1 y e( |, _, _6 l0 p* q* G end
) V2 L. L6 F" \* }# Xend
2 o9 x5 S. }) h+ u; t7 T, n- t) ]" ^* y
begin P_pick2 arriving
/ @3 P+ G% p: ]9 Z9 v. g; k set A_i to 11
2 z' j, B) }/ ^- X move into Q_induct2
7 b0 k9 Z- `6 J x: t2 i move into pickaisle.induct2
- d: |! ~6 U, s8 z, ?$ p9 w while A_i<=30 do begin
1 e% J6 t* s# @2 r travel to pickaisle.con(A_i); m7 W# e5 k, h& P% x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; \( W/ \3 a Q& e else wait for 10 sec
( C5 H; ^4 f# K5 J z1 \ if A_i=A_leave then send to die/ \& j2 E2 I5 |4 B
else inc A_i by 1 T9 U% I4 m9 Y
end
" {0 T/ o" C+ t$ d2 k2 Y4 s0 mend: K# k- U+ { x) O
( y' d1 O" Q; M4 Q; K) w: c! ?) {- L4 f
begin P_pick3 arriving2 v$ L" ]" ]5 x- d* ~$ y9 _* o9 ]
set A_i to 219 g4 l0 S7 F+ F/ H
move into Q_induct3
4 \; Q% S+ P9 r/ j5 n- \( V6 ?" L move into pickaisle.induct30 c, P2 C$ @" Y
while A_i<=30 do begin) h& s, H, J2 e- h, C. r
travel to pickaisle.con(A_i)
& Y# C( j5 Y1 y/ q" B+ ? if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. Y5 \$ @( _* I( d$ S- b9 l
else wait for 10 sec) U7 q; W- b5 j, m
if A_i=A_leave then send to die
) Y* U0 O: g$ `; H9 T! l else inc A_i by 1' S5 e3 O% R; J$ H
end
, E* S, B/ I- 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,其它按你的 ...
|