|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 r/ p# |/ _3 b* b
c* i* J C) x7 F* ?我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! Q9 b# B1 J$ b8 W! T P' ?: b, e! T" R
begin P_read arriving
! Y3 E1 `$ _) u, y7 Y; @ while 1=1 do begin
: l! D- U! S% z1 W. n/ i3 @2 A5 s read A_tote from "data.txt" with delimiter "\n"
3 B! @$ o7 [$ d) Y read A_time from "data.txt" with delimiter "\n": i: s% l% l8 b) Y0 d( y
read A_leave from "data.txt" with delimiter "\n"
4 e# f6 w+ \% n/ l read A_picks from "data.txt" with delimiter "\n"
4 ]* u0 t2 [9 S set load type to A_tote
2 K9 U* ?2 G& M- M+ r+ q3 _# E9 X: | if A_tote="tote 1" then set A_induct to 1
1 J0 Q8 j |& u* J' g/ i else if A_tote="tote 2" then set A_induct to 2
2 T& {- I% T, \& x7 _ else set A_induct to 3 5 w! H$ R6 B# ^- h
set A_i to 0. P( J$ C' T; q: r M
clone 1 load to P_induction
! H2 ]4 a4 X, m1 f* _ J3 ] wait for A_time sec
5 N' ?, i& P5 _ end
! F- i1 `( e5 L1 J; ]; y; i+ ?end+ N, ~' Y: n, M+ x6 J9 \; N) _. Z
) @# q; U& `4 ~. ?8 M1 ^) Kbegin P_induction arriving
0 Z& V) i4 {9 e# W6 j9 y if A_induct=1 then clone 1 load to P_pick15 H. \1 M" S# H# ]5 T3 O0 Y8 _
else if A_induct=2 then clone 1 load to P_pick2* H! f5 v Z N
else clone 1 load to P_pick3
6 E( a- A5 e# u! w7 }# a& `, @end9 L0 l# g( ~! g/ L
t: N, ^; p M- R8 c' d6 obegin P_pick1 arriving3 H9 u* w9 W! K/ R
set A_i to 1 |1 P; A2 q% S, l
move into Q_induct1
* m. \/ E. c" j3 c! }- c move into pickaisle.induct14 k% E( F' M3 J% L4 v: c
while A_i<=30 do begin9 z& l8 l$ V+ g) e M- g( I/ F
travel to pickaisle.con(A_i)
& A3 p- S, d2 o: \' Y0 n; U if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% Q# b! A# j: \% e) r+ U: H5 g
else wait for 10 sec
! ?' c+ O+ Q; H, b if A_i=A_leave then send to die, K3 y }( Y5 j0 ?9 g
else inc A_i by 1
& t0 ^3 j: H# f* Q8 @% w end/ G9 w* U0 B. v D& E, z
end
* ^ s7 S$ s7 |* ?( `+ ^5 o3 I% e, w8 I2 b/ b0 L8 c
begin P_pick2 arriving
% u5 E. x+ n$ Q4 o8 Q2 a; I% t; S& y set A_i to 111 ]7 S4 y( b3 O% h0 ~
move into Q_induct2 J9 N, M/ D8 a
move into pickaisle.induct2
2 r+ v; G$ ?7 _: E, \ while A_i<=30 do begin
( l6 E) w9 G# S0 ]+ r9 Z travel to pickaisle.con(A_i)
8 w$ O0 y& S7 m# I8 u# R if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 `5 H5 F3 L: |$ ]* m
else wait for 10 sec9 t3 ]6 p4 F& @0 f M- Z! X- G4 ]5 A( s
if A_i=A_leave then send to die3 ~* [- y5 y# `: i" b* B
else inc A_i by 1
) f' }4 f- e V( W- O" w. _ end
8 h# ~. @, Q# Z' g" ?end
% @' K, \/ Z0 A3 ?' U. C) M7 D$ n( b& N" l( A) g
begin P_pick3 arriving
- h% Q% V1 L* a6 o2 [ set A_i to 21" T8 E' F' w! }7 U" @, \ m4 p
move into Q_induct3
& ~6 l2 t! l' ]: Q move into pickaisle.induct30 {+ x: V6 I# q- @. Y0 ^
while A_i<=30 do begin3 d L* A9 L2 Y5 `6 p" c: F/ ^
travel to pickaisle.con(A_i)
3 i, O0 v% _5 P% y% G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! }! U# U1 Y$ ]
else wait for 10 sec; H1 S d6 y! [; A1 e
if A_i=A_leave then send to die- o1 Z+ y2 t6 y
else inc A_i by 1
1 R* J; M/ ] j3 {3 t end0 m u- C! @5 m) Z1 x
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,其它按你的 ...
|