Unity 机器学习代理工具包 (ML-Agents) 是一个开源项目,它使游戏和模拟能够作为训练智能代理的环境。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

50 行
2.1 KiB

using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Interface for implementing the behavior of an Agent that uses a Heuristic
/// Brain. The behavior of an Agent in this case is fully decided using the
/// implementation of these methods and no training or inference takes place.
/// Currently, the Heuristic Brain does not support text observations and actions.
/// </summary>
public interface Decision
{
/// <summary>
/// Defines the decision-making logic of the agent. Given the information
/// about the agent, returns a vector of actions.
/// </summary>
/// <returns>Vector action vector.</returns>
/// <param name="vectorObs">The vector observations of the agent.</param>
/// <param name="visualObs">The cameras the agent uses for visual observations.</param>
/// <param name="reward">The reward the agent received at the previous step.</param>
/// <param name="done">Whether or not the agent is done.</param>
/// <param name="memory">
/// The memories stored from the previous step with
/// <see cref="MakeMemory(List{float}, List{Texture2D}, float, bool, List{float})"/>
/// </param>
float[] Decide(
List<float>
vectorObs,
List<Texture2D> visualObs,
float reward,
bool done,
List<float> memory);
/// <summary>
/// Defines the logic for creating the memory vector for the Agent.
/// </summary>
/// <returns>The vector of memories the agent will use at the next step.</returns>
/// <param name="vectorObs">The vector observations of the agent.</param>
/// <param name="visualObs">The cameras the agent uses for visual observations.</param>
/// <param name="reward">The reward the agent received at the previous step.</param>
/// <param name="done">Whether or not the agent is done.</param>
/// <param name="memory">
/// The memories stored from the previous call to this method.
/// </param>
List<float> MakeMemory(
List<float> vectorObs,
List<Texture2D> visualObs,
float reward,
bool done,
List<float> memory);
}