|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 ~. n/ n2 d7 C5 [/ ?3 i' s0 z
- g2 s* Q! y: {% w6 a) 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中的数值,不知道会不会有什么不妥。; j! h% z; a$ r1 i: X7 ^
$ w5 ~4 f: T$ M. k9 K& O, s' U
begin P_read arriving; x2 g( b# k; B
while 1=1 do begin
" {/ a$ ^. E! A read A_tote from "data.txt" with delimiter "\n") B% u E0 I/ w/ u1 f
read A_time from "data.txt" with delimiter "\n"5 [+ K2 i- \* g
read A_leave from "data.txt" with delimiter "\n"3 U# h9 Q) ^1 s7 }
read A_picks from "data.txt" with delimiter "\n"5 }9 |& y" B$ S" R; s4 ^
set load type to A_tote$ }. y: \, O! y, }/ n6 n8 t
if A_tote="tote 1" then set A_induct to 1- Y, L* f6 o* W$ u" G0 @
else if A_tote="tote 2" then set A_induct to 2
6 E+ w' {& G- x else set A_induct to 3
0 k5 M. V6 T: X' D* j set A_i to 04 W1 T! b5 _7 u8 J
clone 1 load to P_induction
% t: W+ P* t l* S' z3 I wait for A_time sec# K7 G2 I% ^: ^
end! q8 f3 B7 } f6 v; W
end$ b" O ~* a. z! {
# ^1 e/ s; g# `4 y; Vbegin P_induction arriving
! n) Z D! W3 k" W if A_induct=1 then clone 1 load to P_pick1: m' f3 O0 n; u$ B2 }1 b: k
else if A_induct=2 then clone 1 load to P_pick28 X+ L5 r$ r* \( @: u8 X" K
else clone 1 load to P_pick3' g/ p. {6 C% y' _" S) A
end
R% r' G! o9 a n! ?7 `; U% |- [' s5 W. _9 w. N6 J0 P( F
begin P_pick1 arriving0 X' S8 }9 H7 S% a
set A_i to 1/ d1 a ~% u6 |) ~' h+ G
move into Q_induct1
5 ]' U3 _2 k4 |3 p) E$ ^ move into pickaisle.induct1
& s% G% f j) y6 j2 [0 p while A_i<=30 do begin3 ^# o) M: F7 _1 |
travel to pickaisle.con(A_i)3 t8 \9 F: p% ^! h: W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 S2 t! t" Y5 _4 S: m
else wait for 10 sec9 E; X5 F% d& P j+ U. m" g, _3 H% [
if A_i=A_leave then send to die# e; G2 [5 P6 L
else inc A_i by 1
8 J2 e ~ O# d end: C* x: Q7 J8 D) L* A! ?4 q
end' g5 g4 o' V' u1 I, j+ m+ E, P
y, V0 C: V$ d2 \$ E+ D. s
begin P_pick2 arriving$ b- s- q7 Z' \" Z
set A_i to 116 k$ F+ p! G# |5 Y4 M: ~
move into Q_induct2
2 M! U7 |, i' b! o& V2 p6 r move into pickaisle.induct25 v3 k& o1 j# \' B1 E+ M, M1 a/ ]
while A_i<=30 do begin
; Z7 K) n. d2 A+ g; y& | travel to pickaisle.con(A_i)% ]5 g) A/ ^' S) q% H6 p
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& |& Q( n" @" v) {
else wait for 10 sec
# G3 t! @0 O1 R: a* G if A_i=A_leave then send to die
- j) d, r, A) u. L4 D H& _ else inc A_i by 1
7 k2 N9 M3 T3 [ end
5 W+ Q1 D$ r& w3 G' X ^3 dend9 p1 `! Q5 B9 R1 Y1 a2 \; @' ]7 F2 F
7 E- i! d! J8 Y9 X9 M
begin P_pick3 arriving
) n" X( h7 M; u7 w+ W set A_i to 21
1 Q1 e) q# m, ^3 C move into Q_induct3
5 h- y8 c7 R$ }; U( q* k move into pickaisle.induct3
* ?, o) P6 X4 Y6 U4 F, N" v2 s while A_i<=30 do begin
9 Y" o) s, H* x9 g$ ] travel to pickaisle.con(A_i)5 S: x9 Z. K+ H. z9 f+ [1 X
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! X* b, f, E/ n+ v6 F0 S
else wait for 10 sec( W7 S6 a/ I# ^/ N0 E' R
if A_i=A_leave then send to die) t! y8 I _& o0 _/ {4 Z6 w, w
else inc A_i by 1/ j1 w; t7 e/ q7 g
end
. E& b7 }- _6 qend |
最佳答案
查看完整内容
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,其它按你的 ...
|