|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 k3 `! K! d" O; ?0 I+ A
" j% k, f3 k+ a
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( W. c+ [- E4 [3 G9 u0 ~/ y+ p
0 D0 T' d. e0 r3 Ubegin P_read arriving
9 Y: O7 R, U {& v- n$ R while 1=1 do begin
1 Z. V6 n& D; e1 M8 M. _ read A_tote from "data.txt" with delimiter "\n"- W- Z6 F4 U/ l& }
read A_time from "data.txt" with delimiter "\n"# k2 _) P. p/ E# L) N* j4 ]
read A_leave from "data.txt" with delimiter "\n"* p/ d" a' n6 h0 v
read A_picks from "data.txt" with delimiter "\n"9 B( G3 U% x1 r* }2 b
set load type to A_tote% _5 H5 j) k+ N! D& z1 u3 T4 m
if A_tote="tote 1" then set A_induct to 12 }2 F% y# `9 B% n& y) p+ I9 k
else if A_tote="tote 2" then set A_induct to 2
, q$ j8 h8 F0 n s else set A_induct to 3 & J2 {6 {( q+ C- }, U: _
set A_i to 0
. t/ Z& J; R2 k3 R& m clone 1 load to P_induction0 N% \ r% R; f& [6 u
wait for A_time sec
, i& B8 } y3 b) v: o3 V! k end5 w3 I0 `$ v! f; c9 `, \" ^ N
end
/ C9 `& n4 p6 K! X+ t8 r$ W2 J" {' {+ H% F5 q, A
begin P_induction arriving
+ ?2 X1 a' Y+ _; X if A_induct=1 then clone 1 load to P_pick1
! K6 O P) h& T! U# P# e else if A_induct=2 then clone 1 load to P_pick2. x+ C! x9 j; J, W, R5 `: l- s
else clone 1 load to P_pick3- W$ t9 i: T5 b; Y+ d3 \, t
end1 z; U9 ` p' P6 h$ h
2 S9 a2 m" u( b2 B0 u! [. H
begin P_pick1 arriving
% i' z/ x& l/ q2 d) r2 D0 b set A_i to 1
" h; Z0 Y6 D) j l2 Z move into Q_induct1
: k" s1 X$ x$ _% [; | move into pickaisle.induct1
' `2 N. Y; M* @% p( Z. c while A_i<=30 do begin9 ^. r' R5 ~8 p r# v
travel to pickaisle.con(A_i)5 [! _6 P: ^% P7 ~4 @4 v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 H# T" j, Z' \0 j7 y
else wait for 10 sec
{1 l2 D2 {3 `' P if A_i=A_leave then send to die( X6 P' a. j& K! o1 u! R
else inc A_i by 1& [. h+ T* ^# L' Q
end
% k, z+ r6 f, kend2 X* \ S! X" Q$ Y6 \8 N7 O! t+ X
1 P3 j/ K' Y+ c- T" m' O( o
begin P_pick2 arriving
J: ~0 J( E4 N5 r, D( W set A_i to 11
u. t4 Q$ d2 H" ?7 ~, { move into Q_induct22 O+ U4 I, J4 P0 g' F0 S3 o( t
move into pickaisle.induct29 V; _. K, D" e# v& \" N4 F$ @/ F
while A_i<=30 do begin
0 j* n2 z7 I9 R' n- l* k* e travel to pickaisle.con(A_i)( ]6 N% d i5 u% w+ @) v6 C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. N# R8 k" A: H else wait for 10 sec
# W* O) r" s2 n& I if A_i=A_leave then send to die) p9 J/ x5 c+ v$ y( ]
else inc A_i by 1
* |9 g% J. { c' Y( N- w. N N3 s0 B& ~ end* X$ z P) F7 z! H8 R G
end/ H. Z T% p2 q6 [
& K9 v v8 p6 m* s. u o, T( |begin P_pick3 arriving
0 {, [$ i# \) ]. z. d* u set A_i to 21
, K, m" i# |; D/ v, A! p1 P move into Q_induct32 Y* \( `! f4 g7 D( f
move into pickaisle.induct36 ~/ Y) H$ M N! T2 w
while A_i<=30 do begin$ |' B& Z. B6 O/ P, P1 V; f
travel to pickaisle.con(A_i)3 Q4 u1 d) W! V, R- {! m y; v* r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec o& i' G6 B/ h8 ~% x! E
else wait for 10 sec0 l" S9 T1 i" h0 h% J% ]2 s
if A_i=A_leave then send to die
T4 o& ]7 H( U else inc A_i by 1
2 {% S9 d9 L9 m- }4 r+ D1 V end
7 _% J6 w: V, `6 bend |
最佳答案
查看完整内容
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,其它按你的 ...
|