Simbody  3.4 (development)
SimTK::Measure_< T >::SampleAndHold Class Reference

NOT IMPLEMENTED YET -- This is a Measure operator which, upon occurrence of a designated event, samples its source Measure and then holds its value in a discrete state variable until the next occurrence of the event. More...

#include <Measure.h>

+ Inheritance diagram for SimTK::Measure_< T >::SampleAndHold:

List of all members.

Public Member Functions

 SimTK_MEASURE_HANDLE_PREAMBLE (SampleAndHold, Measure_< T >)
 SampleAndHold (Subsystem &sub, const Measure_< T > &source, EventId e)
void setValue (State &s, const T &value) const
 Set the held value to a particular value, unrelated to the source.
void sample (State &s) const
 Force this Measure to sample its input at the current time.
const Measure_< T > & getSource () const
EventId getEventId () const
SampleAndHoldsetSource (const Measure_< T > &s)
SampleAndHoldsetEventId (EventId)
 SimTK_MEASURE_HANDLE_POSTSCRIPT (SampleAndHold, Measure_< T >)

Detailed Description

template<class T>
class SimTK::Measure_< T >::SampleAndHold

NOT IMPLEMENTED YET -- This is a Measure operator which, upon occurrence of a designated event, samples its source Measure and then holds its value in a discrete state variable until the next occurrence of the event.

Any type of data can be sampled this way.

Information available from this Measure:

  • the held value (Time stage)
  • time of last sample
  • the DiscreteVariableIndex holding the sampled value
  • a reference to the operand Measure

Study initialization is always considered a sampling event. This measure has no time derivative.


Constructor & Destructor Documentation

template<class T>
SimTK::Measure_< T >::SampleAndHold::SampleAndHold ( Subsystem sub,
const Measure_< T > &  source,
EventId  e 
)

Member Function Documentation

template<class T>
void SimTK::Measure_< T >::SampleAndHold::setValue ( State s,
const T &  value 
) const

Set the held value to a particular value, unrelated to the source.

The time stamp will be taken from the supplied State.

template<class T>
void SimTK::Measure_< T >::SampleAndHold::sample ( State s) const

Force this Measure to sample its input at the current time.

template<class T>
const Measure_<T>& SimTK::Measure_< T >::SampleAndHold::getSource ( ) const
template<class T>
EventId SimTK::Measure_< T >::SampleAndHold::getEventId ( ) const
template<class T>
SampleAndHold& SimTK::Measure_< T >::SampleAndHold::setSource ( const Measure_< T > &  s)

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines