From 123a17c9d50745ea609f91943adca64e5ed12355 Mon Sep 17 00:00:00 2001
From: zhangc <zc@123>
Date: 星期六, 12 四月 2025 09:08:14 +0800
Subject: [PATCH] 1
---
src/main/java/com/zy/common/model/NavigateNode.java | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/zy/common/model/NavigateNode.java b/src/main/java/com/zy/common/model/NavigateNode.java
index 5f769e2..744fec3 100644
--- a/src/main/java/com/zy/common/model/NavigateNode.java
+++ b/src/main/java/com/zy/common/model/NavigateNode.java
@@ -2,14 +2,17 @@
import lombok.Data;
+import java.io.Serializable;
+
/**
* A*瀵昏矾绠楁硶Node鑺傜偣
*/
@Data
-public class NavigateNode implements Comparable<NavigateNode>{
+public class NavigateNode implements Comparable<NavigateNode>, Cloneable, Serializable {
private int x;//鍧愭爣x
private int y;//鍧愭爣y
+ private int z;//鍧愭爣z(楂樺害)
private int F;//缁煎悎鑺辫垂鐨勬鏁�
private int G;//宸茬粡鑺辫垂鐨勬鏁�
private int H;//灏嗚鑺辫垂鐨勬鏁�
@@ -17,6 +20,7 @@
private Boolean isInflectionPoint;//鏄惁涓烘嫄鐐�
private String direction;//琛岃蛋鏂瑰悜
private Integer moveDistance;//琛岃蛋璺濈
+ private Integer nodeValue;//鑺傜偣鏁版嵁
public NavigateNode(int x, int y) {
this.x = x;
@@ -29,7 +33,7 @@
this.Father = father;
if (this.Father != null) {
//璧拌繃鐨勬鏁扮瓑浜庣埗鑺傜偣璧拌繃鐨勬鏁板姞涓�
- this.G = father.G + 1;
+ this.G = father.G + this.G;
} else { //鐖惰妭鐐逛负绌轰唬琛ㄥ畠鏄涓�涓粨鐐�
this.G = 0;
}
@@ -45,4 +49,14 @@
return Integer.compare(this.F, o.F);
}
+ @Override
+ public NavigateNode clone() {
+ try {
+ return (NavigateNode) super.clone();
+ } catch (CloneNotSupportedException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
}
--
Gitblit v1.9.1