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_BehaviorName;
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 behaviorName)
{
m_BehaviorName = behaviorName;
m_Communicator = Academy.Instance.Communicator;
m_Communicator.SubscribeBrain(m_BehaviorName, brainParameters);
}
///
public void RequestDecision(AgentInfo info, List sensors, Action action)
{
m_Communicator?.PutObservations(m_BehaviorName, info, sensors, action);
}
///
public void DecideAction()
{
m_Communicator?.DecideBatch();
}
public void Dispose()
{
}
}
}