|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 ~, M+ O! X. Z5 A- {2 K: S
4 l' U# h% I. f2 S我的问题是,在每个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中的数值,不知道会不会有什么不妥。# `1 p( s3 A" B# C& t j! J
: m7 N' p8 F& k0 ]& D
begin P_read arriving+ t- F. s2 X) L8 T' N3 e$ S, A8 A* m9 |2 z
while 1=1 do begin
# E0 y* u8 A7 N3 C read A_tote from "data.txt" with delimiter "\n"
* L2 _; R9 s! E read A_time from "data.txt" with delimiter "\n"7 u/ m2 ^) g. T
read A_leave from "data.txt" with delimiter "\n"
! T7 [8 G* C0 G: E/ z) A+ b read A_picks from "data.txt" with delimiter "\n"
% d+ ^1 B8 D; ]$ R% B5 w% |2 j9 ^ set load type to A_tote7 \7 K9 ~3 O. J3 ~
if A_tote="tote 1" then set A_induct to 1
3 @6 p" M3 D8 G2 X, Y* {1 ?5 M else if A_tote="tote 2" then set A_induct to 2
) I% k& `! P! J# Y- `6 @8 m; G9 @ else set A_induct to 3
$ W" Y/ D& c) L+ x* T0 ~ set A_i to 0
, q3 g! g5 W+ l# a clone 1 load to P_induction
0 k s7 o4 Q0 p! l% D. ` wait for A_time sec# c3 |4 C0 P5 Y3 u
end3 d1 ?' Y. b+ p5 ]
end
7 s0 b. ?' v& f4 ]) [. d) H
( J% {+ F/ a8 Fbegin P_induction arriving
) R( ]4 }4 O! V7 B if A_induct=1 then clone 1 load to P_pick12 ^* o9 ]1 A( C
else if A_induct=2 then clone 1 load to P_pick2
3 F% U. R2 q1 _+ e& a% X else clone 1 load to P_pick3+ d: K9 H! e0 e4 R6 ~& m* _
end$ G; |5 G6 ^7 k, z g# K
5 W. x ?6 S/ _. C) ~9 ^begin P_pick1 arriving
1 j3 s5 N, O z7 D' A. K) N4 E set A_i to 1
' a; J; M) w# F1 s+ @7 D move into Q_induct1* z- V2 I; A: Z! L4 ^1 D2 M7 p
move into pickaisle.induct1. s; j( I; C* o8 e
while A_i<=30 do begin
# ]( z0 {& s) @/ B travel to pickaisle.con(A_i)0 W& y8 i% x+ m. Z ]: Q K
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: y. R1 E% r8 C' | else wait for 10 sec6 v: e& a p5 Z* Z1 f4 P, k
if A_i=A_leave then send to die1 f$ ^8 ?; ]2 d
else inc A_i by 1
6 c4 s' m! [, O5 [; g3 I# e end D( k* U- ^- V* }6 y
end) X" Q/ C: M9 J; m2 N" h
/ C! `& H! y2 p# }
begin P_pick2 arriving ?" k# u: z3 F; j D( k
set A_i to 11! K3 p) Q" Z* Y1 E( @* Q
move into Q_induct25 ?# a+ F: [) f h. f8 {- F- y
move into pickaisle.induct21 I* ~: `8 l1 O* _* I8 g
while A_i<=30 do begin
7 T+ G! {& {2 D: N1 | travel to pickaisle.con(A_i)
1 V& N! ^1 H% \9 j/ Z: }6 T+ L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 Q( Q. m9 c. S
else wait for 10 sec
# g% [" N4 ?5 k" t4 C2 f$ h if A_i=A_leave then send to die( P6 Z; K8 B) t6 J" b
else inc A_i by 1
0 v' ?7 o/ w' [! H4 D. [5 `5 ~ end, t% x4 b6 `8 @
end" w' e% N2 n$ V' H; k2 I3 W
( f5 `4 N. @- n: z6 g0 W
begin P_pick3 arriving
$ M% C6 A$ K5 O/ K/ Y% z+ {) w set A_i to 21' G. c3 }$ j* M6 l: i2 O
move into Q_induct3
' A" ~* z# ~- Y move into pickaisle.induct3 u" z" D( S3 K# d6 }. o1 n, ~! p; R
while A_i<=30 do begin
9 j+ r; C9 z; [2 ]% t( S) F travel to pickaisle.con(A_i): H5 P; s# w. s- T x) |7 i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* W; {/ }6 Q' C# S
else wait for 10 sec+ Y" W0 b- c _3 y
if A_i=A_leave then send to die& [1 A+ s h3 `1 b* e3 m) V
else inc A_i by 1 {7 j! U. Y* M7 M/ ?3 B
end
3 e/ j5 Y B! d/ zend |
最佳答案
查看完整内容
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,其它按你的 ...
|