matchbin_regulators.hpp
Regulator structs that can be plugged into MatchBin.
-
template<typename set_t_, typename adj_t_, typename view_t_>
struct RegulatorBase - #include <matchbin_regulators.hpp>
Abstract base class for regulators.
-
struct NopRegulator : public RegulatorBase<double, double, double>
- #include <matchbin_regulators.hpp>
This regulator does nothing! Useful for control experiments.
Public Functions
-
inline virtual double operator()(const double raw_score) const override
Apply regulation to a raw match score.
-
inline virtual bool Set(const double &set) override
No-op set. Return whether MatchBin should be updated (never).
-
inline virtual bool Adj(const double &amt) override
No-op adjustment. Return whether MatchBin should be updated (never).
-
inline virtual bool Decay(const int steps) override
No-op decay. Return whether MatchBin should be updated (never).
-
inline virtual const double &View() const override
Return a default value.
-
inline bool operator!=(const NopRegulator &other) const
Public Static Attributes
-
static constexpr double state = 0.0
-
inline virtual double operator()(const double raw_score) const override
-
struct LegacyRegulator : public RegulatorBase<double, double, double>
- #include <matchbin_regulators.hpp>
Don’t use this regulator. It’s here so tests don’t break.
Public Functions
-
inline LegacyRegulator()
-
inline virtual double operator()(const double raw_score) const override
Apply regulation to a raw match score.
-
inline virtual bool Set(const double &set) override
A value between zero and one upregulates the item, a value of exactly one is neutral, and a value greater than one downregulates the item.
-
inline virtual bool Adj(const double &amt) override
A negative value upregulates the item, a value of exactly zero is neutral and a postive value the item.
-
inline virtual bool Decay(const int steps) override
No-op decay. Return whether MatchBin should be updated (never).
-
inline virtual const double &View() const override
Return a double representing the state of the regulator.
-
inline bool operator!=(const LegacyRegulator &other) const
Public Members
-
double state
-
inline LegacyRegulator()
-
template<typename Slope = std::ratio<1, 10>>
struct AdditiveCountdownRegulator : public RegulatorBase<double, double, double> - #include <matchbin_regulators.hpp>
Public Functions
-
inline AdditiveCountdownRegulator()
-
inline virtual double operator()(const double raw_score) const override
Apply regulation to a raw match score. Returns a value between 0.0 and 1.0
-
inline virtual bool Set(const double &set) override
A positive value downregulates the item, a value of zero is neutral, and a negative value upregulates the item.
-
inline virtual bool Adj(const double &amt) override
A negative value upregulates the item, a value of exactly zero is neutral and a postive value downregulates the item.
-
inline virtual bool Decay(const int steps) override
Timer decay. Return whether MatchBin should be updated
-
inline virtual const double &View() const override
Return a double representing the state of the regulator.
-
inline bool operator!=(const AdditiveCountdownRegulator &other) const
-
inline AdditiveCountdownRegulator()
-
template<typename Slope = std::ratio<1, 10>>
struct MultiplicativeCountdownRegulator : public RegulatorBase<double, double, double> - #include <matchbin_regulators.hpp>
Public Functions
-
inline MultiplicativeCountdownRegulator()
-
inline virtual double operator()(const double raw_score) const override
Apply regulation to a raw match score. Returns a value between 0 and 1.
-
inline virtual bool Set(const double &set) override
A positive value downregulates the item, a value of zero is neutral, and a negative value upregulates the item.
-
inline virtual bool Adj(const double &amt) override
A negative value upregulates the item, a value of exactly zero is neutral and a postive value downregulates the item.
-
inline virtual bool Decay(const int steps) override
Timer decay. Return whether MatchBin should be updated
-
inline virtual const double &View() const override
Return a double representing the state of the regulator.
-
inline bool operator!=(const MultiplicativeCountdownRegulator &other) const
-
inline MultiplicativeCountdownRegulator()