|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, E4 m2 `8 X# o! g+ s
/ {7 ~9 u: 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中的数值,不知道会不会有什么不妥。
; c" p: H. [% Y& K5 Q
, e Y0 l- c( y t* |8 U6 |begin P_read arriving
% U0 k9 ?: ?/ A" s2 q while 1=1 do begin
/ k$ e$ K- O7 c. z* f read A_tote from "data.txt" with delimiter "\n"% P* U7 q3 v# d ~! A7 x7 X3 a
read A_time from "data.txt" with delimiter "\n"
' ?3 A5 G5 P' {5 F" X) B) M( e read A_leave from "data.txt" with delimiter "\n"' R/ p2 F3 l7 ] Z) {0 r+ V
read A_picks from "data.txt" with delimiter "\n"- o# C3 S; B+ q& E. O$ L- {& a
set load type to A_tote
& j' v! D: p8 k/ c0 x if A_tote="tote 1" then set A_induct to 1
& a5 w4 |1 c( S8 S4 l, v; d3 S else if A_tote="tote 2" then set A_induct to 2
8 y9 d( T8 G( \! R! q- t# I% i else set A_induct to 3 ! E2 C- T; r B _4 F$ d
set A_i to 06 n0 y: q# Z! f, G3 x
clone 1 load to P_induction3 g( w, Y* e% X& M5 q
wait for A_time sec
9 F: R1 D, ^3 w0 r: n6 {9 F) Q end3 g* G9 A9 }7 {* {+ B
end' C4 M' ~% o3 v/ l/ h6 U
: I* W& Z' D5 x- O3 zbegin P_induction arriving; d5 p- `' `+ F( T
if A_induct=1 then clone 1 load to P_pick1 s2 k; A! m/ `' N6 Y- i+ R( V
else if A_induct=2 then clone 1 load to P_pick2
3 J1 g O7 T' a4 b- x( T8 r else clone 1 load to P_pick3
. J7 A$ I5 m- r( b+ y1 q2 qend
, w) B9 x5 H9 R( b( ~" a; S! t4 C- l. N" G5 p* [: e R
begin P_pick1 arriving ^8 _' y$ b' j8 A3 ?+ E
set A_i to 1
2 ^& K; L4 F |9 b- D) B; ? r j move into Q_induct1, d5 t+ I; y( R" @% @
move into pickaisle.induct1
; ~: X) Q8 z% A/ E3 A while A_i<=30 do begin
. i; A$ L3 ^. V7 `8 L, ~ travel to pickaisle.con(A_i)8 J' i1 A5 f4 }+ x I& I7 m: b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ Q# @& v) H+ P. `! K! e else wait for 10 sec5 a* `8 Z9 P/ N+ N# d% U
if A_i=A_leave then send to die
0 Y# n# o# j; x6 u; R7 l. l6 a else inc A_i by 1
, V6 G' z) c7 Q/ i1 z& U! d end! e" [% ` B7 ?9 h% G2 F5 [
end, I; c: k% k8 W Q# a3 r1 y$ v
9 m( M2 ]& s/ B, H
begin P_pick2 arriving
0 S& Z) c5 f. p% B set A_i to 11- D( \# ?) Y6 _/ u! j2 |
move into Q_induct2
* Y! T4 N# K) I. Q8 W2 R; K move into pickaisle.induct22 q; }; ?' r# W. L2 K! M1 C- R0 I
while A_i<=30 do begin9 C4 I# `( J# f# p$ g; _6 J
travel to pickaisle.con(A_i)
- q B9 y! J1 v: ]1 @2 z9 ~" ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 T$ D/ M9 _: U$ E- g4 X# Q% w0 Q
else wait for 10 sec
5 @- ^: H" i0 _ if A_i=A_leave then send to die
, {0 `5 ]5 A. B- T* g else inc A_i by 1 j. X8 c, u5 ~/ A
end
+ }" y! {% b. S& a; M/ pend
' [. S4 F0 o0 j# N. O, O, e9 h0 R; v% v8 c( R- Y
begin P_pick3 arriving
2 Y! P" }/ U, k! s set A_i to 21
0 R% F. I+ g" ]* y4 v2 m move into Q_induct3$ I7 i" V% d i+ R1 U
move into pickaisle.induct3
' B, o! y3 K* r) {* N while A_i<=30 do begin, ?$ K. [# ?* Q3 W$ F; ] F
travel to pickaisle.con(A_i)
$ ?% l8 E t* }5 U if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 A- }8 n4 }2 a- T# K' m
else wait for 10 sec9 |0 |/ W! @) l
if A_i=A_leave then send to die
3 r" y0 a( C) p" M else inc A_i by 1
- |- c4 c7 L, t; d end
7 V. T" [8 T0 ~* t" o! Q* ?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,其它按你的 ...
|