|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢 {6 D! u' I# W. [% I+ @; p) A' W% ?
4 h; R/ o3 ^) [1 i4 I- X' B
我的问题是,在每个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中的数值,不知道会不会有什么不妥。. }& z3 O7 V4 J
2 P, V' {4 _" Wbegin P_read arriving
- s4 Q) w- X; X8 \ while 1=1 do begin2 I+ y4 Q$ H$ p8 v) I7 g+ q. u
read A_tote from "data.txt" with delimiter "\n"
9 P0 Z) u; `7 f read A_time from "data.txt" with delimiter "\n", J) k8 V" u7 Y9 S4 u
read A_leave from "data.txt" with delimiter "\n"# c8 v6 g8 ~" R( u+ n d$ ?
read A_picks from "data.txt" with delimiter "\n"5 m3 V+ O* a6 V2 l
set load type to A_tote/ ?$ x8 ?- C2 v. Q* Q: c/ Q
if A_tote="tote 1" then set A_induct to 17 ?% ^% R6 w: ]- f
else if A_tote="tote 2" then set A_induct to 2
$ T- G# ]" f7 _5 m6 O; P& D else set A_induct to 3 s3 I, R W3 p4 \, Q
set A_i to 0! |, r. L/ q+ W$ C/ b; \! j' z
clone 1 load to P_induction
5 ] W9 J2 v: n. [& E. n9 i wait for A_time sec
" W& S1 P! u- ?: t2 E. d. L end" h" q* W5 J. l- l6 C
end8 [0 d& |: y: W) S" g
( P% u2 G0 W9 |# M5 F- M' Ubegin P_induction arriving
/ Y' n; h1 K, |! I7 e$ ^ if A_induct=1 then clone 1 load to P_pick1
% k( E' x. `$ y% S+ l else if A_induct=2 then clone 1 load to P_pick2
! \) h" }. U6 Q; w9 f# J else clone 1 load to P_pick3# D# s' n0 j5 o: v$ q; U6 B. S
end
$ p [, P2 n6 E9 Q$ b1 U: C. [+ x) \; _6 A# F9 ~! o) D! ?
begin P_pick1 arriving
! `7 a$ g. |5 g: B8 S set A_i to 1, `1 Z- L2 x$ x9 [
move into Q_induct17 u2 q/ u0 U% X) Q8 Y- j3 C
move into pickaisle.induct1' f( X- m$ V4 n
while A_i<=30 do begin5 B, X/ l D. [3 U
travel to pickaisle.con(A_i)( P, @( F- d" h* z* P0 T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) y& j4 U9 ]9 F5 L) v
else wait for 10 sec
% z/ O7 |- E" i+ {3 E4 o* ?1 u if A_i=A_leave then send to die
/ b: f6 Y' l L9 f5 l7 ]. r3 G% I else inc A_i by 1
* w5 q3 x( g) |7 }; P; p- h end5 b5 ^) ]8 c8 ^+ P( C
end0 L/ z# D. j( r' F! x+ }7 _( u
1 o; B+ r9 g, x" k8 Q% q8 S# p" U% S
begin P_pick2 arriving8 M/ G1 k4 j- L
set A_i to 11
3 a% [5 _8 \" {* S& B8 N8 o! \5 ]( R move into Q_induct24 N+ p! `; Y, Y0 g" U3 w3 l6 q* {
move into pickaisle.induct26 s1 s3 S1 r* g& M% [& _
while A_i<=30 do begin( Y$ ~# y7 v4 X
travel to pickaisle.con(A_i)' J. G5 V9 n' [; l* j
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 l1 ~' P# P9 N/ U( U else wait for 10 sec
8 v/ O% Z5 E( K/ B2 E4 C- \3 f, n if A_i=A_leave then send to die
# N" N0 |/ M+ u+ }# V- T8 Q$ M: M else inc A_i by 1
+ W- t1 ?1 c) q. Z0 M5 Q7 L end
( c9 C& R9 A/ e3 M) [end ], k2 f. e3 K- ?! l
7 f$ C3 J7 x* j, ^begin P_pick3 arriving
~; @* H6 K( H2 A: p set A_i to 210 M# @- r0 z2 ^4 y
move into Q_induct3
% j- B* _. ~6 n& B# p$ ~: D2 U8 b( m move into pickaisle.induct3$ H0 A* F" m) @8 h1 L
while A_i<=30 do begin
1 s& b# I" G- y1 C travel to pickaisle.con(A_i)
7 i! m) m9 g/ S5 W! N6 H; B8 t$ e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 M+ |) |; Q. U* I: ?7 Y
else wait for 10 sec" g- k* r: P, v! O0 k
if A_i=A_leave then send to die
" V( r1 j7 y; L6 {5 l2 G else inc A_i by 1, Y- W# x3 g8 p9 r9 F
end
5 i, C% c7 C& A: m/ L5 [2 U3 Rend |
最佳答案
查看完整内容
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,其它按你的 ...
|