|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 K- \& I6 M2 m" Z8 D' J4 F" _: 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中的数值,不知道会不会有什么不妥。
- f( f0 P' E3 W8 V" h
& o# M( s- j3 F1 I2 f8 M* ]begin P_read arriving
3 u7 u1 D5 O1 c& K. b while 1=1 do begin. a" s9 d2 z6 T3 ?, V* k
read A_tote from "data.txt" with delimiter "\n"
O. J4 b+ E6 j0 S1 h( ]+ n& n/ w read A_time from "data.txt" with delimiter "\n"
2 x9 F! P* }7 G) O$ l0 G read A_leave from "data.txt" with delimiter "\n"9 X" G% w7 ~# f' ?" H/ m i
read A_picks from "data.txt" with delimiter "\n"
! Y/ Q* f ?9 E& k0 p set load type to A_tote* J3 _' S/ W, A, L' k- h
if A_tote="tote 1" then set A_induct to 1
9 k9 K- m) c# S' S3 ` else if A_tote="tote 2" then set A_induct to 20 n: ?# i$ d4 w9 ^0 q) z1 j" `
else set A_induct to 3 " a& w. D; D4 _1 ~
set A_i to 0
! K. w. Q0 e- h2 I' @ clone 1 load to P_induction$ ?, h |$ H5 @+ c
wait for A_time sec9 I* w! V+ I( c1 k
end! }5 N" A9 G8 E+ w% S) ?3 Z; y$ ?
end! f1 |1 {/ c( j
+ o, k! | K+ P3 }2 I* P
begin P_induction arriving
. k2 |4 }3 k3 R3 _4 k9 e% m: E if A_induct=1 then clone 1 load to P_pick1
8 Y H9 b0 L* `) l' c( A else if A_induct=2 then clone 1 load to P_pick2
% X, c' @9 D5 F" { else clone 1 load to P_pick3
, m# S8 ]* g7 x! C9 l8 Send4 Y9 |3 W. K) @( ]
: m4 H4 t$ S d; a3 S5 @begin P_pick1 arriving9 w9 t; [4 I, W# \$ y" o U
set A_i to 18 K( s0 B8 M1 i9 B4 L$ g
move into Q_induct1
( q- G+ n) E7 ]* g move into pickaisle.induct1$ V! M3 z0 j( N. D( S' J
while A_i<=30 do begin+ H- W5 P# G2 m& `* X- `$ { v
travel to pickaisle.con(A_i)
/ Y4 y5 \7 f) P6 _2 d3 B8 x if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 m2 M9 A/ W! l! t8 i
else wait for 10 sec
% P- Y3 r2 ?$ R& H$ M if A_i=A_leave then send to die
2 H5 b' w( I8 a4 Q' K1 S else inc A_i by 1
3 _. I+ ]* l( v0 ? end
1 j7 k2 }4 k8 W; Send) z2 j+ o, h$ L& M8 c9 ]
2 I, z8 O7 W0 {' B
begin P_pick2 arriving
' [, R$ o; B( K5 b+ [: r9 x/ q; u set A_i to 11& G: p& C( U/ y) j3 \7 g, X/ i
move into Q_induct27 Z& r& p! R, M, f( w% `7 G
move into pickaisle.induct2. T `" P$ A" y8 n
while A_i<=30 do begin
) [) ]4 x5 h" K3 L8 e) ~" S" H# v travel to pickaisle.con(A_i)( ]) u" V7 J* n) }6 Q) N
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& B0 q& q# u$ d; W% p+ ]
else wait for 10 sec
- A4 ?, w C+ K/ R if A_i=A_leave then send to die
3 o8 g' Z+ w1 R else inc A_i by 1
5 S! k! H% A* v0 V4 } end
# @6 T* G$ G( {8 {$ Fend" n( q% P0 A/ C6 G1 v2 n
: a- L5 H! g/ A. Z5 w/ d: ?/ J, w# ^5 u
begin P_pick3 arriving
. N* F9 }+ E) t0 F. ^5 s, [+ D/ L set A_i to 219 C5 S" A0 p* u! s" l% a. _
move into Q_induct3$ G2 l, H( h2 p2 Z0 a
move into pickaisle.induct3
# H' z9 N# n8 k3 M9 z5 i* J7 Y while A_i<=30 do begin. t8 v. A" [9 b9 f3 V
travel to pickaisle.con(A_i)
0 x1 ~! p( O: P' Y8 v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" b( N/ a0 F0 }/ `7 l2 b
else wait for 10 sec
; U" h u7 D: `) E9 _+ b1 E if A_i=A_leave then send to die
* n! W+ x( ]1 n: h* N else inc A_i by 1+ y7 Z6 B5 x: S' P8 y
end- w; p3 T5 s y' k1 S
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,其它按你的 ...
|