# Balancing Periodical and Cummulative Rewards
### Terminology
- $\tau$: Hours allocated for person $i$ during milestone phase $t$
- $w$: Average wage for person $i$ during milestone phase $t$
abcddefqwer
### Parameters
$\Pi\in \mathbb{R}$ (Total Pot)
$\alpha \in [0, 1]$ (How much relative earnings should be allocated immediatly)
$\beta = \frac{1}{N_m}$ (How much of the relative applicable earnings should be allocated per milestone)
$\Pi_m = \alpha \beta \Pi$ (Maximum earnings to be allocated per milestone)
### Per Milestone Allocations
$\pi_{i, t} = \alpha \tau_{i, t} w_{i, t}$ (Non-capped immediate earnings per person, milestone)
$\pi_t = \sum_i \pi_{i, t}$ (Non-capped immediate earnings per milestone)
$f_t = \frac{\Pi_m}{\pi_t}$ (if above 1, then immediate earnings won't be capped)
$\tilde{\pi}_{i, t}= \pi_{i, t} * \min{(1, f_t)}$ (Actual earnings per person, milestone)
$\tilde{\pi}_t = \sum_i \tilde{\pi}_{i, t}$ (Actual earnings per milestone)
### Allocation Rebalancing
$\pi=\sum_i \pi_i$ (Non-capped immediate earnings overall)
$\tilde{\pi} = \sum_t \tilde{\pi}_t$ (Sum of all actual earnings during the milestones)
$\bar{\Pi} = \Pi - \tilde{\pi}$ (what's left to allocate)
$\pi_i = \sum_t \pi_{i, t}$ (Non-capped immediate earnings per person)
$\bar \pi_i + \tilde \pi_i = \min(\pi_i, \pi_i \frac{\Pi}{\pi})$
$\bar \pi_i = \pi_i * \min(1, \frac{\Pi}{\pi}) - \tilde \pi_i$ (Rebalancing earnings per person)
### Remainder Distribution
$\tilde \Pi = \Pi - \tilde \pi - \bar \pi$ (Pot that was not distributed through immediate rewards & rebalancing)
$\hat \pi_i = \frac{\pi_i}{\pi} \tilde \Pi$ (Remainder distribution per person)
## a