docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method SetModel

    SetModel(string, ModelAsset, InferenceDevice)

    Updates the Model assigned to this Agent instance.

    Declaration
    public void SetModel(string behaviorName, ModelAsset model, InferenceDevice inferenceDevice = InferenceDevice.Default)
    Parameters
    Type Name Description
    string behaviorName

    The identifier of the behavior. This will categorize the agent when training.

    ModelAsset model

    The model to use for inference.

    InferenceDevice inferenceDevice

    Define the device on which the model will be run.

    Remarks

    If the agent already has an assigned model, that model is replaced with the the provided one. However, if you call this function with arguments that are identical to the current parameters of the agent, then no changes are made.

    Note: the behaviorName parameter is ignored when not training. The model and inferenceDevice parameters are ignored when not using inference.

    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