-
Notifications
You must be signed in to change notification settings - Fork 0
/
hFF.cs
33 lines (30 loc) · 936 Bytes
/
hFF.cs
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
using FlashPlanner.Core.Models;
using FlashPlanner.Core.Models.SAS;
using FlashPlanner.Core.RelaxedPlanningGraphs;
using FlashPlanner.Core.States;
namespace FlashPlanner.Core.Heuristics
{
/// <summary>
/// Main hFF implementation based on relaxed planning graphs
/// </summary>
public class hFF : BaseHeuristic
{
private readonly OperatorRPG _graphGenerator;
/// <summary>
/// Main constructor
/// </summary>
public hFF()
{
_graphGenerator = new OperatorRPG();
}
internal override uint GetValueInner(StateMove parent, SASStateSpace state, List<Operator> operators)
{
var relaxedPlan = _graphGenerator.GenerateReplaxedPlan(
state,
operators);
if (_graphGenerator.Failed)
return uint.MaxValue;
return (uint)relaxedPlan.Count;
}
}
}