|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 U/ n$ r. s. v- g6 T$ h
+ n6 G Y: A, Y- q1 B3 z我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( c2 n, {& i: W* l* Q2 w8 z8 ?9 ^9 |
begin P_read arriving
& e! G# n3 O$ V t% J while 1=1 do begin
+ V; M, E" I4 d2 H read A_tote from "data.txt" with delimiter "\n"
* B/ J) l: Q/ I" U read A_time from "data.txt" with delimiter "\n"
; R" U6 b) s- c5 l; n" m5 `; V read A_leave from "data.txt" with delimiter "\n"5 K6 U0 V: \+ ?
read A_picks from "data.txt" with delimiter "\n"
. ^! {( @9 o0 T! m$ E2 E set load type to A_tote* a6 s8 z7 h. D! Y+ w4 i# o, Y
if A_tote="tote 1" then set A_induct to 1
" x4 Z- T' N+ z! E6 n: n else if A_tote="tote 2" then set A_induct to 2. o5 w1 G2 N, n5 l2 |
else set A_induct to 3 2 m( s7 o$ C& L3 |, x( d* X. _
set A_i to 01 N' e5 {* {0 J( M. l- Y
clone 1 load to P_induction
3 G4 e# b- m D! [+ l8 e wait for A_time sec
& C$ y" `/ T5 q7 W) v. f8 x end: {2 s) b1 }2 T M& I( V, W: D6 x
end* ?/ ?' P. E8 Q% A
$ s1 [4 P3 q4 sbegin P_induction arriving X8 ~/ A0 V1 b, M( w: M3 [& m
if A_induct=1 then clone 1 load to P_pick1
* V* F- V- I& G, s% ^$ u' w, O4 L9 W, D else if A_induct=2 then clone 1 load to P_pick2/ u" G" c. e/ g$ w4 t
else clone 1 load to P_pick3/ [8 t, g$ `3 V9 F& Y
end
{/ u+ [. k2 \7 p8 N) K/ C+ s6 k, N8 F* N3 M" k
begin P_pick1 arriving) }. ^" |( Q e
set A_i to 1
; B" J8 F& Q/ X move into Q_induct18 j7 r4 ~5 S- }
move into pickaisle.induct1
: [# c, [" P+ M5 S" @+ H# T0 V4 i while A_i<=30 do begin
" e5 ~0 \0 N3 D# D& x4 o travel to pickaisle.con(A_i)
1 I) i! z, ^* g/ S; {) F5 ^& _ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( g5 u/ {% D7 c9 i) y else wait for 10 sec
$ y* R$ N" f% P' Y! W% P if A_i=A_leave then send to die! P! }6 j; `" l% r
else inc A_i by 1
: S. R6 k( R! N! _% y& P1 A9 J end
6 B- x( j$ e- Bend. x; F' x9 \- }, d% v0 c b8 ]
7 I9 O; ~3 @' j& W7 ]
begin P_pick2 arriving! `1 R- d4 s+ e' o0 H, P+ u
set A_i to 11
/ l3 R5 P$ @, y3 N) ?. x! r; A move into Q_induct2
3 i1 E8 u, r2 s2 u8 [0 o* s; L move into pickaisle.induct20 t* f* q+ I, C
while A_i<=30 do begin2 f; ?, F9 O& Q: g9 T
travel to pickaisle.con(A_i)/ L: {! I* H3 [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( b' l+ t ^2 r6 T7 c
else wait for 10 sec
2 e! p; T; h9 {8 P. q if A_i=A_leave then send to die
# X1 I. `% _9 v" C# S' ` else inc A_i by 1
, B9 H: o. e' O* F' N6 k end
* b, B1 F% F E; T% E3 yend
5 d L, J5 q7 ]
2 q; j+ m7 [' u& Y; X) t/ ubegin P_pick3 arriving
: `% n+ b4 Z3 U0 x ?2 r set A_i to 21
! d: f {3 b) ` move into Q_induct3
& K1 d$ H6 t- C( j" v move into pickaisle.induct38 ?$ X2 w# O J+ p" I, d8 w7 k
while A_i<=30 do begin0 C# U8 r4 ]6 `8 ~. u
travel to pickaisle.con(A_i)$ k' ^- g. f a. n6 e% E- w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% P+ P, W! Q/ ~ \" j else wait for 10 sec1 u2 f8 _' N* T f% R
if A_i=A_leave then send to die
6 C5 c* A" _$ ?) I else inc A_i by 1
9 b- X" S: k; R: E) G+ h end% o5 D7 b2 O8 K7 {5 z
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,其它按你的 ...
|