|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 _. M p6 T3 I7 n8 }
$ H- s7 }6 I. L z; _7 k' G: K' G9 @4 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中的数值,不知道会不会有什么不妥。3 \2 c, z4 K& ?' [
' l" ~" b. ~6 k1 Gbegin P_read arriving6 b) [0 T6 }# g$ p1 N# R2 \
while 1=1 do begin+ N3 [& P% T4 d0 w* V. r
read A_tote from "data.txt" with delimiter "\n"
" x, j0 o) c& ?1 Y read A_time from "data.txt" with delimiter "\n"; \4 ^/ ^; c% ^! q6 d
read A_leave from "data.txt" with delimiter "\n"2 H% ]: @- H9 Q' b1 u, U
read A_picks from "data.txt" with delimiter "\n"
, m0 A" }: s: q' u set load type to A_tote) l% ?! Y- f" ^" Q! U4 {
if A_tote="tote 1" then set A_induct to 1" z+ K/ O$ F1 A$ H
else if A_tote="tote 2" then set A_induct to 2
' i& a( Q$ L) n$ ?+ p else set A_induct to 3
k/ p4 d k: m z# q set A_i to 0# ]' h- y/ m% \+ L
clone 1 load to P_induction7 Y' W T2 _3 W9 c* e
wait for A_time sec
7 m+ O7 A4 M2 W end
9 V' ^ H9 ^7 p( b7 o0 Yend6 o6 U" G- J! n# {$ d: b
' w: N. U* j+ X5 C" I
begin P_induction arriving
' n: o+ b" ]! M% }, S if A_induct=1 then clone 1 load to P_pick12 g8 N; d0 D: G. O
else if A_induct=2 then clone 1 load to P_pick2# N# ^# ]" \+ {4 Z. \
else clone 1 load to P_pick3) l$ M7 K: n4 B
end
+ r/ z3 s. d9 v6 M) G: J8 g
) D* A4 I7 ]% m# J% X% jbegin P_pick1 arriving
3 m1 A( \9 b# S7 y/ w set A_i to 1: k! F: D$ m8 u' U: Z0 ^3 P8 ]' y# Y+ A
move into Q_induct1
) c R: i( T. |3 y0 c move into pickaisle.induct1. i+ j* i% @. Y' ]' V
while A_i<=30 do begin4 q' h4 ]& b* g5 K
travel to pickaisle.con(A_i)$ W1 s* E7 G0 r, g6 K f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- D* c: v5 }* v8 n1 m
else wait for 10 sec
# E# ]: {3 I, j2 s if A_i=A_leave then send to die) R) S* F4 ]% ~+ P8 [$ p
else inc A_i by 1
; F& j1 V. Z: ]/ ~, ` end+ [3 u2 }! l2 G( }6 V9 d7 R
end
# g9 r Q8 Q8 p$ ~; G! \! e: E- q# G3 S$ i7 V$ B& L" M
begin P_pick2 arriving0 Q3 f2 w0 b9 W0 `) o/ w2 G
set A_i to 11! B/ h: Q! k! V3 W/ F% C
move into Q_induct2
$ n; ?% {2 q2 Z2 l1 S' t: q move into pickaisle.induct2) O5 l) {0 c* D
while A_i<=30 do begin
* Q+ U+ A( k0 J travel to pickaisle.con(A_i)
# I) B" K. X. n" Y) d3 s& p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 T- ], ~" P" z5 u6 v/ F, Q6 ^
else wait for 10 sec3 g% G) b2 b5 {$ ~# H
if A_i=A_leave then send to die/ i0 \; ~% ^6 y* u$ S N
else inc A_i by 17 X8 w: W% V2 t6 s" {
end3 E: R% e# f: }6 D
end- r1 }% S# p& q* ~! E
: ]2 `' [. u8 Z$ |1 ^% X6 y* q# nbegin P_pick3 arriving
6 W% e& A; o( u7 o2 B+ t7 g; B; O9 ~ set A_i to 21
1 X7 I' a% M& }- R" g move into Q_induct3
0 c+ }( P0 x$ j: P+ u- L8 W4 M move into pickaisle.induct3
8 x- L# H5 {! P7 l) a while A_i<=30 do begin1 O' A) T! L0 H; O
travel to pickaisle.con(A_i)1 b6 b8 w& X. ^! D1 H1 R
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! k* M+ X2 J% w8 b else wait for 10 sec' S) a% \7 S- }! E# \0 h- j
if A_i=A_leave then send to die5 `/ O3 L: Z6 e. K
else inc A_i by 1
4 D$ B0 Y/ {6 Z% {. m1 d- `3 o end
, v. _9 @$ e- P; j0 M0 n2 @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,其它按你的 ...
|