Skip to content

Commit

Permalink
increase being hit penalty
Browse files Browse the repository at this point in the history
  • Loading branch information
jjshoots committed Sep 20, 2024
1 parent 32fdfc1 commit 1d978f9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions PyFlyt/pz_envs/fixedwing_envs/ma_fixedwing_dogfight_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(
lethal_distance: float = 20.0,
lethal_angle_radians: float = 0.07,
assisted_flight: bool = True,
aggressiveness: float = 0.8,
aggressiveness: float = 0.5,
cooperativeness: float = 0.5,
sparse_reward: bool = False,
flatten_observation: bool = True,
Expand Down Expand Up @@ -629,7 +629,7 @@ def _compute_boundary_rewards(self) -> np.ndarray:

# reward for being too close to anyone, minus diagonal to ignore self
boundary_rewards -= np.sum(
5.0
10.0
* (
(self.current_distances < 5.0)
- np.eye(self.current_distances.shape[0])
Expand Down Expand Up @@ -660,13 +660,13 @@ def _compute_term_trunc_rew_info(self) -> None:
# collision, override reward, not add
collisions = self.aviary.contact_array[self.drone_ids].sum(axis=-1) > 0
self.accumulated_terminations |= collisions
self.accumulated_rewards[collisions] = -500.0
self.accumulated_rewards[collisions] = -1000.0
self.healths[collisions] = 0.0

# exceed flight dome, override reward, not add
out_of_bounds = self.distances_from_origin > self.flight_dome_size
self.accumulated_terminations |= out_of_bounds
self.accumulated_rewards[out_of_bounds] = -500.0
self.accumulated_rewards[out_of_bounds] = -1000.0
self.healths[out_of_bounds] = 0.0

# all opponents deactivated, override reward, not add
Expand Down

0 comments on commit 1d978f9

Please sign in to comment.