add heuristic(no args) to GoalComposite
GoalNear and GoalRunAway are still missing it
This commit is contained in:
parent
45dc8b949d
commit
7255ccbdaa
@ -57,6 +57,16 @@ public class GoalComposite implements Goal {
|
||||
return min;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double heuristic() {
|
||||
double min = Double.MAX_VALUE;
|
||||
for (Goal g: goals) {
|
||||
//just take the highest value that is guaranteed to be inside the goal
|
||||
min = Math.min(min, g.heuristic());
|
||||
}
|
||||
return min;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "GoalComposite" + Arrays.toString(goals);
|
||||
|
Loading…
Reference in New Issue
Block a user