2018-12-12 13:57:48 -08:00
|
|
|
from ray.rllib.utils.annotations import override
|
2019-01-23 21:27:26 -08:00
|
|
|
from ray.rllib.utils.annotations import PublicAPI
|
2018-12-12 13:57:48 -08:00
|
|
|
|
|
|
|
|
2019-01-23 21:27:26 -08:00
|
|
|
@PublicAPI
|
2020-01-02 17:42:13 -08:00
|
|
|
class OutputWriter:
|
2018-12-12 13:57:48 -08:00
|
|
|
"""Writer object for saving experiences from policy evaluation."""
|
|
|
|
|
2019-01-23 21:27:26 -08:00
|
|
|
@PublicAPI
|
2018-12-12 13:57:48 -08:00
|
|
|
def write(self, sample_batch):
|
|
|
|
"""Save a batch of experiences.
|
|
|
|
|
|
|
|
Arguments:
|
|
|
|
sample_batch: SampleBatch or MultiAgentBatch to save.
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
|
|
|
|
|
|
|
|
|
|
|
class NoopOutput(OutputWriter):
|
|
|
|
"""Output writer that discards its outputs."""
|
|
|
|
|
|
|
|
@override(OutputWriter)
|
|
|
|
def write(self, sample_batch):
|
|
|
|
pass
|