|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 m1 C! b7 K K! `; V1 a
/ [6 J+ M5 F2 p! w8 L
我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 _5 F/ ~1 \% |7 B
U2 U* f% o. Z1 _! lbegin P_read arriving+ o& n3 b5 o' R+ a2 `; u! b/ m4 \
while 1=1 do begin. E' X7 k) g6 i$ f+ F
read A_tote from "data.txt" with delimiter "\n"' m( O6 f4 M0 g; }7 ~7 S
read A_time from "data.txt" with delimiter "\n"7 W& _/ q8 O: r% b2 }
read A_leave from "data.txt" with delimiter "\n"8 |4 P x1 W, @" I3 Q1 _+ M
read A_picks from "data.txt" with delimiter "\n"
" {( S' z! K, W' S* x& _, E& I! A set load type to A_tote
; c* G9 i0 q4 v9 t) F9 \' R if A_tote="tote 1" then set A_induct to 1& l V' q3 L% E; Q6 F$ u, P) z
else if A_tote="tote 2" then set A_induct to 2
- K0 J5 Q; @2 p else set A_induct to 3 5 B! ~( s! W' v
set A_i to 03 e/ o! k3 t( ` U/ T$ x2 {- y
clone 1 load to P_induction: T/ g) w$ t+ m
wait for A_time sec0 N! X/ j2 ? g3 P5 y. J4 u$ N
end4 Z: s( Q3 j2 _$ e: U
end5 R) V C0 n2 Z) D* H0 ]# o
h [. I+ F5 C1 a
begin P_induction arriving
/ ?% G$ p2 m1 U( y8 R4 O) _5 y if A_induct=1 then clone 1 load to P_pick1% g3 m. S, E9 E* a, \
else if A_induct=2 then clone 1 load to P_pick2! C8 V+ [! J( [
else clone 1 load to P_pick3
/ V5 d, A" k3 x: Z+ D; Xend
1 W7 H# w, g9 W0 j" i: _" K' ?5 k2 V }9 o/ X9 M
begin P_pick1 arriving
! V* }. z9 s9 X ^( V set A_i to 1 ]9 |7 y7 r& m/ h
move into Q_induct1" G8 b+ X$ G% n; E
move into pickaisle.induct1
$ z" m7 w3 m. M6 Q+ }6 y+ j while A_i<=30 do begin
2 }, k- p) {- }, {2 y1 h travel to pickaisle.con(A_i)
( Q1 r9 u; n8 F0 W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 J' L- j4 K9 j5 K" l+ ~ K$ Z8 ]
else wait for 10 sec
0 e6 d8 F& x6 t" w- K+ [ if A_i=A_leave then send to die% R2 h& V+ h5 _# W9 _
else inc A_i by 1& `4 g9 E+ d' ^. n. H) o; c$ i
end
: w2 V* c( y. O; T+ Fend9 b6 N- `6 ^. S1 U
% A h R/ {. ]# G. ]/ c
begin P_pick2 arriving+ U- v$ J( M8 S( I$ u3 I6 X
set A_i to 11
, F* `2 J% F7 A4 K7 h5 `6 }8 E3 i move into Q_induct2
- {0 Z) l% M5 k/ z0 p4 w move into pickaisle.induct2
, | Z- o: T7 z. R" A while A_i<=30 do begin- m. p% _7 }& _# f
travel to pickaisle.con(A_i)" Z p/ E4 w3 @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ `; H; M- U/ w- u) s7 L6 F else wait for 10 sec0 H% b- P! p/ o6 u# E6 b7 }
if A_i=A_leave then send to die
0 q6 B0 G* r& h8 w3 y- o% C( s else inc A_i by 15 ?6 n3 s6 M: l) F% T# m/ y
end5 m2 a) w! |4 K0 v. |( K
end' F/ x u# {( W }) p1 k3 S
1 v' x& q8 F/ v7 wbegin P_pick3 arriving$ r, V/ R) U, t& ?: R
set A_i to 21
2 i( n" f; i# m move into Q_induct3
7 F( d# {4 s$ J# {: X move into pickaisle.induct3
3 m5 t0 M0 z- L- e" c while A_i<=30 do begin# h2 B6 b2 O$ w
travel to pickaisle.con(A_i)3 M. [" w/ A, G! E9 i' ?0 l2 `! O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' S. L" K8 R+ z9 l else wait for 10 sec
# n6 X( l0 j3 Y3 L$ ^ if A_i=A_leave then send to die9 a r2 J7 R$ r
else inc A_i by 1
) U3 o# ~# x1 _$ v& ^2 f end9 }' j: Y: ^2 C+ i$ G* o5 Z
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,其它按你的 ...
|