ray/rllib/utils/schedules/constant_schedule.py
Eric Liang be48e1964b
[rllib] Fix per-worker exploration in Ape-X; make more kwargs required for future safety (#7504)
* fix sched

* lintc

* lint

* fix

* add unit test

* fix

* format

* fix test

* fix test
2020-03-10 11:14:14 -07:00

18 lines
447 B
Python

from ray.rllib.utils.schedules.schedule import Schedule
class ConstantSchedule(Schedule):
"""
A Schedule where the value remains constant over time.
"""
def __init__(self, value, framework):
"""
Args:
value (float): The constant value to return, independently of time.
"""
super().__init__(framework=framework)
self._v = value
def _value(self, t):
return self._v