19 std::vector<std::pair<double, double>>
onTimes;
25 std::vector<std::pair<double, double>>
onTimes = {},
34 constexpr double epsilon = 1e-6;
35 return std::abs(
width - other.
width) < epsilon &&
44 [[nodiscard]] std::string
toString()
const override
46 std::ostringstream result;
47 result << std::fixed << std::setprecision(2);
48 result <<
"Parameters: ["
49 <<
"Width: " <<
width <<
", "
54 for (
size_t i = 0; i <
onTimes.size(); ++i)
56 if (i > 0) result <<
"; ";
60 <<
"Circular: " << (
circular ?
"true" :
"false") <<
", "
61 <<
"Normalized: " << (
normalized ?
"true" :
"false") <<
"]";
80 std::vector<double> stimulusPattern;
86 void step(
double t,
double deltaT)
override;
87 [[nodiscard]] std::string
toString()
const override;
88 [[nodiscard]] std::shared_ptr<Element>
clone()
const override;
Abstract base class for all simulation elements.
Definition element.h:28
2D Gaussian stimulus that is active only during specified time intervals.
Definition timed_gauss_stimulus_2d.h:77
TimedGaussStimulus2DParameters getParameters() const
Definition timed_gauss_stimulus_2d.cpp:119
void step(double t, double deltaT) override
Advance the element by one time step.
Definition timed_gauss_stimulus_2d.cpp:80
void init() override
Initialize the element (called once before the simulation loop).
Definition timed_gauss_stimulus_2d.cpp:26
void setParameters(const TimedGaussStimulus2DParameters ¶meters)
Definition timed_gauss_stimulus_2d.cpp:105
std::shared_ptr< Element > clone() const override
Definition timed_gauss_stimulus_2d.cpp:100
std::string toString() const override
Definition timed_gauss_stimulus_2d.cpp:92
Definition element_parameters.h:10
Definition element_parameters.h:188
Definition element_parameters.h:206
Definition timed_gauss_stimulus_2d.h:14
double position_x
Definition timed_gauss_stimulus_2d.h:17
double position_y
Definition timed_gauss_stimulus_2d.h:18
double width
Definition timed_gauss_stimulus_2d.h:15
std::vector< std::pair< double, double > > onTimes
Definition timed_gauss_stimulus_2d.h:19
double amplitude
Definition timed_gauss_stimulus_2d.h:16
TimedGaussStimulus2DParameters(double width=5.0, double amplitude=15.0, double position_x=25.0, double position_y=25.0, std::vector< std::pair< double, double > > onTimes={}, bool circular=true, bool normalized=false)
Definition timed_gauss_stimulus_2d.h:23
bool circular
Definition timed_gauss_stimulus_2d.h:20
std::string toString() const override
Definition timed_gauss_stimulus_2d.h:44
bool normalized
Definition timed_gauss_stimulus_2d.h:21
bool operator==(const TimedGaussStimulus2DParameters &other) const
Definition timed_gauss_stimulus_2d.h:32