|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 r2 h+ {6 [- V: D3 o, r0 H
6 K: K0 m0 R6 ^+ |% Y: d我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) ?+ i3 A, t6 ~2 O; A& f3 G" w6 u8 W# i, ^' S% t
begin P_read arriving
* E( {" N! f3 P8 c* F& \ while 1=1 do begin
) k4 o7 }5 N! I, \4 E& U5 M' f- ] read A_tote from "data.txt" with delimiter "\n") {" d" U6 J( y
read A_time from "data.txt" with delimiter "\n"
5 S/ n" Y4 `. X9 Y read A_leave from "data.txt" with delimiter "\n"' S; P( H7 v/ T$ H) d' ?: O0 h: [
read A_picks from "data.txt" with delimiter "\n"- I' d1 k" i$ ~) J" [' G( p% L: C
set load type to A_tote1 Z' ?; E4 ~& [/ t. W" q
if A_tote="tote 1" then set A_induct to 1
$ Y* F, L) j1 H( v U$ E' [1 C else if A_tote="tote 2" then set A_induct to 2. t8 w) M- U$ Z
else set A_induct to 3
1 N! h; W: V# x/ W \& ~ set A_i to 0
+ u1 P+ H# M; N8 G" D& n clone 1 load to P_induction% q. n+ R. ]% u6 L& J, o
wait for A_time sec. A" x# o6 H; ?3 r4 m; L
end8 M% x* y5 r' [$ w. T5 M0 G
end U, j: P1 r' H8 w+ n
( ]% E- I$ {# L( E* A, `$ O
begin P_induction arriving
6 V# r" P9 O ~& s if A_induct=1 then clone 1 load to P_pick1
: D- q& n# F* n+ B/ n8 f+ { else if A_induct=2 then clone 1 load to P_pick2. N5 K% q" J. a
else clone 1 load to P_pick33 E6 F5 S; K, Z( }" E
end3 g; D; q; y( Q* F) F0 T
+ \/ t5 A- o* S0 Z& }! u
begin P_pick1 arriving( ] f1 ?, p0 ^, G2 w' o& Z
set A_i to 13 k# ^! Z, [5 y- c k
move into Q_induct1
: X8 N% W4 Z9 z0 H$ @ move into pickaisle.induct1. R$ f4 ]5 W7 d7 e a
while A_i<=30 do begin3 f& Z7 }' d3 [# o- Z4 D. z
travel to pickaisle.con(A_i)
7 L; K, t7 I8 P A5 d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' {6 \; U$ B5 c& ` else wait for 10 sec
9 w0 W3 s2 U- v if A_i=A_leave then send to die. v5 K" i+ a1 F+ L) ]
else inc A_i by 1
# F6 ]" j0 i! e% P B- i; v# Q end
: ~( T. |+ R1 {end- c( c2 J0 ~* k# K
% V5 Y* r9 @: Y6 f1 q2 m2 fbegin P_pick2 arriving/ g( |% D1 x2 [5 ]: y0 _
set A_i to 11' Z& v3 |$ M3 @+ |4 \
move into Q_induct2
+ ~$ f# V% t. W7 L+ Y3 q move into pickaisle.induct2& Q7 Z% z9 ~# r; e4 h' H* g9 S
while A_i<=30 do begin
+ N: r2 y% g- F4 T, Y# i travel to pickaisle.con(A_i)5 ?% t' V8 @+ L' ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 a9 O X, t2 V5 k2 b- {
else wait for 10 sec6 D1 n: Z4 l$ z/ t# w/ N8 k
if A_i=A_leave then send to die) U6 K" o, n6 e- u
else inc A_i by 1' @( P; T* y( `$ @
end
+ N7 P8 D1 J2 \) B; G2 W9 ~end+ ~( w+ h& d! S$ T" O
% q& J( P* I% B, [" \4 c
begin P_pick3 arriving, C- [( u0 [0 ~
set A_i to 211 u# B+ q J$ B( f7 Z" y
move into Q_induct3
1 Z' H; b' B7 |2 ] move into pickaisle.induct3
{6 D( I. h+ r& F& |' C8 C. o while A_i<=30 do begin- A% q& V1 ?0 Q, v5 [
travel to pickaisle.con(A_i)8 Z0 a+ i' I/ V" R
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. t. o8 x8 Q" @2 t6 q else wait for 10 sec: `/ ?% Y- @$ H' X
if A_i=A_leave then send to die
: Y. ~# o" D! G. k3 ` else inc A_i by 12 d# r; I! l' b& ~" ]# X
end
, b! {+ H0 }- A9 X7 Q1 S; ^! jend |
最佳答案
查看完整内容
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,其它按你的 ...
|