PlusCountdownRegulator.hpp

Regulator that modifies match distance through addition and decays to baseline with a countdown timer.

This file is part of Empirical, https://github.com/devosoft/Empirical Copyright (C) 2020 Michigan State University MIT Software license; see doc/LICENSE.md

Defines

INCLUDE_EMP_MATCHING_REGULATORS_PLUS_COUNTDOWN_REGULATOR_HPP_GUARD
template<typename Slope = std::deci>
struct PlusCountdownRegulator
#include <PlusCountdownRegulator.hpp>

Public Types

using set_t = float
using adj_t = float
using view_t = float

Public Functions

inline bool Set(const float &set)

A positive value downregulates the item, a value of zero is neutral, and a negative value upregulates the item.

inline bool Adj(const float &amt)

A negative value upregulates the item, a value of exactly zero is neutral and a positive value downregulates the item.

inline bool Decay(const int steps)

Timer decay. Return whether MatchBin should be updated

inline const float &View() const

Return a float representing the state of the regulator.

Public Members

float state = {}
unsigned char timer = {}

Public Static Attributes

static constexpr float slope = (static_cast<float>(Slope::num) / static_cast<float>(Slope::den))