|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( E$ u% F+ v' B5 [ J' {
1 A8 v; Z; L" d7 R3 Z0 L# s8 t1 ^我的问题是,在每个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 _4 j L9 a6 ^. M. ?; U2 R7 S4 A; ~8 J' h' f. ~$ k
begin P_read arriving! R6 M+ J* i' n+ I7 D( g9 R5 Z
while 1=1 do begin2 {7 W* h7 x& g6 a- [4 B1 J
read A_tote from "data.txt" with delimiter "\n"
% E/ Y4 L" x& l0 O2 w read A_time from "data.txt" with delimiter "\n"
& F$ P0 i* [; M7 ?1 J5 O0 C4 a read A_leave from "data.txt" with delimiter "\n"
" I- z% x7 T; \" `0 A- G% M; N' m% d read A_picks from "data.txt" with delimiter "\n"
2 ]5 B/ U3 R0 A# ^1 k set load type to A_tote
! T5 \) J: A% N9 X' F; `; S if A_tote="tote 1" then set A_induct to 1
; g" b5 W: o% c& f+ P. f else if A_tote="tote 2" then set A_induct to 2* c7 A& ]8 |2 w V3 b8 J2 _
else set A_induct to 3
$ l# M) d& R. c% g1 ]/ r set A_i to 0
' c! D1 l: ]+ {$ Z2 g H' Z clone 1 load to P_induction
! K1 K$ _% X8 ?2 `) {. y( I wait for A_time sec
7 W( q4 e; n/ X. z end& U, }5 v! v2 S9 @% g V! M
end
k: V, \% x1 ^/ e8 y/ H4 B/ Z3 w
begin P_induction arriving
/ ]" \7 \& q+ x if A_induct=1 then clone 1 load to P_pick1
: K' F% F2 C+ m; N else if A_induct=2 then clone 1 load to P_pick2- u& ]/ `; N9 \8 M5 y1 E) l* I- Y5 f
else clone 1 load to P_pick3
- s& y/ ]& E' o" d8 iend
4 b8 q9 g8 F3 O* p+ s1 `4 U; p' D4 ]6 M- \5 g
begin P_pick1 arriving
1 c; ]7 O/ ~% r$ i j set A_i to 1) a+ V0 y, k6 U. j; @- L
move into Q_induct1) h& G1 r: V9 k/ x; w. ^
move into pickaisle.induct1' {# {- w% a; g4 B' x6 v& K2 s
while A_i<=30 do begin( G- X7 R& F1 F' W L) Q
travel to pickaisle.con(A_i)+ H- r- [: _# c6 I$ _/ r3 ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 {+ z* Z& h* T) [* a( r( g+ x8 S else wait for 10 sec4 S, U4 E# V0 B" x, u f. S( R- P
if A_i=A_leave then send to die: C; @1 }2 c# t0 U
else inc A_i by 1
% C- Q) r* ]; f) x end7 L$ k) t% o+ C: r0 ^- m
end1 h" y8 d' h% h8 G: @
- d# p" s4 x" I$ b& k: U) o( C
begin P_pick2 arriving
, x2 N* ^, _3 a* t, \# H# ~ set A_i to 116 N/ s/ c2 S9 K+ x
move into Q_induct2& W1 E: U1 Q9 X; F. y" W
move into pickaisle.induct2
% w2 G# l: `% U* h. E while A_i<=30 do begin* U. b7 ]5 `( s
travel to pickaisle.con(A_i)! U& d3 V5 J' r. ]& @5 I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) q4 m! C( v4 U6 t1 J
else wait for 10 sec
# W8 s6 j! B5 U% I) P5 x if A_i=A_leave then send to die
3 S k# Z* w- ^( j% e1 j: s else inc A_i by 1! W3 O5 c% Y. z6 E% u2 m
end$ M% d3 m& u6 \4 X
end/ Q2 @ J3 o' E3 F# J" w+ s$ |
% ~' _4 e9 R' R# w1 c5 K9 ybegin P_pick3 arriving3 Q& E7 B0 ^7 i$ Q+ k- T3 S7 L* N
set A_i to 21
i: Z* {4 p1 T9 j* i move into Q_induct3- _0 H& @; P6 E6 W! D/ d& C
move into pickaisle.induct3! M E% t) }: p4 ^8 `+ x# y& q
while A_i<=30 do begin
5 O, Y. K0 T! d travel to pickaisle.con(A_i)
5 [0 U! w) N7 S" Y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) b7 k8 K3 w. X, o2 S0 y. i
else wait for 10 sec
( ^3 I2 f) z- s E4 ^+ w& _! G1 r if A_i=A_leave then send to die1 h* M3 W1 L. W! d- b: l0 d% Y
else inc A_i by 1
* v8 i/ X9 H' U5 R6 Y end2 ^0 {: I3 W& u1 `8 i
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,其它按你的 ...
|