|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; c" H3 E! x( y2 @$ h+ y. ?1 U5 z; V0 I7 T J
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! V' j+ {1 h2 j+ Z, A% Z( V( F: V. j+ Q# a
begin P_read arriving
% A ?( g: b, p7 z$ O% U& d while 1=1 do begin; _3 x7 j: I" L. A
read A_tote from "data.txt" with delimiter "\n"
2 Z" T5 i) v# b! `$ ], C read A_time from "data.txt" with delimiter "\n"
* ^, v4 M6 D- L, L+ ~ read A_leave from "data.txt" with delimiter "\n"" a# _ x9 X ^) T% u
read A_picks from "data.txt" with delimiter "\n"
/ g3 c7 x$ Q+ _, A set load type to A_tote7 x8 m+ }( ?* v$ ^6 g8 |% G, d% x5 m
if A_tote="tote 1" then set A_induct to 1
: l0 l- j4 i- E! Z8 M2 U else if A_tote="tote 2" then set A_induct to 24 f7 { o3 m- V u; ?7 ^
else set A_induct to 3
8 Y% S; t# e8 e set A_i to 0! L* U& ~( q& j) X5 G" O0 y# d" \
clone 1 load to P_induction2 Q. e( h" h4 [7 f' n, O
wait for A_time sec5 Z7 V6 E7 L' R; P# Y
end
% S% V5 d$ _$ G8 O0 o* U1 lend
$ `6 g7 W& j6 n; v+ @( D) S. u
# p/ B& n9 A; ?/ Ybegin P_induction arriving X( _$ g+ d2 J+ {$ _8 r
if A_induct=1 then clone 1 load to P_pick15 g' o! g; R' \- g5 i" Q
else if A_induct=2 then clone 1 load to P_pick2! X. X( t; M' B r- t( m
else clone 1 load to P_pick3% k+ G2 e! S5 f1 t5 w9 p) D ^
end
0 v& p" M" s6 b) K
9 @% ?0 b9 T+ h7 ]( I% X* Qbegin P_pick1 arriving
: v- `. \- B5 V- B& q set A_i to 1
9 ]. ?5 t* f" c& v move into Q_induct1
' R2 e2 q9 r' z move into pickaisle.induct1
" y L0 x4 H* M- K7 k; ~( o while A_i<=30 do begin q) Q2 P0 Q; \# T
travel to pickaisle.con(A_i)( k. { D0 e3 W# n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& K0 g* C: b. o( L9 D) [* A
else wait for 10 sec! }# ]/ n5 V$ i2 K& g4 ]; T6 ?$ j
if A_i=A_leave then send to die
! E n/ Q% M; a+ E# @/ k, v3 B else inc A_i by 18 _. i+ Q! e% F, s* f1 e$ v+ W
end
+ ^! @$ R% l: Y s% W, g9 a8 _end @6 m; ~3 J8 K( ?
% I6 z. s, u/ F- }0 Y
begin P_pick2 arriving1 l9 W" U- T o
set A_i to 11
, v" r. ] i- a. N! ~9 ^ move into Q_induct2
% U. P1 n. y" z [ move into pickaisle.induct2
1 Z, g; T, M% m; t$ K6 x0 z% \ while A_i<=30 do begin
$ B4 E/ R5 Z7 `+ y6 @ travel to pickaisle.con(A_i)3 X+ N" X& Q8 ^/ f6 e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 F$ Y2 E% `) L/ s0 m3 h else wait for 10 sec' b$ s+ i' u8 L' ^6 A2 C
if A_i=A_leave then send to die
" H2 ?% o2 d- ?; o& r else inc A_i by 1
; X4 p( z, E, M9 D* H" T end
- Q: L r& v! m: W7 [( t+ _: u6 lend3 y& W% g$ x( }2 v s4 J; W: a( I
9 i" D1 y- ]. e( i9 ]( Tbegin P_pick3 arriving
1 K* b' h0 l, \% T7 Y8 a set A_i to 21
% M& |$ a# P2 R4 }& |/ Q. } move into Q_induct3
& B- X# ?1 U2 i# F# m5 U0 B- Y move into pickaisle.induct3; K% A, [* h) j3 [9 G
while A_i<=30 do begin. l; }% N7 r. t. O J( Z; X3 |- c
travel to pickaisle.con(A_i)
, _2 G0 n3 Z) `& n0 `& W9 \- y! _ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 e1 t- ?! B$ j! u/ X8 Z else wait for 10 sec" U: W* R7 U% w! s6 g4 @! F" P
if A_i=A_leave then send to die; x4 ?' T! T! K
else inc A_i by 1
/ w8 o; J. Q) H! N$ G+ D end( `, m5 W S$ F: }! h; j: x( r& u
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,其它按你的 ...
|