|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% q8 E2 g% Q$ H, o& m) C
9 t! T7 m) n7 t8 D3 P我的问题是,在每个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中的数值,不知道会不会有什么不妥。- ?# Z p- w1 f3 d+ _' N
9 G' f1 _ P3 X) q6 `2 P
begin P_read arriving; M% G# f J' V( w9 y* b
while 1=1 do begin5 s' i8 Q' b* Q* b$ d7 x8 _
read A_tote from "data.txt" with delimiter "\n"
9 t0 D* _# D4 S \' u0 [7 U& C* ]) x read A_time from "data.txt" with delimiter "\n", n& y2 i! M6 D$ r) B3 N: I
read A_leave from "data.txt" with delimiter "\n", c$ c- ]- i9 [
read A_picks from "data.txt" with delimiter "\n"
h0 W0 ^7 D( t set load type to A_tote' f, H2 s- d1 _8 [! C3 H$ m! z
if A_tote="tote 1" then set A_induct to 14 b, @4 z0 _7 k& h8 k' ]
else if A_tote="tote 2" then set A_induct to 2; W4 a2 g. L2 G" ~9 K6 G# d6 t
else set A_induct to 3
; ?3 D Y0 C) M2 U7 Y* x5 v set A_i to 0
( b! ~/ n: ]& p u5 q clone 1 load to P_induction
4 q. L! G8 k/ |9 z N& ^' E/ G, e wait for A_time sec
% M! ~( q+ N& |$ V end! U O" B0 d+ M, j2 p _
end
2 Z0 F2 u/ Z' D/ b" O5 X5 l& P" z0 ]& e
begin P_induction arriving8 j+ E p; K+ e- t4 d. @- Q: r/ O
if A_induct=1 then clone 1 load to P_pick1, Y+ o) j) A q% b$ o. u: l
else if A_induct=2 then clone 1 load to P_pick2 n8 L" B: t7 J1 I: C! A* k: Q& y; b
else clone 1 load to P_pick3
" T! J0 b3 U* l2 E" q [8 send' _+ s4 p8 S3 I5 P. Y& i
, U) `* Y3 |" J: P0 k, nbegin P_pick1 arriving
5 ], S( |% u! o' Q0 Q' x5 X( n5 T# i set A_i to 1. Z, H/ ]( k. r, i
move into Q_induct1
$ V# V) O5 \" ^: n/ C$ Q/ O' }8 D move into pickaisle.induct1- C1 N- C$ G: F
while A_i<=30 do begin
2 ~/ W% f/ N6 } travel to pickaisle.con(A_i)
, h0 g0 U: }# f; d9 f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ l9 h \7 g) S9 a" }
else wait for 10 sec! u) d( n! Z- b( _9 i( p+ N
if A_i=A_leave then send to die! F; `' U+ }) c2 `7 Q" j
else inc A_i by 1& a$ j# a5 e; m' M( }4 V
end/ D1 i2 ~% l0 y8 O2 z9 Y, ^3 r
end* U9 r$ o+ {7 }" e, q4 N! o
* r, o7 J8 d2 J5 fbegin P_pick2 arriving ]4 m; ]8 _ C6 u& A; O3 v
set A_i to 11: g: E! Z( q+ Z( u
move into Q_induct2/ P9 Q% a/ K) a7 l+ D4 Q# Z
move into pickaisle.induct2
9 R# `5 [% \; ~- A0 i while A_i<=30 do begin& `. Y D1 {* n. l' Y
travel to pickaisle.con(A_i)
( i4 t; L) G* T% A" Y. L9 { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* Z) H; M, `. t+ N9 p- _ else wait for 10 sec
( B6 {0 G0 C7 z1 x1 W9 H if A_i=A_leave then send to die
$ g" z/ k [% ?, ? else inc A_i by 14 W- z( O5 j2 E$ k) R
end5 |9 {+ ^+ ~# h
end4 w* D$ X/ k5 j# t
S3 j5 x6 ]+ Mbegin P_pick3 arriving
; @8 A0 f' x4 W5 Z8 v: S8 F/ N set A_i to 21
U( |- m; E1 i move into Q_induct3
1 A3 D0 M; W2 r+ @0 Z4 U move into pickaisle.induct31 B# N, o4 x/ C# t
while A_i<=30 do begin
+ K. ~- ]1 X; X travel to pickaisle.con(A_i)
0 _! m# F. q) T: }1 a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 D9 r, B5 J; K! v# ~: b else wait for 10 sec
$ t4 M& s% F: F% _4 w6 t: ` if A_i=A_leave then send to die
) c; k9 g$ l5 u+ u$ k! i7 V else inc A_i by 1* y7 E) E0 W" I7 N; T0 O* v6 i# ]
end
7 ?+ x) A5 o' L8 e% \$ T3 f: J. uend |
最佳答案
查看完整内容
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,其它按你的 ...
|