#
luxiaotao1123
2024-11-16 bb3b18aa4627e24e3428f89c90b867bad5eb40f6
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/astart/NavigateNode.java
@@ -26,6 +26,7 @@
    private String direction;   //行走方向
    private Integer lastDistance;   // 距离上个节点距离
    private Integer moveDistance;   // 总行走距离
    private Integer weight;        // G 权重
    private String codeData;
@@ -46,7 +47,9 @@
        this.parent = father;
        if (this.parent != null) {
            //走过的步数等于父节点走过的步数加一
            this.G = father.G + Optional.ofNullable(this.lastDistance).orElse(0);
            this.G = father.G
                    + Optional.ofNullable(this.lastDistance).orElse(0)
                    + Optional.ofNullable(this.weight).orElse(0);
        } else { //父节点为空代表它是第一个结点
            this.G = 0;
        }