|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 F6 H( s' J8 @* b( I
" T! u3 X A' X6 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中的数值,不知道会不会有什么不妥。: Q3 V% r9 H. q
% F4 u5 U5 j! F7 S* f, p) G% @
begin P_read arriving
, M# {) e5 ^& s1 ]: I$ x1 p& w while 1=1 do begin {6 r( Q6 @' Z% v
read A_tote from "data.txt" with delimiter "\n"9 q) g8 K( p. r" o- Z: s
read A_time from "data.txt" with delimiter "\n"
2 m6 e$ v `2 O& q1 O- K( g9 Y read A_leave from "data.txt" with delimiter "\n"% p7 A6 K- c2 v: ?; j& [
read A_picks from "data.txt" with delimiter "\n"
; L6 C: g: x2 Y& n. m/ R set load type to A_tote
0 u0 ^9 ~4 e, P& {! B5 t: R if A_tote="tote 1" then set A_induct to 1
9 i \; @' X: Q0 I- }# K5 O else if A_tote="tote 2" then set A_induct to 2' G6 o* ~$ ?3 q) m# p
else set A_induct to 3 ' J- Q3 \ j! O. p/ G
set A_i to 04 J: p9 X: P) P% z, Y" S9 j
clone 1 load to P_induction
$ S& A) J) |9 o: z1 D$ M wait for A_time sec: c# b- |% l' `$ M w
end% V" R/ {5 r" Y4 C& ]+ _* L
end8 h: s* z. a3 y8 k, h! o0 S2 l
& _+ O0 M1 ~. ~5 _" i) jbegin P_induction arriving
% s5 A, q! i, ]$ o; ?1 S$ k8 I if A_induct=1 then clone 1 load to P_pick1
0 D/ x! `0 q1 E( x else if A_induct=2 then clone 1 load to P_pick2
; q( t: o7 h( b( c else clone 1 load to P_pick3) Q& t" s# U8 v( [- d
end( r& ]8 r6 @# Y$ q, ^
7 ~- {# a8 G+ |2 y- i& N% Lbegin P_pick1 arriving
! _+ U" i+ c# Q$ P set A_i to 12 d$ ~# F. `+ k
move into Q_induct12 X- I/ ^! q! T* h
move into pickaisle.induct1: S" b; H* c5 W* I/ ~
while A_i<=30 do begin
( w! e0 w4 N6 S- ~# a travel to pickaisle.con(A_i)
: h; G L. {5 c& P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# ~. Z3 [7 P; X; u else wait for 10 sec
* e/ ^0 N! K6 K* V! D if A_i=A_leave then send to die# F3 t2 i9 M) Z q; O3 ^
else inc A_i by 1
) G, s- I9 z% J. T end7 l4 A1 W, P" Q
end
% W/ S- L5 t+ @# P7 i2 {3 M+ K7 o2 N; A' G0 c6 M
begin P_pick2 arriving
5 g4 o2 b: A9 k set A_i to 11 f0 P' }, a0 C( t Z9 g
move into Q_induct21 s! z6 C4 k& k1 [) _
move into pickaisle.induct2
6 d% d* B! J. m) _0 @1 A$ }6 ^ while A_i<=30 do begin
M- l, X& O+ [4 e' m: d* } travel to pickaisle.con(A_i)
9 J/ r+ X& Q' P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. m$ `, D1 V/ O7 t; K else wait for 10 sec
- k5 O9 ?" ]( i7 W; e& J6 s4 D) [ if A_i=A_leave then send to die
" W* y; q' G3 O3 k2 _0 Z# g else inc A_i by 1
# ]: j7 o w/ d. N$ n3 t# R end
9 K7 Y* s: u; H8 Q' Iend; c2 Z- d1 W$ I5 u6 N( A$ V* ~7 ~
8 v" X7 I) b: cbegin P_pick3 arriving
8 A, |3 |- g9 M h s* E4 b; b! } set A_i to 21
/ j l. e# ]4 z k$ O" D0 j4 a6 G& _ move into Q_induct3! K" V- {% `8 m' e) A2 I6 u; q
move into pickaisle.induct3! _1 n1 [" V& f% K
while A_i<=30 do begin) Y" x `/ b2 c' E6 y, O5 ^2 F
travel to pickaisle.con(A_i)" F# P) t X6 o, _" q& Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, d% m9 |5 W* C$ }* Z else wait for 10 sec
+ z; W6 N. i* r' U8 { if A_i=A_leave then send to die5 f1 o- U. b! u; q! F9 I
else inc A_i by 1, ^& V) w/ v& k/ b, A9 P
end
) M: h* V2 @: ]0 }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,其它按你的 ...
|