18 std::vector<std::pair<double, double>>
onTimes;
24 std::vector<std::pair<double, double>>
onTimes = {},
32 constexpr double epsilon = 1e-6;
33 return std::abs(
width - other.
width) < epsilon &&
41 [[nodiscard]] std::string
toString()
const override
43 std::ostringstream result;
44 result << std::fixed << std::setprecision(2);
45 result <<
"Parameters: ["
46 <<
"Width: " <<
width <<
", "
50 for (
size_t i = 0; i <
onTimes.size(); ++i)
52 if (i > 0) result <<
"; ";
56 <<
"Circular: " << (
circular ?
"true" :
"false") <<
", "
57 <<
"Normalized: " << (
normalized ?
"true" :
"false") <<
"]";
76 std::vector<double> stimulusPattern;
82 void step(
double t,
double deltaT)
override;
83 [[nodiscard]] std::string
toString()
const override;
84 [[nodiscard]] std::shared_ptr<Element>
clone()
const override;
Abstract base class for all simulation elements.
Definition element.h:28
Gaussian stimulus that is active only during specified time intervals.
Definition timed_gauss_stimulus.h:73
std::shared_ptr< Element > clone() const override
Definition timed_gauss_stimulus.cpp:76
void init() override
Initialize the element (called once before the simulation loop).
Definition timed_gauss_stimulus.cpp:20
TimedGaussStimulusParameters getParameters() const
Definition timed_gauss_stimulus.cpp:90
void step(double t, double deltaT) override
Advance the element by one time step.
Definition timed_gauss_stimulus.cpp:56
void setParameters(const TimedGaussStimulusParameters ¶meters)
Definition timed_gauss_stimulus.cpp:81
std::string toString() const override
Definition timed_gauss_stimulus.cpp:68
Definition element_parameters.h:10
Definition element_parameters.h:188
Definition element_parameters.h:206
Definition timed_gauss_stimulus.h:14
std::vector< std::pair< double, double > > onTimes
Definition timed_gauss_stimulus.h:18
std::string toString() const override
Definition timed_gauss_stimulus.h:41
bool operator==(const TimedGaussStimulusParameters &other) const
Definition timed_gauss_stimulus.h:30
bool normalized
Definition timed_gauss_stimulus.h:20
double width
Definition timed_gauss_stimulus.h:15
double position
Definition timed_gauss_stimulus.h:17
double amplitude
Definition timed_gauss_stimulus.h:16
TimedGaussStimulusParameters(double width=5.0, double amplitude=15.0, double position=50.0, std::vector< std::pair< double, double > > onTimes={}, bool circular=true, bool normalized=false)
Definition timed_gauss_stimulus.h:22
bool circular
Definition timed_gauss_stimulus.h:19