zhang
2025-05-20 1313906bb1eb983d3beece810035e7fc28d6a92f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package com.zy.acs.manager.core.service.astart;
 
import lombok.Data;
 
import java.io.Serializable;
import java.util.Objects;
 
/**
 * Node节点
 */
@Data
public class NavigateNode implements Comparable<NavigateNode>, Cloneable, Serializable {
 
    private static final long serialVersionUID = 1L;
 
    private int x;  //坐标x
    private int y;  //坐标y
    private int z;  //坐标z(高度)
 
    private int F;  //综合花费的步数
 
    private NavigateNode parent;    //父节点
    private Integer weight;        // G 权重
 
    private String codeData;
 
    public NavigateNode(int x, int y) {
        this.x = x;
        this.y = y;
    }
 
    public NavigateNode(int x, int y, String codeData) {
        this.x = x;
        this.y = y;
        this.codeData = codeData;
    }
 
    @Override
    public int compareTo(NavigateNode o) {
        return Integer.compare(this.F, o.F);
    }
 
    @Override
    public NavigateNode clone() {
        try {
            return (NavigateNode) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return null;
    }
 
    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (!(obj instanceof NavigateNode)) return false;
        NavigateNode that = (NavigateNode) obj;
        return this.x == that.x && this.y == that.y;
    }
 
    @Override
    public int hashCode() {
        return Objects.hash(x, y);
    }
 
}