using UnityEngine; 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; Agent m_Agent; /// public HeuristicPolicy(Func heuristic) { m_Heuristic = heuristic; } /// public void RequestDecision(Agent agent) { m_Agent = agent; } /// public void DecideAction() { if (m_Agent != null) { m_Agent.UpdateVectorAction(m_Heuristic.Invoke()); } } public void Dispose() { } } }