using UnityEngine;
using System.Collections.Generic;
using MLAgents.Sensor;
using System;
namespace MLAgents
{
///
/// The Remote Policy only works when training.
/// When training your Agents, the RemotePolicy will be controlled by Python.
///
public class RemotePolicy : IPolicy
{
string m_FullyQualifiedBehaviorName;
protected ICommunicator m_Communicator;
///
/// Sensor shapes for the associated Agents. All Agents must have the same shapes for their Sensors.
///
List m_SensorShapes;
///
public RemotePolicy(
BrainParameters brainParameters,
string fullyQualifiedBehaviorName)
{
m_FullyQualifiedBehaviorName = fullyQualifiedBehaviorName;
m_Communicator = Academy.Instance.Communicator;
m_Communicator.SubscribeBrain(m_FullyQualifiedBehaviorName, brainParameters);
}
///
public void RequestDecision(AgentInfo info, List sensors, Action action)
{
m_Communicator?.PutObservations(m_FullyQualifiedBehaviorName, info, sensors, action);
}
///
public void DecideAction()
{
m_Communicator?.DecideBatch();
}
public void Dispose()
{
}
}
}