|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% e- Y' Z, v* c7 m
1 W* Z3 Q7 F B; w$ Y& ^
我的问题是,在每个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 |6 H6 e' F0 w$ |
" Y3 V0 j, J+ a3 p% X% l6 Fbegin P_read arriving
S$ |. ], {- K3 E' l while 1=1 do begin4 t j( h3 t' j5 G* @5 x% C! c
read A_tote from "data.txt" with delimiter "\n". D/ @ j% ~. W9 o
read A_time from "data.txt" with delimiter "\n"
# \; B; C3 d. g read A_leave from "data.txt" with delimiter "\n"& z+ D& p. C' }* q$ K* s
read A_picks from "data.txt" with delimiter "\n"9 }2 M% G, h2 [1 x$ p3 A
set load type to A_tote
0 Y- W' I$ e. f o if A_tote="tote 1" then set A_induct to 1& e& z1 h. f, h; @
else if A_tote="tote 2" then set A_induct to 2
, I3 {4 {& P0 Y+ B: A$ ` else set A_induct to 3
0 {- q5 l0 u1 N- O( E set A_i to 0
# k* q9 S6 ~3 P) a! \3 }: R1 V7 t clone 1 load to P_induction
7 M8 M3 n: ?) T) F3 |) X, d wait for A_time sec. U: R4 R+ n9 z$ {; I5 r/ _/ H
end
6 V4 S- `: v% Iend
* R& }% j) d) a% D, F2 Q1 H
|% L; B1 K) D" fbegin P_induction arriving
! X& b: R1 B) L0 _ if A_induct=1 then clone 1 load to P_pick1) S- E, M, t7 F2 Q, {
else if A_induct=2 then clone 1 load to P_pick2+ e8 P# M: B+ G8 F5 v( ] }" o
else clone 1 load to P_pick3
. f l: H+ z5 ^6 q; l% t* qend6 }' V( z, ^3 N
6 T+ W* [ H5 D# Q7 e) o0 B
begin P_pick1 arriving
6 U/ N, B4 U/ ?0 j) \: P set A_i to 1
3 l: s. k( a4 U$ W/ A, z move into Q_induct1* s+ _7 `4 |7 e; D1 w
move into pickaisle.induct1' i/ b( A+ e: N. {- `
while A_i<=30 do begin4 ^( w) F* I- U8 c+ ?
travel to pickaisle.con(A_i)6 z5 G! ]8 B5 d. b* r, Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ B, s5 R# ~ i4 B3 m; ^! q. E
else wait for 10 sec$ l/ K9 z7 o' `( k
if A_i=A_leave then send to die! \# i8 U5 D2 i& D
else inc A_i by 1
+ z4 R: p, g; O0 m' U end
( C8 T" ^7 s+ V/ k* Q oend: X* y7 G f+ Z
* H; q4 {2 n7 s- j! p! wbegin P_pick2 arriving
( M6 I, Y! y- q3 N* ?4 A, v+ X set A_i to 11
7 i5 T, ?% c" E L3 b! h move into Q_induct2
3 e+ \# G$ y1 J! r+ Q) r move into pickaisle.induct2
- h; @- J$ J0 N! O7 ] while A_i<=30 do begin: ~; u1 J( p: F# x4 B9 b
travel to pickaisle.con(A_i)/ ?+ Y# @: ^" o1 j$ U I- s
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 c7 F& U' ~! h0 a: N: Q" I else wait for 10 sec
- _ K7 Y g" p, O* b O, ~ v if A_i=A_leave then send to die2 F) x+ B5 I$ e3 y
else inc A_i by 1
- c4 A5 ^5 V2 \# U* g" j$ i+ \! F, e: W end, x3 i% U3 G4 g+ G9 J6 n; p
end
5 K# [" a9 i" k1 F% ^; H4 Q8 p6 `( O8 G
begin P_pick3 arriving
( E, g# `' |% h set A_i to 216 |/ ^& w% i6 {: _ O# Q
move into Q_induct3
& E$ \1 Z$ H# w move into pickaisle.induct3" h7 J ^2 m9 t3 h. i& W
while A_i<=30 do begin8 t c/ ?2 t6 r- V
travel to pickaisle.con(A_i)5 t5 N! ]* n# w) L0 y: Y& o+ c$ E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, U% t3 s, n- _% U; w7 H! h else wait for 10 sec
: Q9 P9 @ S4 Z( B! @7 } X1 s if A_i=A_leave then send to die3 C1 Y+ i) |: l+ I
else inc A_i by 16 Q/ r! G1 O- N: L# g
end
# a- K) S1 v. wend |
最佳答案
查看完整内容
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,其它按你的 ...
|