Expand description
Common shapes of time-dependent rewards, for Route::reward.
Each takes the full reward, the finish time and the shape’s parameters, and returns what
the task is worth at that finish time. deadline and linear_decay return None
when it is too late; wrap halving in Some. None of them grows with later finish
times.
Functions§
- deadline
- The full
rewardup to and includingdeadline, andNoneafter it. - halving
- The full
rewardat time zero, halving everyhalf_life, with linear steps in between, and neverNone. Rounds down. Ahalf_lifeof zero gives the full reward at time zero and zero after. - linear_
decay - The full
rewardup tofrom, falling linearly to zero atuntil, andNoneafteruntil. Rounds down. Whenuntilis not afterfrom, this is adeadlineatfrom.