|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 u# [" d" x; z, Z X( K* _
+ t& ^4 \, B1 M) t4 r8 s( F我的问题是,在每个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中的数值,不知道会不会有什么不妥。& |. c$ V- B$ |) j4 a0 i
& m7 ~* }( I! ^; vbegin P_read arriving: E' \' x( O9 X. G, c2 M
while 1=1 do begin
9 _# t5 T) ~# C7 c" Y read A_tote from "data.txt" with delimiter "\n"
; s- N- }1 W& a# a, b' F5 \8 Y0 B" _ read A_time from "data.txt" with delimiter "\n"' I" f4 P% T! o. t& c! ^
read A_leave from "data.txt" with delimiter "\n"& n6 f0 N2 S6 H* S+ m2 e w6 F0 x
read A_picks from "data.txt" with delimiter "\n"( H ^. `; l7 g. A% l) b
set load type to A_tote$ c9 {' e% r3 N# \* ~! j
if A_tote="tote 1" then set A_induct to 1
7 K9 j% {" k* Y else if A_tote="tote 2" then set A_induct to 25 @1 F) n% x4 [9 D( ?
else set A_induct to 3
( q) X- E$ W3 h. s, Z set A_i to 0
: q) g5 N; V7 l* C. v clone 1 load to P_induction# P, q9 Q0 J# d0 d" l2 @& a
wait for A_time sec! u2 l* k# p- |$ p- {
end' I1 y1 |. s5 o" {* k' x
end( m2 O( P6 v! a1 Q( r3 w
- i( s" v+ q7 L; | A Sbegin P_induction arriving, i' ^, q5 j2 {0 O4 T- s) b6 C
if A_induct=1 then clone 1 load to P_pick1
) t( k) {" c4 ] else if A_induct=2 then clone 1 load to P_pick2
# X1 i V G1 n& [" Z4 q& R' q else clone 1 load to P_pick3
# }- q& d# l! `# N& v7 J! ?end
. f1 m' ~, n: b0 L
# c" C" a# a' C. r& w9 g2 ]9 [+ B2 Ybegin P_pick1 arriving3 L! s% |8 o% m6 \2 ]% W9 _8 G: w
set A_i to 1. ~3 w6 W1 s. e; Z
move into Q_induct15 R" ~9 T8 U3 M7 v" b
move into pickaisle.induct11 M. W$ R" y8 G5 B* M- N4 F' I
while A_i<=30 do begin% K) `* A8 b; W, ]
travel to pickaisle.con(A_i), z/ A" d1 b% u3 X$ z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% ]9 v- _4 R5 s0 o- ?2 I! T else wait for 10 sec1 M5 K' l2 r9 X. L% g8 D, K
if A_i=A_leave then send to die
) ~6 f; e% D: g else inc A_i by 1
% w2 m' Y W" \7 U0 p6 g4 p end/ o+ w: t. A0 Z) W
end4 V/ ~, l5 n- z0 B
5 N# o% k( ]- T a" {; a
begin P_pick2 arriving- _ e0 h1 L& D- P! R
set A_i to 11
! i$ t* d; O N' i- `+ @ move into Q_induct2
- n$ V2 l v% e( R) ] move into pickaisle.induct2
# a4 a) [* a3 q while A_i<=30 do begin' ^ J8 s/ J6 x7 B ~
travel to pickaisle.con(A_i)7 u0 H, W# g& f1 T/ ^) f' T5 }
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# ]! P6 _# l. _ else wait for 10 sec' S! e, p7 v% l, h4 E
if A_i=A_leave then send to die7 x) n7 \2 l! Z7 ?
else inc A_i by 1
2 a- e N `: O O end$ j1 {7 ]7 a9 k/ t0 f
end
2 t9 r5 r/ X0 G1 p! s5 G5 M, R
! t f/ u" F3 @begin P_pick3 arriving6 F' c+ H: F2 P! |
set A_i to 21
$ K# ?2 H# j# I# \$ ?; z move into Q_induct32 T0 E) j5 ]7 `* D
move into pickaisle.induct3
# O5 R y# j3 q9 w while A_i<=30 do begin
& Y' {6 Y) P" H4 } travel to pickaisle.con(A_i)
! J' u* F4 Z9 I `8 S2 q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; I/ g8 z" [: u$ L$ u, W
else wait for 10 sec
7 E; E1 q( |& v6 X. N' I2 D' E if A_i=A_leave then send to die1 W* i$ `- ?& L x+ ~
else inc A_i by 16 f1 {: N: u( Q2 ~" K
end) D; k/ p+ s- l' O. q% ~# X
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,其它按你的 ...
|