OnlineAverager Class Reference

#include <OnlineAverager.h>

Inheritance diagram for OnlineAverager:

Inheritance graph
[legend]
Collaboration diagram for OnlineAverager:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 OnlineAverager ()
 OnlineAverager (unsigned numInputPorts)
virtual ~OnlineAverager ()
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.

Public Attributes

double mean
 Instantaneous mean of analog values that arrive at the input ports [range=(-1e6,1e6)].
double std
 Instantaneous standard deviation of analog values that arrive at the input ports [range=(-1e6,1e6)].

Protected Attributes

unsigned n_input_ports
double sum
double sum2


Detailed Description

Definition at line 8 of file OnlineAverager.h.


Constructor & Destructor Documentation

OnlineAverager::OnlineAverager (  ) 

Definition at line 3 of file OnlineAverager.cpp.

OnlineAverager::OnlineAverager ( unsigned  numInputPorts  ) 

Definition at line 7 of file OnlineAverager.cpp.

OnlineAverager::~OnlineAverager (  )  [virtual]

Definition at line 12 of file OnlineAverager.cpp.


Member Function Documentation

int OnlineAverager::nAnalogInputPorts (  )  const [virtual]

Reimplemented from SimObject.

Definition at line 15 of file OnlineAverager.cpp.

References n_input_ports.

int OnlineAverager::nAnalogOutputPorts (  )  const [virtual]

Reimplemented from SimObject.

Definition at line 20 of file OnlineAverager.cpp.

SimObject::PortType OnlineAverager::outputPortType ( port_t  p  )  const [virtual]

Reimplemented from SimObject.

Definition at line 26 of file OnlineAverager.cpp.

References SimObject::analog, and SimObject::undefined.

SimObject::PortType OnlineAverager::inputPortType ( port_t  p  )  const [virtual]

Reimplemented from SimObject.

Definition at line 34 of file OnlineAverager.cpp.

References SimObject::analog, n_input_ports, and SimObject::undefined.

int OnlineAverager::reset ( double  dt  )  [virtual]

Called at the beginning of a simulation at t=0.

Reimplemented from SimObject.

Definition at line 42 of file OnlineAverager.cpp.

References mean, std, sum, and sum2.

int OnlineAverager::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 51 of file OnlineAverager.cpp.

References mean, n_input_ports, std, sum, and sum2.

double OnlineAverager::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 60 of file OnlineAverager.cpp.

References mean, and std.

void OnlineAverager::setAnalogInput ( double  value,
analog_port_id_t  port = 0 
) [virtual]

Analog input to given port.

Reimplemented from SimObject.

Definition at line 70 of file OnlineAverager.cpp.

References sum, and sum2.


Member Data Documentation

Instantaneous mean of analog values that arrive at the input ports [range=(-1e6,1e6)].

Definition at line 40 of file OnlineAverager.h.

Referenced by advance(), getAnalogOutput(), and reset().

Instantaneous standard deviation of analog values that arrive at the input ports [range=(-1e6,1e6)].

Definition at line 43 of file OnlineAverager.h.

Referenced by advance(), getAnalogOutput(), and reset().

unsigned OnlineAverager::n_input_ports [protected]

Definition at line 46 of file OnlineAverager.h.

Referenced by advance(), inputPortType(), and nAnalogInputPorts().

Definition at line 48 of file OnlineAverager.h.

Referenced by advance(), reset(), and setAnalogInput().

Definition at line 49 of file OnlineAverager.h.

Referenced by advance(), reset(), and setAnalogInput().


The documentation for this class was generated from the following files:

Generated on Wed Jul 9 16:34:52 2008 for PCSIM by  doxygen 1.5.5