|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 Z/ e, i; R0 Z' U) c% j- l* U) \# t: b* |7 y3 e& x
我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 \# Q: i- z; x7 w& U i
. t0 J& M' p2 z0 A. H' k7 L+ v6 wbegin P_read arriving
9 Y6 O5 S2 k+ G2 E( i while 1=1 do begin9 X' o; L. ]+ G7 V$ Q! _
read A_tote from "data.txt" with delimiter "\n"$ G2 A$ f/ l' I) h& W: j
read A_time from "data.txt" with delimiter "\n"" v! }+ I! x% V4 z7 `
read A_leave from "data.txt" with delimiter "\n"
- n& r& M4 {$ h. {; I read A_picks from "data.txt" with delimiter "\n"
% K+ T6 T- X+ g set load type to A_tote
- \7 ]5 S4 i9 D) l5 B& C% A$ `% R) l if A_tote="tote 1" then set A_induct to 1; p* _. \8 }. f
else if A_tote="tote 2" then set A_induct to 2" u0 @: ~: X9 X/ t
else set A_induct to 3
# @4 w w# ?/ |' K. i set A_i to 0: d3 t& ~, x1 V+ \( z- ]; E
clone 1 load to P_induction
& r( i4 N- B0 e1 T5 I7 j' ~# K" } wait for A_time sec- f: x% P% F+ Z/ f5 @% m; K
end
8 r& T1 e K- p3 M1 Rend
$ o/ q$ D" K( ?! E) l
& F& ~. _5 j2 j" H5 y5 A& kbegin P_induction arriving/ _; c$ u! [/ F9 t9 C4 f+ j
if A_induct=1 then clone 1 load to P_pick1; y: `5 q5 t6 q! T* S
else if A_induct=2 then clone 1 load to P_pick2' k$ t- i3 q3 G: x0 y. H; j( Z
else clone 1 load to P_pick31 S, v, p9 w8 B; o( E b% j- D
end
- ~+ F, I" z' E* t5 W# ~
0 a2 P) {" d( n; Ubegin P_pick1 arriving
7 Y4 i$ t2 X# f+ J8 W% [9 C set A_i to 1
, m# {- x9 E4 G% | move into Q_induct1
8 z1 @5 v* |2 F; p" u- S% L move into pickaisle.induct1% Y: B/ h0 o6 F! |
while A_i<=30 do begin. w5 t' u @3 I# [% _" Q% Y
travel to pickaisle.con(A_i)' N) _( ^6 f$ V/ d
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 x' u7 K( u. \) |4 F* g0 C else wait for 10 sec
: Q! ~/ J8 S) r D7 Z+ t if A_i=A_leave then send to die
0 P/ T' w- U+ K* v0 s5 |% { else inc A_i by 1. d3 _$ o7 Y: q& B& q
end
2 C/ a% F9 d# j( n8 X5 l# T: oend, s& n0 P& c4 X0 j
8 z# P* r7 S9 @, ?begin P_pick2 arriving7 S! f w9 ~. G( b) v' [
set A_i to 110 B% O$ ? g) \
move into Q_induct2
% `2 X9 d( D# W. D. p move into pickaisle.induct2 h9 G6 j- w( H8 |6 u
while A_i<=30 do begin( {3 s! B9 j( r2 V, E' I7 E* f+ k
travel to pickaisle.con(A_i)6 Z+ F6 n7 u. V4 w) h4 Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 L7 o; r3 O2 z9 S
else wait for 10 sec
* _$ i9 C( M7 p3 P5 L3 Y# w if A_i=A_leave then send to die
( A1 c$ j& K) \ X2 z# D else inc A_i by 1$ t+ L3 [/ F$ }6 ^1 }$ e
end' q: {' Y5 k0 z, ^9 \
end& n! p. F9 l2 H; G* Y
4 _" V: k) a2 T0 S+ i- ]
begin P_pick3 arriving, j; h+ _" d3 F' y% N. k
set A_i to 21! r0 z7 w0 P2 n5 G' Y8 J' f/ Q
move into Q_induct36 l, ^( c6 I e4 p4 }" t. E' A
move into pickaisle.induct3
# `' N# K$ d5 c3 H# |% q7 r/ J while A_i<=30 do begin! g0 E( e% B$ o% x8 D
travel to pickaisle.con(A_i)
2 B2 F2 G! t( k; g# m, g if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
B3 [% `; u$ @) Z) X) @! J& n7 \ else wait for 10 sec
+ f/ s4 k* t# G3 L if A_i=A_leave then send to die4 \' x* t/ }' \" r! I
else inc A_i by 15 p5 U* O$ J6 _- s7 d
end. g+ q' R* o" X% {( x' i1 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,其它按你的 ...
|