#include <OnlineHistogramGenerator.h>
Public Member Functions | |
OnlineHistogramGenerator () | |
OnlineHistogramGenerator (unsigned numInputPorts, double minVal, double maxVal, unsigned numBins=10, unsigned samplingTime=1) | |
virtual | ~OnlineHistogramGenerator () |
virtual int | nAnalogInputPorts () const |
virtual int | nAnalogOutputPorts () const |
virtual PortType | outputPortType (port_t p) const |
virtual PortType | inputPortType (port_t p) const |
virtual int | reset (double dt) |
Called at the beginning of a simulation at t=0. | |
virtual int | advance (AdvanceInfo const &ai) |
Calculate the next state and output/propagate the result to succesors/outgoing objects. | |
virtual double | getAnalogOutput (analog_port_id_t port=0) const |
Return the analog value currently associated with the given port. | |
virtual void | setAnalogInput (double value, analog_port_id_t port=0) |
Analog input to given port. | |
Protected Attributes | |
unsigned | n_input_ports |
double | min_val |
double | max_val |
unsigned | num_bins |
unsigned | sampling_time |
unsigned | stepsToWait |
double | bin_width |
std::vector< unsigned > | input_counter |
std::vector< double > | out_values |
Definition at line 8 of file OnlineHistogramGenerator.h.
OnlineHistogramGenerator::OnlineHistogramGenerator | ( | ) |
OnlineHistogramGenerator::OnlineHistogramGenerator | ( | unsigned | numInputPorts, | |
double | minVal, | |||
double | maxVal, | |||
unsigned | numBins = 10 , |
|||
unsigned | samplingTime = 1 | |||
) |
Definition at line 8 of file OnlineHistogramGenerator.cpp.
OnlineHistogramGenerator::~OnlineHistogramGenerator | ( | ) | [virtual] |
Definition at line 16 of file OnlineHistogramGenerator.cpp.
int OnlineHistogramGenerator::nAnalogInputPorts | ( | ) | const [virtual] |
Reimplemented from SimObject.
Definition at line 20 of file OnlineHistogramGenerator.cpp.
References n_input_ports.
int OnlineHistogramGenerator::nAnalogOutputPorts | ( | ) | const [virtual] |
Reimplemented from SimObject.
Definition at line 26 of file OnlineHistogramGenerator.cpp.
References num_bins.
SimObject::PortType OnlineHistogramGenerator::outputPortType | ( | port_t | p | ) | const [virtual] |
Reimplemented from SimObject.
Definition at line 32 of file OnlineHistogramGenerator.cpp.
References SimObject::analog, num_bins, and SimObject::undefined.
SimObject::PortType OnlineHistogramGenerator::inputPortType | ( | port_t | p | ) | const [virtual] |
Reimplemented from SimObject.
Definition at line 39 of file OnlineHistogramGenerator.cpp.
References SimObject::analog, n_input_ports, and SimObject::undefined.
Called at the beginning of a simulation at t=0.
Reimplemented from SimObject.
Definition at line 46 of file OnlineHistogramGenerator.cpp.
References bin_width, input_counter, max_val, min_val, num_bins, out_values, and stepsToWait.
int OnlineHistogramGenerator::advance | ( | AdvanceInfo const & | ) | [virtual] |
Calculate the next state and output/propagate the result to succesors/outgoing objects.
The return value of advance contains several bits of information which can be decoded with the bit masks ADVANCEFLAG_* like ADVANCEFLAG_HASSPIKED and ADVANCEFLAG_DEACTIVATE.
Reimplemented from SimObject.
Definition at line 56 of file OnlineHistogramGenerator.cpp.
References input_counter, n_input_ports, out_values, sampling_time, and stepsToWait.
double OnlineHistogramGenerator::getAnalogOutput | ( | analog_port_id_t | port = 0 |
) | const [virtual] |
Return the analog value currently associated with the given port.
Reimplemented from SimObject.
Definition at line 68 of file OnlineHistogramGenerator.cpp.
References out_values.
void OnlineHistogramGenerator::setAnalogInput | ( | double | value, | |
analog_port_id_t | port = 0 | |||
) | [virtual] |
Analog input to given port.
Reimplemented from SimObject.
Definition at line 73 of file OnlineHistogramGenerator.cpp.
References bin_width, input_counter, min_val, num_bins, and stepsToWait.
unsigned OnlineHistogramGenerator::n_input_ports [protected] |
Definition at line 41 of file OnlineHistogramGenerator.h.
Referenced by advance(), inputPortType(), and nAnalogInputPorts().
double OnlineHistogramGenerator::min_val [protected] |
Definition at line 43 of file OnlineHistogramGenerator.h.
Referenced by reset(), and setAnalogInput().
double OnlineHistogramGenerator::max_val [protected] |
unsigned OnlineHistogramGenerator::num_bins [protected] |
Definition at line 46 of file OnlineHistogramGenerator.h.
Referenced by nAnalogOutputPorts(), outputPortType(), reset(), and setAnalogInput().
unsigned OnlineHistogramGenerator::sampling_time [protected] |
unsigned OnlineHistogramGenerator::stepsToWait [protected] |
Definition at line 50 of file OnlineHistogramGenerator.h.
Referenced by advance(), reset(), and setAnalogInput().
double OnlineHistogramGenerator::bin_width [protected] |
Definition at line 52 of file OnlineHistogramGenerator.h.
Referenced by reset(), and setAnalogInput().
std::vector<unsigned> OnlineHistogramGenerator::input_counter [protected] |
Definition at line 54 of file OnlineHistogramGenerator.h.
Referenced by advance(), reset(), and setAnalogInput().
std::vector<double> OnlineHistogramGenerator::out_values [protected] |
Definition at line 56 of file OnlineHistogramGenerator.h.
Referenced by advance(), getAnalogOutput(), and reset().