Skip to content

Commit 5f16f56

Browse files
committed
Fix typo in VBG reward.
1 parent b07d1df commit 5f16f56

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

docs/Rocket League/training_an_agent.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,11 @@ class VelocityBallToGoalReward(RewardFunction[AgentID, GameState, float]):
7171
rewards = {}
7272
for agent in agents:
7373
car = state.cars[agent]
74+
ball = state.ball
7475
if car.is_orange:
75-
ball = state.ball
76-
goal_y = common_values.BACK_NET_Y
77-
else:
78-
ball = state.inverted_ball
7976
goal_y = -common_values.BACK_NET_Y
77+
else:
78+
goal_y = common_values.BACK_NET_Y
8079

8180
ball_vel = ball.linear_velocity
8281
pos_diff = np.array([0, goal_y, 0]) - ball.position

0 commit comments

Comments
 (0)