|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! S+ N0 V+ k6 k* X* A# |) {9 K7 D
! V$ |$ F$ u; J
我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 H% x3 W6 I% ]8 V; |
1 c) Y9 d) R7 P
begin P_read arriving; I! D+ W4 v* s5 j: `$ Q" r
while 1=1 do begin! F! \0 C4 F( b
read A_tote from "data.txt" with delimiter "\n"
/ a; u8 s \, ?! o read A_time from "data.txt" with delimiter "\n"
. N/ `$ {0 n! x0 a: \2 O! u1 e4 [( H6 u read A_leave from "data.txt" with delimiter "\n"
! I c1 r N$ `' C read A_picks from "data.txt" with delimiter "\n"
/ R' Z- o8 J" ]) W set load type to A_tote o7 b+ `$ W1 N" ?5 q& m
if A_tote="tote 1" then set A_induct to 1+ R1 l: ?: L2 w
else if A_tote="tote 2" then set A_induct to 20 Q- l7 @7 d; m6 j R9 G+ R3 ?
else set A_induct to 3
8 r. U, U! }) O6 b' B3 I set A_i to 09 d2 N% y+ w) f8 b
clone 1 load to P_induction# ]4 {. V# w" H3 \# Y e9 V1 ~# _% M
wait for A_time sec
# o$ m) _, ~# \& I! v end) g/ L; w6 `. J* z* r2 u
end
' M% s; T( s. f; S: A5 q4 S7 H u6 A' ^$ g! H( W8 |+ U* R9 Y
begin P_induction arriving
5 S d) v6 H9 @. s" m& ? if A_induct=1 then clone 1 load to P_pick1
* t! U- [' B; K8 l else if A_induct=2 then clone 1 load to P_pick2" b) ~* F- c$ k5 ~
else clone 1 load to P_pick3
6 B( I g K, q6 H" uend
( P, c0 i7 m& _8 C2 C
, _2 e1 u5 a8 q& i7 C* F+ i+ h$ Fbegin P_pick1 arriving$ _+ x* i- F0 }& Q3 s
set A_i to 1
$ ^7 W( Z. I% N' k; A move into Q_induct1( b3 X" X2 e/ V- p6 q h
move into pickaisle.induct1) Q7 I. j4 w6 f2 k5 W4 C9 v+ I
while A_i<=30 do begin
& C% Y0 g5 M: H: J( j. x; L travel to pickaisle.con(A_i)
& N$ {: a8 Z: }3 p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' R3 }0 c8 H* A; g else wait for 10 sec
, n: d9 l/ h2 t! h j5 W' A if A_i=A_leave then send to die9 [$ ]/ x4 u _
else inc A_i by 1
' j+ M. \: B9 v" K/ P# T end6 B: B% {( j" |. x! r
end
& }: i# A+ [; \% e6 g' O
4 n" E( M* z. M* z# @begin P_pick2 arriving0 ]4 j) J% e1 W1 g/ O% I
set A_i to 11& v! _( r/ d# Q+ S- R/ n. U7 t
move into Q_induct24 e7 x' O; h& \, y/ f
move into pickaisle.induct2" d1 x7 R9 Z+ }7 r: u3 a8 O: p
while A_i<=30 do begin5 e" L9 i1 E7 t" q3 D1 q
travel to pickaisle.con(A_i)# P8 K m& i- O. Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ m& F9 I4 Z, w0 R x4 v
else wait for 10 sec9 o2 W4 @& m+ a9 ~) D
if A_i=A_leave then send to die1 x3 r8 ?! ^# ~9 R
else inc A_i by 1
' U+ }# r+ z" G1 T end1 I! D7 p4 \; [5 P; c1 X5 [- G
end
4 C1 G$ f. l: G/ K! c8 _% z$ j x/ I3 k4 U
begin P_pick3 arriving
2 W% B- l5 i. [/ g! r set A_i to 21
0 d- W; ]. h9 L( M8 ?; a move into Q_induct3 A3 Z- L ~( U0 F2 S
move into pickaisle.induct3
- e% T2 A4 R/ k4 _, g7 {4 o+ n while A_i<=30 do begin
8 t& P/ o( h, ]. g5 E( m travel to pickaisle.con(A_i)6 _) k' R6 }8 w* i; K
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ @ v# ~% R* w2 v3 K else wait for 10 sec* n0 W9 Z `" p
if A_i=A_leave then send to die, x3 ~, r T# Q& ]: Y; a
else inc A_i by 1% U( T! h5 N! W+ g
end* L9 N# Q% P% O
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,其它按你的 ...
|