|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. Y2 ]# F! k0 b* I0 u# _4 N" X+ A* z7 ?& Y' X8 ?
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# D: P* P4 v Z$ Y& Z- o* ^5 D
9 t4 i, ]& n' D) j, f0 q- bbegin P_read arriving
& R0 ~7 a6 j! n+ d7 @/ P while 1=1 do begin
8 z3 Z$ Z* ~0 I( X read A_tote from "data.txt" with delimiter "\n"/ d- g3 m, }! ^0 w- D5 g
read A_time from "data.txt" with delimiter "\n"" P: e/ ]1 U0 S% k
read A_leave from "data.txt" with delimiter "\n"
/ ]( M4 ?' k% @% f5 n read A_picks from "data.txt" with delimiter "\n"
' S" r9 C9 Z) |) c9 H set load type to A_tote
3 O I8 D2 {# i* @4 i if A_tote="tote 1" then set A_induct to 13 B7 U. J0 ~. g" S
else if A_tote="tote 2" then set A_induct to 2
c I e& e- V' z else set A_induct to 3
; z1 W- S& S Z/ ~ set A_i to 04 W2 O9 S# X% V. k5 ?
clone 1 load to P_induction
?& z- U8 x/ j wait for A_time sec
0 q$ g& H6 \- |) K end. R9 S" a) R" p* [% V: C
end
3 B/ O. N% I9 Z1 @9 U+ u; M. p2 _2 W! x6 i) a
begin P_induction arriving: V6 t+ B1 n) T& c# W- M1 y+ Z- Q* _
if A_induct=1 then clone 1 load to P_pick1: `) I- u7 W, h
else if A_induct=2 then clone 1 load to P_pick2
6 M. x. S1 C e t- I2 M9 ^ else clone 1 load to P_pick3; `2 f3 r- W+ k
end$ p6 A% ?" J2 u9 |) ~
4 E# t+ Z* u$ m6 Zbegin P_pick1 arriving* [5 Y2 m3 T( i% n
set A_i to 13 S' H' l" u" F1 c% g& _
move into Q_induct1
! t6 v4 a. [% Z6 X move into pickaisle.induct1
7 f8 F3 [" L1 W& J while A_i<=30 do begin( r' v0 Q% a1 O
travel to pickaisle.con(A_i)2 Q" L( I$ Z5 j
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. \' L5 ]; `0 M
else wait for 10 sec
* n5 p; X9 S, t8 T1 q' c if A_i=A_leave then send to die
; |7 o3 \( O. E1 Z& f else inc A_i by 1
% P5 h1 V t( C1 D1 b end& u6 V! @$ O3 n& l/ [2 s5 e6 B$ U" U
end
' i) R! ?- n6 q0 P- U7 u1 x- v$ m. }' m" J. O, ~8 y
begin P_pick2 arriving; p" V0 z. g$ E" a! i3 m' ~: X
set A_i to 11
; V$ U* g8 u/ C move into Q_induct2
" B7 @# ]; u0 } move into pickaisle.induct22 B9 h1 A9 s: f! M# z0 f! I8 s T% N5 k
while A_i<=30 do begin
! e& ~ m- I6 i+ ~6 G- ? travel to pickaisle.con(A_i)( ~3 H+ v; f2 X1 r/ R8 K( i$ t P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* d% H& [, T R4 g9 ?1 b else wait for 10 sec
- c+ ?! W7 r- p( \( E f: ^; w if A_i=A_leave then send to die
% J3 `' R9 K/ W& O4 _ else inc A_i by 1
) j* `4 t% i5 \! q2 \; N4 V. `0 k end; |9 U5 p D: U$ ^' Z1 Z
end
3 k/ z) L w" M' ~' S! n6 s7 y) g' `3 J* d
begin P_pick3 arriving
/ ?7 b% l; z( z1 S7 d set A_i to 21
9 f" s- {8 x _5 { move into Q_induct3
* v, t! F b) b1 S, K/ s$ c: f move into pickaisle.induct31 O9 ?8 a: b) r1 q( |9 v9 S4 }
while A_i<=30 do begin: J5 e0 N4 S* {; h" }7 i
travel to pickaisle.con(A_i)
. H2 E) ?. O9 ~. z5 ]4 ~2 m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; j' l( T+ x, g1 h7 y- b
else wait for 10 sec
2 I1 U+ z8 s/ j C if A_i=A_leave then send to die
) Z; z5 P. B+ k9 n else inc A_i by 1& O4 R5 P, M5 H. E3 Q- Q9 ? L
end
+ _# t' v! H2 v3 }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,其它按你的 ...
|