|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢 X7 @; \% m: ?& L' `4 D! v9 D8 y
% g( A3 e* a2 s' O1 v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# k0 p2 D, R/ c- W, T4 u/ ?3 a+ {3 O( \& b/ r
begin P_read arriving
% Z1 p" ]5 N2 k1 S% x! c( R while 1=1 do begin; M9 ^& q* X0 F3 c- n7 T: Q0 z
read A_tote from "data.txt" with delimiter "\n"
6 S& }( D- P& _; f( u read A_time from "data.txt" with delimiter "\n"
, c4 g% n4 Q' k7 s read A_leave from "data.txt" with delimiter "\n"/ X% U) x' ?; ]* |" m
read A_picks from "data.txt" with delimiter "\n"
" ^( R8 g, [5 [0 y9 t set load type to A_tote3 @2 ~; K, e3 A" n0 m) D
if A_tote="tote 1" then set A_induct to 1
$ w! N; Z: t5 \% i5 ^+ D else if A_tote="tote 2" then set A_induct to 2) S6 [2 X! G( m
else set A_induct to 3
# k6 {3 `& X3 E1 { set A_i to 0, Y5 {% S: c1 m6 t. @8 W( c$ t
clone 1 load to P_induction# l" z8 ~6 l s! R; Y& r7 q
wait for A_time sec
0 p3 q) J2 m! v7 R; b) t end
" z1 Y6 [5 h0 F& `$ r1 }2 O s) oend
) V+ a9 }: L" b. `8 ?* v# T, s1 m9 k6 O9 [7 r# a1 |
begin P_induction arriving
; F$ F1 u' F L& F V if A_induct=1 then clone 1 load to P_pick1
6 x) U' h c7 \/ g else if A_induct=2 then clone 1 load to P_pick2 k# w- e8 j' k. i3 `
else clone 1 load to P_pick3- V' L# ]( T# C5 M, { v* U% p% ^
end- `: w: a0 G7 T- C
/ R/ s( K3 `$ u* j4 J, Q
begin P_pick1 arriving
) C' a% D! M3 L8 ?- e& _* m3 R set A_i to 1
' v# l2 e% s; O move into Q_induct1
: J G7 y0 S: [8 _# Z4 y move into pickaisle.induct1
* s. ~1 S" T" c9 t/ I while A_i<=30 do begin1 _7 V# g# M2 ]$ _9 d
travel to pickaisle.con(A_i)2 {" ?8 q. @& e7 u7 H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# m. ^5 ^* s. }6 }2 f) G* J; X
else wait for 10 sec
/ T1 X/ b# N& W9 f' J if A_i=A_leave then send to die6 ?2 Y7 E/ V" ~# [$ r- A
else inc A_i by 1/ K4 g& Q% n+ I- E
end
7 Z$ K- F' K W4 j: o0 ^end; S% I/ h/ m2 n. {/ v7 a9 ?
! `% |, p; ?$ c ~begin P_pick2 arriving7 D8 |" ]3 M' w
set A_i to 11
% }- W/ A8 j+ c1 C& | move into Q_induct25 j9 C7 m, w7 n
move into pickaisle.induct25 Q+ y, g8 G, I+ t! M# v- F
while A_i<=30 do begin; @5 {" V" j) t) p
travel to pickaisle.con(A_i)
4 g- x5 }2 \# B. P, d1 J: t if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ }+ R5 {8 a( C- [) T# Q5 V
else wait for 10 sec3 e* W3 Z; ~& _8 H
if A_i=A_leave then send to die) t8 S8 @; \; ?9 [! h
else inc A_i by 1
, W I' q, Y- G. _; O5 G4 C end
- _ {: R# B6 cend" p. x& |1 L7 q) Q4 _/ \
" s$ I* V5 h7 Z( `4 m6 l \
begin P_pick3 arriving. d0 h$ d& T5 c/ x9 e) N
set A_i to 210 d5 p6 p" n' D. C; Z8 h e2 P/ J
move into Q_induct3" K) a: l3 W& x5 N: M8 {6 r
move into pickaisle.induct3- k# s+ P0 p* w7 F
while A_i<=30 do begin
, i! i% K* s6 Y% m8 c# V6 ~/ g travel to pickaisle.con(A_i)
# [& J+ `, x7 z2 a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, d$ `7 W4 w' P
else wait for 10 sec u/ f+ f- f7 D% J/ N+ G
if A_i=A_leave then send to die
e; g. g& A2 R9 p3 i0 G* l# B+ N, b. b else inc A_i by 1
+ Z+ y0 S" S; x- e end
" }0 z, s! ]! s% \ j, M5 `# \* D( jend |
最佳答案
查看完整内容
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,其它按你的 ...
|