|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 G& {7 f2 ^ U% \4 G9 s- U
& V; \ N% U# m$ p2 x* y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ a2 F4 u. o- ]. j% I
+ s6 c7 n! y2 a0 hbegin P_read arriving
9 F( p. ?" Y C' A: N while 1=1 do begin) A/ F; K4 \0 | u5 Q' c j
read A_tote from "data.txt" with delimiter "\n"
8 ~1 A0 `' [* B+ l ] read A_time from "data.txt" with delimiter "\n"
4 ]$ `9 b% m; V+ E; n, | read A_leave from "data.txt" with delimiter "\n"3 Q1 m( z) S; S' X$ V4 L
read A_picks from "data.txt" with delimiter "\n". O4 m) ]* |9 `7 O; n) _
set load type to A_tote
" }0 Z5 s: P0 v: F" x1 [7 U; [, F if A_tote="tote 1" then set A_induct to 1
% A* a9 m& G4 i: d9 B6 Q else if A_tote="tote 2" then set A_induct to 2; L. M3 Q; C! f7 r, X9 Q# F
else set A_induct to 3
% l5 c' k; B K& n set A_i to 0
9 a: R: T! Y6 D. L2 e( M clone 1 load to P_induction) \* S- X) E9 }1 s0 ?% G$ `
wait for A_time sec/ k$ I; l v! C* h; y
end$ ~; w+ y ]& _3 }2 O
end8 \: H7 l5 I1 K8 p n. p# O( Z
! p; G. C& ?9 D) ~) P
begin P_induction arriving* x9 g, L8 r& [# q' @
if A_induct=1 then clone 1 load to P_pick1
+ S% M2 N) E& H1 L& i else if A_induct=2 then clone 1 load to P_pick2
/ w, o% L7 D0 B S# h else clone 1 load to P_pick3
. i L7 N8 }9 s# p2 kend
9 |7 x6 E* w: }! M& q, G" O
4 o4 g* Y0 L# w3 Wbegin P_pick1 arriving6 v5 ]3 l, k7 M# z. F1 @4 T
set A_i to 15 O& p1 m4 S9 G- R: V% D
move into Q_induct1
# O& C2 o1 y/ M6 T! M3 B% f N move into pickaisle.induct1$ W5 j9 a) T2 ]) V; K
while A_i<=30 do begin
+ G( b" C2 r! p" u travel to pickaisle.con(A_i)& N! c6 x* F% E5 u# @, m A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 Q1 G2 R+ {" q- T" L9 f
else wait for 10 sec
9 E3 j& V$ S5 Z% f4 I* j0 g( M if A_i=A_leave then send to die
4 b y9 x! r) E2 w3 ?0 f8 z+ ` else inc A_i by 1, t# |' z& Y9 |! ~1 C0 \
end
1 ]! t4 r5 o0 G( q8 @end- g# h8 x4 M4 s$ A" C0 r
) o+ c% T# U* |; F& `4 T- Bbegin P_pick2 arriving
, R) d1 h8 m# ]1 m set A_i to 11
* m( D/ {# p3 v7 b6 T- y move into Q_induct2
/ l9 O- i% h2 M3 y5 v move into pickaisle.induct2
6 J+ S( n) P, h0 E% R8 Y! J/ x# k while A_i<=30 do begin
+ N2 k$ A f9 L% z; C% i8 Q travel to pickaisle.con(A_i)
0 _, c/ G% a7 A8 X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ [. j' Z% m7 Z else wait for 10 sec
: z. R# N3 R% d# x if A_i=A_leave then send to die
+ l [$ H7 b$ A6 W else inc A_i by 1
3 H+ P+ m0 d& W- K* `+ B end! |5 P8 P! v5 Y$ ]' n: t/ d# y, u
end
$ ?% ]5 ^6 V2 L" L, J2 l; i8 z8 S+ s0 v
begin P_pick3 arriving
1 T9 i, G6 e4 n7 C9 r6 c set A_i to 21
4 t. {! |, u0 `3 I. h move into Q_induct33 j: F' f5 q# d, Y
move into pickaisle.induct3" h# s& d A/ J5 Q0 [
while A_i<=30 do begin- D( o# `6 M8 t+ _/ L* r
travel to pickaisle.con(A_i)
, x; \/ \1 v; h& Z; M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ |. w3 U) ~; V( c7 f) h, L else wait for 10 sec+ R* e0 Q K( l. Z" z
if A_i=A_leave then send to die+ p5 s( t* t6 y1 z% U R
else inc A_i by 1
+ V/ g+ ~. v4 r+ |8 t0 R+ @ end
# ^# r! h* S; N& r* g8 h8 B4 }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,其它按你的 ...
|