|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 U" Y& ~/ S8 T6 H5 l) Y+ R* p6 f' |
我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 i$ {2 C9 R f I' K# ] [
; q3 Z/ j; [! S" f5 G- E m; ?3 J
begin P_read arriving$ x# \) F; J: p4 r; B# J
while 1=1 do begin
& S- e4 h! E) r$ P( f. x3 d read A_tote from "data.txt" with delimiter "\n"9 M4 w. Z( W* i: o
read A_time from "data.txt" with delimiter "\n"6 w. z2 p# n1 S9 n; r
read A_leave from "data.txt" with delimiter "\n"
+ l5 c5 N3 o8 E" H read A_picks from "data.txt" with delimiter "\n"* |) W2 G, X# G" n* q; q
set load type to A_tote/ l7 w$ l3 D0 {: K' u
if A_tote="tote 1" then set A_induct to 1
: b. q( Q0 R! g+ ]; P6 U% C) U else if A_tote="tote 2" then set A_induct to 25 P. \+ L5 ?. [, W, d
else set A_induct to 3 * V( C! i" z7 w3 w6 `3 A: H/ h
set A_i to 0
2 d# A/ E+ m$ u clone 1 load to P_induction
( P8 }+ O# Y7 \# W% E: f$ @ wait for A_time sec+ w8 _! t2 H- R& P+ q( V$ `& x
end
; Y1 q! |1 ]$ n; K! g& v$ {4 R/ Zend9 Z; Z2 @5 z3 H0 S% x5 p1 s/ c
# L6 ^7 c# L: T7 \+ J
begin P_induction arriving) \, @/ I8 \- K# @7 v: w }- A
if A_induct=1 then clone 1 load to P_pick1
3 z% P+ V3 H. @7 i else if A_induct=2 then clone 1 load to P_pick2
2 Z+ T3 h0 _ ^. m' w9 _6 M/ ^ else clone 1 load to P_pick3+ j" F' K, d* Y0 K% E! v# B
end# [# m# _4 H$ N( k
' i$ U2 l% Y9 q n* _$ O) P1 H
begin P_pick1 arriving3 Q' ^9 v+ } A5 a
set A_i to 1$ D6 A& g6 l- G1 G2 z* _
move into Q_induct17 v4 M0 y: b: I
move into pickaisle.induct13 O ~, l& w& S f# V2 _, C. W
while A_i<=30 do begin$ H+ ]; e' z& N" }+ t$ B: T2 {
travel to pickaisle.con(A_i)! }$ j! U+ w' G, d p& c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% Y8 r( o+ X }" }- I else wait for 10 sec! A; ~ a# I& u- H! l5 X8 z
if A_i=A_leave then send to die" f. ~$ s0 J4 h# r0 ]" g1 _
else inc A_i by 1* X/ b7 A+ y# n$ N: C8 Q
end1 T% R: v4 w) G! J2 w) a
end" y7 l4 k2 V8 h5 Z# j
2 f" W( I. D" Z4 ^, F3 e
begin P_pick2 arriving$ C' V0 S3 M& y2 T8 x: E$ a+ i( o# `& p
set A_i to 11. I! w4 ?( l& [( J+ X6 p+ j7 A
move into Q_induct2
! Q5 R+ m% ?: y5 |( W5 P move into pickaisle.induct2
. c% g1 ~0 w2 T2 y while A_i<=30 do begin/ u5 V- y# } b. }5 D7 @' e
travel to pickaisle.con(A_i); W' C/ H+ U0 A9 x0 J |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 k' C- S; q D2 r
else wait for 10 sec' \1 j9 i) c3 B* _* L
if A_i=A_leave then send to die
) A9 m6 n) R+ c else inc A_i by 10 n9 m) D% A; _! z% R. {
end
' X, s/ G& ?# Q9 A: ~! X# f2 R, b$ oend
- C: d4 p0 l% Z
) C! P3 m2 y9 ^, u- L- pbegin P_pick3 arriving
+ o6 _3 o; R" H set A_i to 21
( h4 b9 g% ?4 ~! u2 P move into Q_induct3
* ], m R4 g9 l2 p' k$ C move into pickaisle.induct3
8 a' `( Y) K* y% n; s* W while A_i<=30 do begin
! S! q$ E ~6 d travel to pickaisle.con(A_i)
* c) {+ p0 O3 z: y, G$ P- p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 A5 G. D+ g& D, _, k else wait for 10 sec
5 L& N; k0 A) I if A_i=A_leave then send to die' u) q. N3 @ U2 x2 g- g% Z
else inc A_i by 13 {6 h% K" T. J
end* C4 v/ k+ C" h9 ]6 K& {
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,其它按你的 ...
|