4 #include "../activations/ActivationBase.hpp" 11 template <typename SCALAR, typename TRAIT = typename ct::core::tpl::TraitSelector<SCALAR>::Trait>
19 virtual void loadConfigFile(
const std::string& filename,
const std::string& termName,
bool verbose =
false)
override 21 boost::property_tree::ptree pt;
22 boost::property_tree::read_info(filename, pt);
23 t_on_ = pt.get<
SCALAR>(termName +
".t_on");
24 t_off_ = pt.get<
SCALAR>(termName +
".t_off");
28 virtual bool isActive(
const SCALAR t)
override {
return (t >= t_on_ && t < t_off_); }
33 std::cout <<
"Cost Function active between values: " << t_on_ <<
"s and: " << t_off_ <<
"s" << std::endl;
SingleActivation()
Definition: SingleActivation.hpp:15
SingleActivation(const SingleActivation &arg)
Definition: SingleActivation.hpp:18
virtual void loadConfigFile(const std::string &filename, const std::string &termName, bool verbose=false) override
load activations from file
Definition: SingleActivation.hpp:19
CppAD::AD< CppAD::cg::CG< double > > SCALAR
Definition: ActivationBase.hpp:18
const bool verbose
Definition: JacobianCGTest.h:19
virtual bool isActive(const SCALAR t) override
this activation is active in a strict time window
Definition: SingleActivation.hpp:28
virtual void printInfo() override
print to console
Definition: SingleActivation.hpp:31
virtual SCALAR computeActivation(const SCALAR t) override
within this time-window, the activation is saturated
Definition: SingleActivation.hpp:30
virtual ~SingleActivation()
Definition: SingleActivation.hpp:17
SingleActivation(const SCALAR t_on, const SCALAR t_off)
Definition: SingleActivation.hpp:16
Definition: SingleActivation.hpp:12