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

50 行
1.3 KiB

//Every scene needs an academy script.
//Create an empty gameObject and attach this script.
//The brain needs to be a child of the Academy gameObject.
using UnityEngine;
using MLAgents;
public class PushBlockAcademy : Academy
{
/// <summary>
/// The "walking speed" of the agents in the scene.
/// </summary>
public float agentRunSpeed;
/// <summary>
/// The agent rotation speed.
/// Every agent will use this setting.
/// </summary>
public float agentRotationSpeed;
/// <summary>
/// The spawn area margin multiplier.
/// ex: .9 means 90% of spawn area will be used.
/// .1 margin will be left (so players don't spawn off of the edge).
/// The higher this value, the longer training time required.
/// </summary>
public float spawnAreaMarginMultiplier;
/// <summary>
/// When a goal is scored the ground will switch to this
/// material for a few seconds.
/// </summary>
public Material goalScoredMaterial;
/// <summary>
/// When an agent fails, the ground will turn this material for a few seconds.
/// </summary>
public Material failMaterial;
/// <summary>
/// The gravity multiplier.
/// Use ~3 to make things less floaty
/// </summary>
public float gravityMultiplier;
void State()
{
Physics.gravity *= gravityMultiplier;
}
}