|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 N( I+ ]0 R/ I. r( g, X. L
$ e# b) ~( s3 ^我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 S+ D1 N$ i6 x& F9 n6 ^
6 `5 Q, H1 c7 J- K0 G$ _; o2 x+ |7 G
begin P_read arriving
; F4 f+ g1 S' |) ^ |- l while 1=1 do begin/ I. { R0 E8 J( |4 a
read A_tote from "data.txt" with delimiter "\n"
0 N. A3 R. W7 f, S4 K. a+ K read A_time from "data.txt" with delimiter "\n"
; @: I0 g7 `0 M read A_leave from "data.txt" with delimiter "\n"
$ F6 _+ D0 M ?8 ]1 j read A_picks from "data.txt" with delimiter "\n"
8 x- k" q$ ?+ e% |0 A set load type to A_tote
' L# ]! [" p' { if A_tote="tote 1" then set A_induct to 1
2 y! I$ G, g4 A$ a+ B else if A_tote="tote 2" then set A_induct to 2
6 ]* [! T; p/ U1 s" t else set A_induct to 3
: l& D8 d: L% Q set A_i to 0
. w, U3 c8 ^' s" e" A& c$ I4 q clone 1 load to P_induction9 ^! J' \- Y- a7 f' `
wait for A_time sec9 k O1 _+ e- p9 M! l4 d0 o
end( M; w! T! L' W7 B
end* C, b; j9 e) t, P
. S8 \. V( Q! A* E* y2 ~& \3 W+ Nbegin P_induction arriving
4 D8 }* r5 h- L4 b if A_induct=1 then clone 1 load to P_pick1
* S, `) U2 q1 d1 f& K else if A_induct=2 then clone 1 load to P_pick2
5 _! I+ h1 V; h. ` else clone 1 load to P_pick3) v6 U8 I4 i+ n% X7 O+ I
end J$ z( Z! t6 A8 x/ o, f2 ~
- k* Y6 v& k9 V6 v; @1 `
begin P_pick1 arriving
0 T' C2 ?3 r) |7 D- \) u set A_i to 1
) i) N; O: p; o, m+ H# d: o move into Q_induct1; x9 O) o/ I, `5 _1 A9 f
move into pickaisle.induct1- ]- x3 w" q# ?, a% T% t1 ?
while A_i<=30 do begin
) m& s% o! l& Z travel to pickaisle.con(A_i)
" U! }: `5 k% f: ^6 Z- C1 A" }' ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ M: q% I% {% g- S5 z5 i
else wait for 10 sec' c# \5 {# l! [' v7 A5 u
if A_i=A_leave then send to die
- y" W, R/ i7 Q3 X# |0 y else inc A_i by 1! n( B0 Y$ K. P
end
' }9 ?9 s' w1 {7 c2 {' tend
2 r2 o6 [; w* l
3 m' X6 N8 ?$ Pbegin P_pick2 arriving
; J5 y9 d0 s3 R |/ ?! G set A_i to 11
& G: g; @5 Z* ?# E* n0 \ x# j move into Q_induct2
/ x0 m5 h4 u2 \% S' l move into pickaisle.induct2' x9 g/ O/ n& M# `3 j' S3 ^! w
while A_i<=30 do begin( u. I" c2 J' a6 `+ S" }7 ^% U6 K
travel to pickaisle.con(A_i)2 K- s: A4 D, q3 y8 y' R
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 ^8 Y" `. b" ~4 l# u' d& r9 ]+ n" M
else wait for 10 sec
5 Y' T* f0 d: N* z1 E8 K if A_i=A_leave then send to die
* }- F3 W; f$ Y' o: E else inc A_i by 1; J, D0 i, L, s3 R0 o4 E, Q, j
end
+ x5 H _4 C. l) Q! tend
& C' q5 e/ D: L" W5 T1 R& o% Z# q7 I) c) B
begin P_pick3 arriving3 s' F( s, s8 Z1 f: G" w' a& u
set A_i to 213 j/ M% Y6 J1 Z: ?( ~6 {+ T
move into Q_induct3
& M9 F* t9 p- O# m0 ^4 m2 P) t& J move into pickaisle.induct3
/ U- U7 }9 m& [# W" n5 N while A_i<=30 do begin
o2 ?# d! d+ R travel to pickaisle.con(A_i)
7 p" a5 h6 M7 V1 E+ \ K0 b# e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 G* u9 u% C$ R* S' J else wait for 10 sec
- X4 O% B& _: f6 J/ T. i if A_i=A_leave then send to die
. }3 i# ~2 W5 D( I# f else inc A_i by 1
0 S3 k# R Q: R5 u end6 ?6 Q% y4 l" m' ?+ I( o0 Q0 ?. U
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,其它按你的 ...
|