Source code for src.gridmind.feature_construction.state_aggregation

import math


[docs]class SimpleStateAggregator: def __init__(self, span: int):
[docs] self.span = span
[docs] def __call__(self, state: int, *args, **kwds): return math.floor(state / self.span)
if __name__ == "__main__":
[docs] agg = SimpleStateAggregator(span=100)
print(agg(900))