|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, k; \0 A4 H9 m/ V! l8 M' g
7 T; u+ e t4 [- V1 `; u' w我的问题是,在每个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中的数值,不知道会不会有什么不妥。, ?' V# z+ N5 R
. t0 F4 o9 F! n, i- ]
begin P_read arriving
8 x' G, X) T; c1 ?' [/ `9 @ while 1=1 do begin
# \5 d0 x0 R' T) }5 v' s read A_tote from "data.txt" with delimiter "\n"- o. }( Y/ f1 Q5 `
read A_time from "data.txt" with delimiter "\n"
' B' W L& P# o* h3 G8 d read A_leave from "data.txt" with delimiter "\n"
; d, V1 H$ Y/ E) z( H5 d read A_picks from "data.txt" with delimiter "\n"
9 V7 W; l' W9 J8 z# K set load type to A_tote2 c" Z5 F, M; b
if A_tote="tote 1" then set A_induct to 17 D9 c6 V+ b/ _+ i6 t
else if A_tote="tote 2" then set A_induct to 2! |5 o) \) ^3 R5 j8 L# }
else set A_induct to 3
6 C7 A3 K6 M, _" d set A_i to 0 I4 k7 s. U5 U8 {% J
clone 1 load to P_induction5 j0 n4 A/ P( A9 m" }, |/ W
wait for A_time sec
$ {2 C H$ V7 X! ?- a, U, A end8 i, c3 |9 s% T0 H
end
5 Z% q6 {. u- D! M9 N" n% T/ L, L" f4 Q( P; ]8 b
begin P_induction arriving
5 J- u% t) B0 I. n6 X, W g$ a3 m if A_induct=1 then clone 1 load to P_pick1
: X% |+ ~ I4 r+ G: { else if A_induct=2 then clone 1 load to P_pick2
( e m6 p# Z6 m- ~+ |: i$ O0 @, H else clone 1 load to P_pick3: h3 C1 L4 N9 p5 \7 g: y' y
end2 r+ G z( h7 Y
& ^6 W3 Y+ g- _- n$ m& S+ qbegin P_pick1 arriving
$ Z$ y: y2 e( h& ?# [! `! Z set A_i to 1& {8 F% n. J3 p
move into Q_induct10 J$ \' b1 a# S; y7 D( `
move into pickaisle.induct1! w1 c( o0 ~1 i: S% [9 h
while A_i<=30 do begin7 U- O$ E' L# f& D8 Q; x; r' W( i2 F
travel to pickaisle.con(A_i)
& e/ G* F( [! u2 W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 p6 m& ?/ _, T2 Q
else wait for 10 sec/ o/ ?0 e4 |: z
if A_i=A_leave then send to die/ _& ^) u* J* I; ]# J) r" p2 C
else inc A_i by 12 A( d7 |* l- X. \' o& r
end
% P+ `: S) F6 e E/ Lend
* S8 K$ w5 ]0 _* _% {7 @
1 k# k) b9 G0 O- Sbegin P_pick2 arriving% |1 m o: Q: G. Z
set A_i to 110 g4 @ l& `; V6 s% S
move into Q_induct2
- z: k; O$ j% R K move into pickaisle.induct2
W" [: T* _7 G while A_i<=30 do begin, x& u& [* K) h% D) L$ I7 X7 V0 y. b
travel to pickaisle.con(A_i)
1 ~9 u5 v! G8 g& `5 }+ Z- b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 l/ j7 o( A9 k else wait for 10 sec
5 G2 H* Z/ e1 W1 K" @. L if A_i=A_leave then send to die& k7 K- q3 W' k7 K
else inc A_i by 1
9 S# q2 V3 Z: z* r; z0 G end3 M& U3 r" w+ c( e4 E+ J
end
% R* X: U% k2 L5 y2 f- o: n: [+ z# h9 a! w4 \
begin P_pick3 arriving& x0 P# K% G8 x; }5 r7 L9 l
set A_i to 21" K1 Z% _( [) V2 s
move into Q_induct3" r. J+ k" l6 U0 u' o
move into pickaisle.induct3
3 E- T+ W7 s$ w `: {9 g' F while A_i<=30 do begin
& h5 f4 F3 n3 g( B( q( y travel to pickaisle.con(A_i); ^+ c2 r; g$ I( O+ x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 V; a7 [: D1 E6 L" k3 K" ?
else wait for 10 sec
: L# ?" t; n1 Y8 O/ b if A_i=A_leave then send to die1 ^) e8 k* {# c0 b, ]! x6 t" c
else inc A_i by 1
: p/ K$ n& Y1 g( X& k) n: }1 r: x end
1 u' i# V8 u$ x* n' B- v( Cend |
最佳答案
查看完整内容
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,其它按你的 ...
|