using MLAgents.Sensor;
using System.Collections.Generic;
using System;
namespace MLAgents
{
///
/// The Heuristic Policy uses a hards coded Heuristic method
/// to take decisions each time the RequestDecision method is
/// called.
///
public class HeuristicPolicy : IPolicy
{
Func m_Heuristic;
float[] m_LastDecision;
///
public HeuristicPolicy(Func heuristic)
{
m_Heuristic = heuristic;
}
///
public void RequestDecision(AgentInfo info, List sensors)
{
m_LastDecision = m_Heuristic.Invoke();
}
///
public float[] DecideAction()
{
return m_LastDecision;
}
public void Dispose()
{
}
}
}