docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method SetGroupReward

    SetGroupReward(float)

    Set the group rewards for all agents in this MultiAgentGroup.

    Declaration
    public void SetGroupReward(float reward)
    Parameters
    Type Name Description
    float reward

    The new value of the group reward.

    Remarks

    This function replaces any group rewards given during the current step for all agents in the group. Use AddGroupReward(float) to incrementally change the group reward rather than overriding it.

    A positive group reward indicates the whole group's accomplishments or desired behaviors. Every agent in the group will receive the same group reward no matter whether the agent's act directly leads to the reward. Group rewards are meant to reinforce agents to act in the group's best interest instead of indivisual ones. Group rewards are treated differently than individual agent rewards during training, so calling SetGroupReward() is not equivalent to calling agent.SetReward() on each agent in the group.

    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