|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( P5 x O7 u2 E' T N) g
7 Y/ L8 T5 s! k我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ e6 u' ^& b% ?5 v
/ m; C9 @' l# {! V# [/ wbegin P_read arriving/ g* \" D. x, W$ Z0 d
while 1=1 do begin
7 C0 |5 Y" C) \; G# b read A_tote from "data.txt" with delimiter "\n"
2 ]6 l# m4 i7 U- ~& i read A_time from "data.txt" with delimiter "\n"
7 ^! |% N# r( Y+ P- }: U read A_leave from "data.txt" with delimiter "\n"6 f N8 `$ l* U/ h, S
read A_picks from "data.txt" with delimiter "\n"
4 R7 e. z- @$ w set load type to A_tote
- Z9 |! L, z* [ a& p if A_tote="tote 1" then set A_induct to 1) U8 H( T1 \+ x2 o# D8 d: n* L
else if A_tote="tote 2" then set A_induct to 2
0 W5 b" G: @/ o# \ s else set A_induct to 3 ! C' P) H# T$ H' c
set A_i to 0/ t# {. H9 a4 f$ j/ Z1 r( [
clone 1 load to P_induction
6 `* M6 `, s L+ S9 Q wait for A_time sec
' q3 \, p7 c2 ~ end
& ~( |; A; e! P0 q% ~end
$ }9 g& C" a# N R+ Q# o( \( ] D+ M$ V: ]
begin P_induction arriving
2 Q. H; u( q2 b/ L if A_induct=1 then clone 1 load to P_pick1
3 _9 m3 h+ h1 ^) K# L w! H. ? else if A_induct=2 then clone 1 load to P_pick2
3 h& U$ |6 t/ s# [6 H; z5 A2 W else clone 1 load to P_pick3
* c! R! M; o' r" ~$ v8 P: w9 tend
2 s& l) k/ T6 h" O( v3 U0 C, t4 P) t
begin P_pick1 arriving$ T( ~- t( U: B5 R/ k! @' n
set A_i to 1+ J. P0 s( l: [- R8 B8 f3 [
move into Q_induct1
8 A+ K& X4 F+ | move into pickaisle.induct1
9 l8 @3 e b& Y( t while A_i<=30 do begin
+ \2 G2 f2 t9 g8 g. `& _; ] travel to pickaisle.con(A_i)
% e& B2 D% U/ f+ k) J6 b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 s* y) S8 k5 G" W! V5 v! B9 x6 x4 j' z else wait for 10 sec
6 G- v) Z' _& t5 b- h# u- D# H+ l if A_i=A_leave then send to die# A4 Q. i* L3 c5 {4 q- _% N
else inc A_i by 12 M1 h) k! Z& k
end
- v# O6 n! r4 ~6 cend6 g) x+ A8 h1 X4 \
2 @. m# Z' P7 U
begin P_pick2 arriving3 [% J3 V* q7 Z4 B( ?
set A_i to 11/ y3 ?. q& z {7 p
move into Q_induct2
1 ^/ X+ m2 a/ p& n3 Z5 e9 Z6 A move into pickaisle.induct2# J7 k: E9 K$ C8 [3 v
while A_i<=30 do begin
9 \( D( d9 L. J: v# J travel to pickaisle.con(A_i)
. q# ]. O; h2 ?$ _3 ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# y, X+ N5 d% K8 e
else wait for 10 sec
1 o) ^8 Z+ F- [5 f0 I$ T if A_i=A_leave then send to die
/ }, ] i K; H3 z else inc A_i by 17 j% i0 U- ]2 k b
end/ @5 Y6 q6 w! z) P9 G. N
end1 `! k2 N3 O& r' }7 `& D
$ c* D* d5 K/ g! ~ Z3 y5 ~
begin P_pick3 arriving
& K. G2 ?/ G+ L; R4 D set A_i to 21) ?: h3 \5 U5 N; R1 F) I* r2 \3 r
move into Q_induct3
- L$ c' }2 v6 Z1 y# `/ q move into pickaisle.induct3) C! Z" N1 }" n1 E7 C) Q5 E8 `
while A_i<=30 do begin
0 I& g3 H8 J0 B E9 Q travel to pickaisle.con(A_i)
( `/ A1 V% q) `! `. G% o* Z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# D$ A8 a% E4 ?) U0 c9 S; M* Z6 }% X else wait for 10 sec+ W4 g) u) C2 A/ r+ I C u
if A_i=A_leave then send to die, m+ r, \& T; ^) a6 @3 ~
else inc A_i by 1
: k( u1 R* C6 t$ ^ end
( V6 z- Q1 G t/ n8 K2 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,其它按你的 ...
|