|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& C. {" W0 k5 a/ ^/ @0 k7 m* w) g
( A Y4 x+ ~# O我的问题是,在每个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中的数值,不知道会不会有什么不妥。0 ?% u, |" K- [9 C o
% U% ^5 H4 Y( E- C+ y% X" Dbegin P_read arriving" u9 S% K5 U3 f$ e, [
while 1=1 do begin
3 _9 S/ U, l% d0 e6 d0 {5 A6 ] read A_tote from "data.txt" with delimiter "\n"
: m1 p9 M! b5 | read A_time from "data.txt" with delimiter "\n"# \$ S" h" R* u. L1 L1 ?* m
read A_leave from "data.txt" with delimiter "\n"
: k, y9 I" n/ b6 `- H read A_picks from "data.txt" with delimiter "\n"
D$ j& ~( `- f6 Q; p% V: [% k set load type to A_tote- O( S6 B3 Y0 ]& z t
if A_tote="tote 1" then set A_induct to 14 V) e' @/ O: Z: `' @; d9 V
else if A_tote="tote 2" then set A_induct to 2
. [$ K3 V2 @3 i) L" G @1 ^ I) M else set A_induct to 3
: [# o$ n5 E8 ?/ u( _ set A_i to 0
, }& F& F" O' C6 A# F clone 1 load to P_induction
. n4 Q" t- L8 z wait for A_time sec
1 s6 s1 x; {: d/ k0 D0 m0 w& s end
/ |, D# I7 j+ A0 B* Cend
% j2 g4 F; N, a+ i1 |, g, ?9 [, D( y! Z5 H
begin P_induction arriving
/ f. I- J. d' L. j" F if A_induct=1 then clone 1 load to P_pick1
: c- l% t0 Y9 ~! z! a else if A_induct=2 then clone 1 load to P_pick2; B: T# c8 ~6 q- N
else clone 1 load to P_pick3% ~! o9 P7 Y4 \9 Y0 O9 d3 V( Y$ y
end
0 U- H o8 J6 E/ E- K
* Q! r% }" C8 b c5 `$ x4 {begin P_pick1 arriving
C( _, {1 d7 y7 { set A_i to 1! v8 ]1 ?8 i& l# p- E
move into Q_induct1 M$ p. ~" [" I( a3 M; v. \* i' P
move into pickaisle.induct1
8 N- J; y9 A6 {) E6 C while A_i<=30 do begin7 k8 i5 }( y$ x( c# i4 ]; |
travel to pickaisle.con(A_i)
8 V- g$ n! v2 |# p( y$ X1 \7 ^9 u" o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 X( l2 K: S" }8 \, y: B else wait for 10 sec
1 \0 m3 g6 b7 C4 k9 f if A_i=A_leave then send to die! D! y2 e- y( G& P% q
else inc A_i by 1- w, {/ r/ N2 J( A. N
end2 U& Y9 {) y2 j4 `
end3 c! t. }1 X4 e9 }: [
5 n1 \' D( z4 X g
begin P_pick2 arriving
6 _9 d& n. o' x3 e6 S set A_i to 112 C q" B: O% u/ F) Q% c( f: |
move into Q_induct2
" I9 [: m# v9 y move into pickaisle.induct2( _; t7 { ?0 \% j( z( ~
while A_i<=30 do begin( ^+ Y5 [8 [* g# W4 n5 A$ L. Y+ A
travel to pickaisle.con(A_i)8 _. M# m! F7 w; |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 l/ y) x( ]# ?3 C7 s
else wait for 10 sec5 E$ ~# `! R& r3 J) d$ I9 ~; r" w
if A_i=A_leave then send to die
2 w9 h3 {( B5 V, I else inc A_i by 1( a7 N; p0 ?& v" w: t- U9 S
end
s ^3 `( t! n3 c8 nend
4 i% P& w9 E' R# F% Y6 C6 s; G8 |% H9 a
begin P_pick3 arriving* @/ {1 O1 h* Y$ h
set A_i to 21
. [! q3 s8 u& o: ?8 s move into Q_induct3
4 y8 _; ^ P2 E8 T move into pickaisle.induct3* q( \+ N/ n7 s& l ^0 W1 T: |
while A_i<=30 do begin9 r' y( O( q* D4 X0 z+ S8 E
travel to pickaisle.con(A_i)% |/ Y D2 Y5 i1 E/ z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, ^5 [: g' k$ K" g' g8 m
else wait for 10 sec
7 Z, e7 v! R( O7 O+ v" F, p: o if A_i=A_leave then send to die
1 j9 @; L! O/ a' g7 \9 P else inc A_i by 1
) e O0 @& u _7 @7 s. j end; S5 U5 y! D$ ?0 L/ ]* _2 O
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,其它按你的 ...
|