Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
m5l14i11 committed Sep 20, 2024
1 parent 961a2ca commit 0c2a82f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions infrastructure/event_dispatcher/load_balancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def determine_priority_group(self, priority: int) -> int:

control_outputs = self._pid.update(errors)

return np.random.choice(
np.arange(len(control_outputs)), p=softmax(control_outputs)
)
penalty_factor = np.exp(-processed_ratios)
weighted_outputs = control_outputs * penalty_factor

smooth_outputs = softmax(weighted_outputs)

return np.random.choice(np.arange(len(smooth_outputs)), p=smooth_outputs)

0 comments on commit 0c2a82f

Please sign in to comment.