From 65f19a9876f525fdfa7d1f52adcbe841dbfde57c Mon Sep 17 00:00:00 2001 From: Bafo Date: Thu, 18 May 2023 13:24:25 +0200 Subject: [PATCH] Debut Astar --- .../algorithm/shortestpath/LabelStar.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/LabelStar.java diff --git a/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/LabelStar.java b/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/LabelStar.java new file mode 100644 index 0000000..7372791 --- /dev/null +++ b/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/LabelStar.java @@ -0,0 +1,26 @@ +package org.insa.graphs.algorithm.shortestpath; + + +import org.insa.graphs.model.Arc; +import org.insa.graphs.model.Node; + + +public class LabelStar extends Label { + private double cost_Destination; + private double cost_Origin; + + public LabelStar(Node sommet, double cost_Origin,double cost_Destination, Arc parent) + { + super(sommet, cost_Origin, parent); + this.cost_Origin = cost_Origin; + this.cost_Destination=cost_Destination; + + } + + + @Override + public double getTotalCost() { + return cost_Destination+cost_Origin; + } + +}