|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ l3 d: b% g; q3 E* ~9 h- I3 G1 D1 g- h, O$ H" V9 s
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 E7 Q: n. n7 K6 R6 H% b* f( [
9 K" L+ V4 B# t. r* N! {; bbegin P_read arriving
4 r# j6 }) D: y3 o while 1=1 do begin
0 j" ^% x6 [' x5 A; a+ W- w0 ?7 d* h read A_tote from "data.txt" with delimiter "\n"
- ~' _* l1 ?2 D* c( v8 V7 b5 D3 D read A_time from "data.txt" with delimiter "\n"3 h: \$ U; k, Z, @
read A_leave from "data.txt" with delimiter "\n"
4 m% C% W5 q+ j% V% `1 r read A_picks from "data.txt" with delimiter "\n"9 [) G6 p, n: f- i
set load type to A_tote
, B5 z! Q: s% o+ c* ~4 O# i5 q if A_tote="tote 1" then set A_induct to 1
+ u4 X8 S. w4 U! G( m7 V- R6 o else if A_tote="tote 2" then set A_induct to 2/ T, A3 i, o: n2 S: v8 A
else set A_induct to 3 1 K% p1 S/ I4 G; g
set A_i to 0, k4 p( K( I: U3 W1 t
clone 1 load to P_induction
5 n. W) n/ ]8 I, ` wait for A_time sec
) x) A4 U6 p/ |2 Q0 |, x end0 Y, j+ X" H; U- a
end
3 X2 I% |) a2 q2 b
: D4 s4 j. b2 w3 N2 Zbegin P_induction arriving
2 C$ j( ^& \! x% x1 T if A_induct=1 then clone 1 load to P_pick1# S9 K! X: o8 J2 o7 H& O
else if A_induct=2 then clone 1 load to P_pick23 e2 g- E4 \' s6 G, M
else clone 1 load to P_pick3
" [, H6 m5 I4 r# @, E$ Wend& |: a5 @; K9 ^/ S0 U0 R3 U9 N
3 q! f s5 s% w" M( J. h+ Q0 g
begin P_pick1 arriving7 K" S3 x! F5 \
set A_i to 1
) H( l% d' u# B: m) k move into Q_induct1
& ?: T z" M) _3 K: f' ]3 @: T! E move into pickaisle.induct1
, f9 E2 E0 v+ j. ?' h while A_i<=30 do begin
1 s1 A2 p0 b+ M5 L1 N: [1 N travel to pickaisle.con(A_i)6 g, G$ e9 \2 V- ~! G* L. ~
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 H9 ?, D, v' m7 c% u2 A3 x/ m
else wait for 10 sec
' d- e2 N$ K" A- n1 s8 _* u if A_i=A_leave then send to die2 g$ D# i+ H$ b
else inc A_i by 1
' }# T2 ?. B# q0 R8 P. g end9 p% S& ?" L0 _# w6 H* s
end
) |5 S& x: j( N2 f5 E/ P- ` ~3 W6 \# P, Z/ U0 }1 z* ^! B
begin P_pick2 arriving
+ {# j; M" P I set A_i to 11" O4 E7 F0 y3 e
move into Q_induct2
# ~0 X. t9 \" A& i6 m) a# b. ` move into pickaisle.induct2
2 w. ]5 _* |' |: L while A_i<=30 do begin
4 C# m# ?! `' Y9 q! t travel to pickaisle.con(A_i)6 u* t7 p. f' ]' }
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 y" O! g; D* M4 w8 }+ a! @5 ~
else wait for 10 sec# \' K" p4 b; a8 o$ N8 ~5 K
if A_i=A_leave then send to die
* u7 q: a7 |. a1 e0 T, T: e- b else inc A_i by 1
. D* d6 u `! C5 ]3 | end: |3 ]' L) Y$ @: C% H
end
7 w, p& k8 m X9 |, f" v$ @) Z1 }5 f( n/ I) M9 ^8 G- `' j
begin P_pick3 arriving5 `$ B6 B. |" Q3 q# O$ d
set A_i to 21, u4 S/ O2 j% u4 x
move into Q_induct3
% w4 q2 x- C( W move into pickaisle.induct3
0 r6 D3 _9 I! K while A_i<=30 do begin T; f5 A4 {$ i% Q5 v
travel to pickaisle.con(A_i)
# F" ~8 V" F* o1 t$ e7 R if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
w9 @1 ^: j$ t5 }0 l else wait for 10 sec/ I/ V2 F* B- F5 F. J4 m
if A_i=A_leave then send to die
9 X. c1 R* U3 z( {# k9 I0 c1 \1 L9 c6 @6 I else inc A_i by 1
' |1 v5 `* K: A6 y, ~& i end s6 K/ L; y: ^) ~1 Z o3 w. d& s
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,其它按你的 ...
|