|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ R) f+ f3 @; f; o# p( t, T+ g# w
3 J( K/ K* l7 Y5 ~8 G我的问题是,在每个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中的数值,不知道会不会有什么不妥。: s& ?, L( A' {
6 B, d, n/ J9 ?begin P_read arriving% r( D: Y$ Y/ J$ I6 u3 c |
while 1=1 do begin6 C6 @: w, s9 Y5 l' m
read A_tote from "data.txt" with delimiter "\n"# R! s+ e) B+ e2 r+ J3 s
read A_time from "data.txt" with delimiter "\n"
3 c7 H5 W6 j9 ^' S3 O/ `; M read A_leave from "data.txt" with delimiter "\n"+ k3 V5 Q; k; d6 h" ~1 y1 S9 B/ ~: E
read A_picks from "data.txt" with delimiter "\n"
, Q4 a" h$ `* u, X0 b6 A5 f% ~ set load type to A_tote
n( z9 b) u# T @, r/ U if A_tote="tote 1" then set A_induct to 1" Y, b, N5 h; t! |' n# e( D+ ~
else if A_tote="tote 2" then set A_induct to 23 C2 W1 p* ~* T3 s' Z$ r
else set A_induct to 3 8 b, I: X- g; u3 \
set A_i to 0
; X2 T* X: Z9 T/ `+ N. i7 G) p clone 1 load to P_induction* {5 A+ P2 O- v8 e: O
wait for A_time sec
5 O/ A1 f+ \& k! x* e+ L% F9 t end* d* ~) P/ N1 n' {7 F
end
; f/ j- K5 A* w% B5 I9 \ v- ~# X6 `1 a. T
begin P_induction arriving! U5 z( [6 b4 e% Y1 T
if A_induct=1 then clone 1 load to P_pick1 }3 r; h- E6 z5 g3 q" ~: W
else if A_induct=2 then clone 1 load to P_pick2
( @0 R$ v1 I/ Z4 _) Z% L else clone 1 load to P_pick3
e7 r5 t- Z7 C9 B9 ^ w' f7 D9 Zend
" y" Q7 ~8 c8 n$ m- a
8 s% r5 }4 q1 m* ~begin P_pick1 arriving6 p( Q4 W/ V$ m( ?
set A_i to 1
* i R# @( l5 P& I+ u7 Z move into Q_induct1. P% }! z' i: M+ t& v' G' R0 V+ J
move into pickaisle.induct1! c: V" m1 |; c) ]' {. Q% K, a
while A_i<=30 do begin
) i9 z3 L5 v: e: ~6 _" \: B travel to pickaisle.con(A_i)/ ~' W. d/ | j
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ b& w5 G- [- Z2 m" y6 \
else wait for 10 sec, L* R+ l$ s$ a$ H4 I
if A_i=A_leave then send to die
* ?2 q7 u$ H; d; m" P" a else inc A_i by 10 `( S' `0 D% N) d7 }% p
end$ T/ ^4 {% `: j9 {( a& B; ^
end
. ~& _8 k. i' a7 I5 F, U! E' n r, Y1 `6 W
begin P_pick2 arriving
0 w& K8 m0 Z, W( J; P set A_i to 11
. m6 T0 Q' F0 p' y move into Q_induct2
. g- z, m4 B; L move into pickaisle.induct28 f0 O, P0 _/ u- h- Q! y
while A_i<=30 do begin) Z( M! L( R$ J9 W" V4 r. [4 Y
travel to pickaisle.con(A_i)* G! l9 X3 e3 R0 H/ ?" C5 r# @# @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% p4 g% Z7 G v* w
else wait for 10 sec% p( g1 H O& r3 x% r0 ^
if A_i=A_leave then send to die
: R- ]) j6 x, a u* |. j else inc A_i by 1
& V$ \. `1 P% ^ end9 e# S% i+ N; o" A. D* Q& c
end
6 K* G' t: _# W( F* c
8 n% C# k/ x7 Q3 n: Dbegin P_pick3 arriving3 `; m6 P% }8 R- g2 W& o: I
set A_i to 211 a& e g5 o" _; R. R# a/ o a% q' X
move into Q_induct3% {# ~ k7 Y# N$ V* M* v" v" a" {
move into pickaisle.induct3
: _2 n+ e; e' D: u while A_i<=30 do begin) B' X9 b! j+ \6 |1 V
travel to pickaisle.con(A_i)
$ |2 L) i5 j/ p$ ]4 A. H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* [3 @) t6 L6 [2 ]9 p8 N$ E# | else wait for 10 sec* e: W5 o# e4 E% K- r q, v
if A_i=A_leave then send to die
4 G- l, E$ d9 ]; T else inc A_i by 1
x( _9 C$ J0 j) E5 K end- F6 a5 A) ]- s: c
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,其它按你的 ...
|