|
|
请教关于PortalCrane的问题,实在想不明白。发现placeIsFree调用的一个问题:当通过PortalCrane的Strategy下的自定义可利用位置(Define your own method for searching an available location)时,自定义程序为:. h u8 y1 n1 x) {( z- J' A1 m
(byref x1,y1,z1 : integer; part : object) : boolean
1 E1 r. I' t- }7 C1 Bis. P4 Y& L8 D3 |. W
i,j,k,w : integer;4 K2 t$ U; ~) A- b5 B
do% _- B7 `. n7 i% \2 N/ ~
for k := 1 to Crane.getStoreZDim loop
/ u8 S8 n' D. J* t for i := Crane.getStoreXDim downto 1 loop( u9 c- L# B3 @# W4 a: g- _# Z% y! z' {7 e
for j := 1 to Crane.getStoreYDim loop
4 x% R5 C( e2 d if Crane.placeIsFree(i,j,k) then6 o! o4 F' K( V# y$ ~
x1 := i;& d7 |* V! N% C
y1 := j;! b7 O; H, U: Q8 Q
z1 := k;
n; W2 ^/ {/ x0 X3 j# p$ J if Crane.placeIsFree(14,1,2) then
" [! W$ R( e2 ]% z w:=1
2 C2 Q a$ ?1 Y& i. E end;' G W- X7 R3 E
return true;
9 ~. c! K! e# L' S( Y8 l7 k2 G end;2 N) \% w1 o8 n7 h5 b) a- q
next;; C' s- P) { L4 \; z6 |! r4 V
next;
6 r/ _4 l, u& O) }- J% n& ~ next;
8 h g' l( q6 M6 D0 e return false;' O0 y$ c* L$ e" ^% C8 U# H
end;
- ~; i; C" j$ ^, A 判断的位置(14,1,2)的Free是True;而在某个程序中直接调用placeIsFree时, 判断的(14,1,2)的Free是False。保证两次判断位置(14,1,2)一直没有被占用。想知道是什么原因?placeIsFre方法到底该如何用?请求赐教?
; S' P& l$ y# T2 T |
|