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.