rocket_league.reward_functions.goal_reward
Classes
A RewardFunction that gives a reward of 1 if the agent's team scored a goal, -1 if the opposing team scored a goal, |
Module Contents
- class rocket_league.reward_functions.goal_reward.GoalReward
Bases:
rlgym.api.RewardFunction
[rlgym.api.AgentID
,rlgym.rocket_league.api.GameState
,float
]A RewardFunction that gives a reward of 1 if the agent’s team scored a goal, -1 if the opposing team scored a goal,
- reset(agents: List[rlgym.api.AgentID], initial_state: rlgym.rocket_league.api.GameState, shared_info: Dict[str, Any]) None
Function to be called each time the environment is reset. This is meant to enable users to design stateful reward functions that maintain information about the game throughout an episode to determine a reward.
- Parameters:
agents – List of AgentIDs for which this RewardFunc will return a Reward
initial_state – The initial state of the reset environment.
shared_info – A dictionary with shared information across all config objects.
- get_rewards(agents: List[rlgym.api.AgentID], state: rlgym.rocket_league.api.GameState, is_terminated: Dict[rlgym.api.AgentID, bool], is_truncated: Dict[rlgym.api.AgentID, bool], shared_info: Dict[str, Any]) Dict[rlgym.api.AgentID, float]
Function to compute the reward for a player. This function is given a player argument, and it is expected that the reward returned by this function will be for that player.
- Parameters:
agents – List of AgentIDs for which this RewardFunc should return a Reward
state – The current state of the game.
is_terminated – TODO.
is_truncated – TODO.
shared_info – A dictionary with shared information across all config objects.
- Returns:
A dict of rewards, one for each AgentID in agents.
- _get_reward(agent: rlgym.api.AgentID, state: rlgym.rocket_league.api.GameState) float