|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ Q; g8 h' m" d8 F4 u! W1 v
. H2 c, S3 y4 |# Y4 w9 D
我的问题是,在每个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 F( d5 c. ~' g6 D% M. S
! q' p- ]* h4 I5 c; u1 P8 ]begin P_read arriving% l* o% M4 x9 B9 u+ r! m4 m
while 1=1 do begin
B: w( N& I" Y# v7 a3 { read A_tote from "data.txt" with delimiter "\n"
b! S4 H+ f/ H" _0 |: z1 }" @' S read A_time from "data.txt" with delimiter "\n"6 J; b' J7 _1 G3 @0 E& z
read A_leave from "data.txt" with delimiter "\n"
: y+ y6 B7 o' O' C% S read A_picks from "data.txt" with delimiter "\n"1 k1 N5 ~9 a* Z) |7 b
set load type to A_tote! M' \" J$ R+ L( ^, d. s6 z4 u
if A_tote="tote 1" then set A_induct to 1* `7 O( k* ~7 ~1 p2 S
else if A_tote="tote 2" then set A_induct to 2% K% y5 D4 M5 q! Q
else set A_induct to 3
% D+ m2 u, I4 s H; u set A_i to 05 F/ t& i2 ^1 [& X7 L9 ?. M
clone 1 load to P_induction
6 u* ~% B' _6 w( t8 h7 I8 M3 E! e wait for A_time sec
8 _* R3 u9 l8 R4 ^ end, E$ C2 o2 L/ ~# Z
end1 M- r4 v6 Y, H- d- Q7 z5 Y, s$ o
& D) b- j! d4 Z' y6 Y. P U- |) U; Wbegin P_induction arriving8 J* y) ^& |6 T. r
if A_induct=1 then clone 1 load to P_pick1
) }8 p* ]7 B& l/ U6 y else if A_induct=2 then clone 1 load to P_pick2
% w" G# @1 k# V! T3 z$ s else clone 1 load to P_pick34 Y4 M m) r+ x9 R9 \- O! @+ f' @
end
8 i# c8 y0 q4 M# T; V; Q
4 {+ d! C, N% I7 ubegin P_pick1 arriving6 x7 x; a5 B) {4 _9 e: p$ b
set A_i to 1% V$ x: \4 i- q, C2 |
move into Q_induct1
7 T2 U" g) L- O7 l' z m& L move into pickaisle.induct1) B3 q: J- f6 s1 |% |8 G& i
while A_i<=30 do begin; l Q: k& d0 O7 W" y, x
travel to pickaisle.con(A_i)
3 j$ s6 G, x% |9 g6 z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- H4 N+ q: }$ x' Y
else wait for 10 sec
; U6 |/ j9 C- {# N, u" ` if A_i=A_leave then send to die
7 l" c* z5 Y9 L" v5 \6 x else inc A_i by 10 c9 o7 g+ O6 [; K5 ?0 x
end
: v; W: g1 E! ]: ?$ z4 S/ s4 Fend k- C i7 [! p% L
- k* T: O$ Y: G3 x, l: Q, ?begin P_pick2 arriving
6 K- V q' m, K8 \ set A_i to 11
% a& l) {+ q1 N4 u9 T move into Q_induct2
3 |* l+ {9 y; v! a; U move into pickaisle.induct2; M5 \, r( M4 Q; S
while A_i<=30 do begin
" N y( _! i* k travel to pickaisle.con(A_i)
9 ^5 | Z- E* P; [9 @% k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 w+ x( ?8 H- C# g else wait for 10 sec
) S' T( q3 Q" j' j if A_i=A_leave then send to die
9 h j5 Y6 `/ {3 ~; z else inc A_i by 1
$ v9 G( h. I1 R' r; G end
2 ?1 J9 x5 q; i) L8 aend
6 Z$ F/ N0 `! C. ^- [1 `: ?: y; S* t+ O
begin P_pick3 arriving
% o" |$ _: D, b+ N5 F set A_i to 21
5 P6 D: U( u; O3 Z$ L4 I: s move into Q_induct3/ D0 o% d# y2 J6 Q! l# s4 j# o
move into pickaisle.induct39 x5 ~, _7 D3 L! R$ ?6 i& k) A
while A_i<=30 do begin' f7 A7 Z; ?0 ~% M4 U
travel to pickaisle.con(A_i)
7 A0 u. C6 [ y/ D2 \- C* \6 W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 \ } w* L- c* I c* d
else wait for 10 sec
( O2 K$ h1 p% \* n4 R) T7 D if A_i=A_leave then send to die* D; x' A- m( T* d
else inc A_i by 1
2 z+ j- s$ F# g4 A% m4 m# h end
1 N. f' l" `4 @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,其它按你的 ...
|