|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- `- I. l- d2 ]4 ?2 T5 o; u% L! [* f) P& u7 H
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! ~, ?( f K& L$ L' m! G8 k6 w+ B( M( T4 k8 c( g" }) |' g9 L* V- x
begin P_read arriving
5 A% H( m1 M+ u while 1=1 do begin* B( }4 P5 l% N0 n8 y$ m
read A_tote from "data.txt" with delimiter "\n"% x0 X# t! Q& t" |9 g0 v
read A_time from "data.txt" with delimiter "\n"
9 p5 i: `1 u0 J read A_leave from "data.txt" with delimiter "\n"+ u, X4 W6 K9 W9 b9 [& A
read A_picks from "data.txt" with delimiter "\n"
% f; }7 P6 A& b' H( \! o set load type to A_tote
- W) T( |- J, `- g if A_tote="tote 1" then set A_induct to 1
$ d5 j! V6 t" b/ k# A else if A_tote="tote 2" then set A_induct to 20 k3 M H" r9 L+ W) l ^
else set A_induct to 3
5 ^9 ~% p9 |! M9 M set A_i to 0
0 {# t' D" M$ z0 H clone 1 load to P_induction! l) J; a; K" c* ]) s" _: R5 U
wait for A_time sec
' m5 f* u6 x+ v" Z7 L& | end
% v7 g9 {- W: a0 ^) W0 ^8 Iend
1 c2 f, X% l# Y. c2 x* d2 W7 |! D+ v9 L
begin P_induction arriving) K# [/ \* F, V5 r/ h# p
if A_induct=1 then clone 1 load to P_pick1( \- r: m. ~2 T5 K- N
else if A_induct=2 then clone 1 load to P_pick2
# G _0 X6 U+ Y6 z) r$ S; B! J else clone 1 load to P_pick3, i* S s) q, ]6 y# M$ o
end
% {% K! M' h$ m4 e3 y* Z& X, Z7 Z. F2 I. ~: [$ f
begin P_pick1 arriving% O7 o" D6 }" e! m- p& |8 R1 N$ C
set A_i to 1
; ]' `6 I1 H8 o5 t move into Q_induct1' ]1 n& n" g7 {% f# S, }, \
move into pickaisle.induct1
! d l0 I* K2 W% D( a# x while A_i<=30 do begin; R3 o$ k/ D0 r! F1 A M
travel to pickaisle.con(A_i)% B2 p1 ?' n- P1 f* u" o' ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 L0 n' B6 k% Q% Q1 n8 ]* Q6 r
else wait for 10 sec7 n/ v) z( X5 e) L3 `5 X) a8 @
if A_i=A_leave then send to die# a* _* n, n# v% i0 D. P5 m
else inc A_i by 1: u3 H; @+ s) u( ?' V; x7 f8 K
end! e& z; O8 v2 Q) J- l3 A) V+ l0 W" L
end
9 c6 C- W8 w. \, {' k. c7 z3 E1 k6 q3 x# z
begin P_pick2 arriving
. Z7 I+ Y! E% u5 ^: I set A_i to 116 c' c C0 ^$ |8 I2 W F
move into Q_induct2. u/ g* q. b9 L
move into pickaisle.induct2
. T8 E* C X" R9 o$ ] while A_i<=30 do begin
0 O( a* I P9 a* ?. i7 v travel to pickaisle.con(A_i)$ l6 f# Z5 ~: p' x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 I- m; g; l, P8 P; H' ^
else wait for 10 sec
9 K- I; D! u8 u; E7 q# C if A_i=A_leave then send to die! h4 O5 T: z7 S) l; X' }$ q
else inc A_i by 1
& V/ \8 @ p% w, ` end1 L! ~* J0 u5 K5 r7 v* Y% X" e
end
, N# ?+ T9 W4 X7 X; w( o8 [4 }5 q# L4 @. r
begin P_pick3 arriving
5 E! K2 H Y. c6 ]; T* l* \( i set A_i to 21
0 O( I) u: M$ C# G: w) v9 ^9 Z move into Q_induct3
# Q9 Z$ Z% i2 p move into pickaisle.induct3
# z/ J. Z& c9 @* l2 S' t/ r4 t while A_i<=30 do begin" ?( t( T+ R& K# }% j% E
travel to pickaisle.con(A_i)7 s& x; N; O: s6 L
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 y7 T$ P* Z( R' P" H
else wait for 10 sec
2 k$ D _$ Z7 j. Z l, `- X p) \! a if A_i=A_leave then send to die
" l# x1 E6 L1 O) P# x else inc A_i by 1/ J8 d( Q1 a. U0 R2 {, |+ v
end
& Y9 a+ s* Y& Yend |
最佳答案
查看完整内容
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,其它按你的 ...
|