docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Class Academy

    The Academy singleton manages agent training and decision making.

    Inheritance
    object
    Academy
    Implements
    IDisposable
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.MLAgents
    Assembly: solution.dll
    Syntax
    [HelpURL("https://github.com/Unity-Technologies/ml-agents/tree/release_21_docs/docs/Learning-Environment-Design.md")]
    public class Academy : IDisposable
    Remarks

    Access the Academy singleton through the Instance property. The Academy instance is initialized the first time it is accessed (which will typically be by the first Agent initialized in a scene).

    At initialization, the Academy attempts to connect to the Python training process through the external communicator. If successful, the training process can train Agent instances. When you set an agent's BehaviorType setting to Default, the agent exchanges data with the training process to make decisions. If no training process is available, agents with the default behavior fall back to inference or heuristic decisions. (You can also set agents to always use inference or heuristics.)

    Constructors

    Name Description
    Academy()

    Private constructor called the first time the Academy is used. Academy uses this time to initialize internal data structures, initialize the environment and check for the existence of a communicator.

    Properties

    Name Description
    AutomaticSteppingEnabled

    Determines whether or not the Academy is automatically stepped during the FixedUpdate phase.

    EnvironmentParameters

    Returns the EnvironmentParameters instance. If training features such as Curriculum Learning or Environment Parameter Randomization are used, then the values of the parameters generated from the training process can be retrieved here.

    EpisodeCount

    The current episode count.

    InferenceSeed

    Set the random seed used for inference. This should be set before any Agents are added to the scene. The seed is passed to the ModelRunner constructor, and incremented each time a new ModelRunner is created.

    Instance

    The singleton Academy object.

    IsCommunicatorOn

    Reports whether or not the communicator is on.

    IsInitialized

    Reports whether the Academy has been initialized yet.

    NumAreas

    Number of training areas to instantiate.

    StatsRecorder

    Returns the StatsRecorder instance. This instance can be used to record any statistics from the Unity environment.

    StepCount

    The current step count (within the current episode).

    TotalStepCount

    Returns the total step count.

    Methods

    Name Description
    Dispose()

    Shut down the Academy.

    EnvironmentStep()

    Performs a single environment update of the Academy and Agent objects within the environment.

    Events

    Name Description
    AgentPreStep

    Signals to all of the Agents that their step is about to begin. This is a good time for an Agent to decide if it would like to call RequestDecision() or RequestAction() for this step. Any other pre-step setup could be done during this event as well.

    OnEnvironmentReset

    Signals that the Academy has been reset by the training process.

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023