|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; g- B5 v6 A- N* ?1 L, @/ W. F0 q: I; ^; 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中的数值,不知道会不会有什么不妥。3 |4 ~3 R1 @1 F8 B
' z/ p. I6 k' l3 w" x) x8 Bbegin P_read arriving
- f& d: h; L0 \3 ^. f9 k while 1=1 do begin
! Z4 H) d9 V( M4 ~ read A_tote from "data.txt" with delimiter "\n"( {, C* y1 W7 ^% Q5 v9 v
read A_time from "data.txt" with delimiter "\n"
8 N: T8 A3 U$ v! }) r, }/ k read A_leave from "data.txt" with delimiter "\n"
$ g2 r' v/ A9 \$ g read A_picks from "data.txt" with delimiter "\n"
' _/ Y4 {0 I& E- M set load type to A_tote
G$ x( H; o% g7 M) E2 f if A_tote="tote 1" then set A_induct to 1) K" y2 n, \4 k) l) ?
else if A_tote="tote 2" then set A_induct to 2
% S& m) @2 B! T* T) W# ~1 S) K3 \ else set A_induct to 3
1 }, r2 B, [) B. H. h set A_i to 08 x0 z. r, H2 X, C
clone 1 load to P_induction
7 Q/ i% E6 Z3 T. g" e2 }" I wait for A_time sec
/ q: [6 n5 |5 y% V5 p end
4 P2 i! [3 e& f q, cend
; P# `6 g8 S+ B& O f! o% P
7 H p# a; l' [begin P_induction arriving
4 I4 {8 \/ {# K& ^8 v3 L& }5 g if A_induct=1 then clone 1 load to P_pick1+ {8 b2 Z" T6 \) Y! `
else if A_induct=2 then clone 1 load to P_pick29 V- Y' B) R2 Q$ _9 t8 N F8 x
else clone 1 load to P_pick3
2 D6 M; I8 B5 f0 h0 `( zend
# V$ l/ p8 T# @- W6 H6 _" z9 s# P0 t
begin P_pick1 arriving5 Q6 p$ t- Y, F5 h
set A_i to 1
2 v& }" m7 l: C ^1 h( R+ | move into Q_induct1) b1 U: d: Q, c$ G- G4 |% j
move into pickaisle.induct1
8 ] {# f7 { U; `8 t$ g/ U while A_i<=30 do begin% [" w9 ?: T9 G) y
travel to pickaisle.con(A_i)
5 \2 |8 t/ Z j' @2 _ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ Y8 X# D9 g4 i: I else wait for 10 sec
! ~* ]4 _7 n" S" o0 G& d/ G if A_i=A_leave then send to die
0 Y, o. s0 o& M else inc A_i by 1, H2 B+ V& |- A) K N. [& i
end
) J& b0 o5 j% @3 k& Send
- \, e/ D+ b1 l8 V- g
# D2 R. D- m. rbegin P_pick2 arriving, Z/ j8 ?6 S1 B0 U3 P( n2 N% `
set A_i to 114 }. ~0 D6 w R# L
move into Q_induct2
. g; i# ]( t/ h8 U+ @ move into pickaisle.induct2! m) R" l6 f9 O' ?
while A_i<=30 do begin
7 j2 ~/ B9 k9 X2 }2 d0 d9 }1 [ travel to pickaisle.con(A_i)
" s1 p5 X4 Q2 w- S, L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, j" n' b3 b- Z! f- q& L' v* T else wait for 10 sec
! L( ? G/ l) Q9 n9 f9 S" i if A_i=A_leave then send to die
) G: c, d- G8 J S else inc A_i by 1
+ l; B; b0 N' y5 b" L0 v- Y& x) A( | end( c* v8 \/ [2 _( b. @
end n# @; |' q3 y8 j( ~' O
" w1 V. Q8 b4 W3 L0 r) b+ p& v
begin P_pick3 arriving3 p% A; |; x$ Y' ~4 [9 l) z6 m
set A_i to 21
$ V& c' L6 ~& N5 G: Y% }; Z0 s move into Q_induct3+ L8 u7 s! l" V& m$ d9 ~
move into pickaisle.induct3
+ Z9 c% B7 X$ |' v) @( c" [+ v0 T while A_i<=30 do begin
1 c% h" ~4 ]0 c n6 X/ P1 \ travel to pickaisle.con(A_i)8 ]/ b6 [" E2 X$ E0 w O3 i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
@5 \8 h/ ~) z( }0 \+ j- X- {3 P else wait for 10 sec
# n/ Y; ^; ?2 a6 F if A_i=A_leave then send to die
% T$ D8 V% _9 l, i& |% k% W, L* O3 L else inc A_i by 17 o0 s, y5 L! @! E
end
! F* \( ?: v+ w! P c5 I+ ]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,其它按你的 ...
|