Drake
ClockWitness< T > Class Template Reference

Witness function for determining when the time of the empty system crosses zero. More...

#include <systems/analysis/test_utilities/stateless_system.h>

Inheritance diagram for ClockWitness< T >:
[legend]
Collaboration diagram for ClockWitness< T >:
[legend]

Public Member Functions

 ClockWitness (double trigger_time, const System< T > &system, const WitnessFunctionDirection &dir_type)
 
double get_trigger_time () const
 Get the time at which this witness triggers. More...
 
Does not allow copy, move, or assignment
 ClockWitness (const ClockWitness &)=delete
 
ClockWitnessoperator= (const ClockWitness &)=delete
 
 ClockWitness (ClockWitness &&)=delete
 
ClockWitnessoperator= (ClockWitness &&)=delete
 
- Public Member Functions inherited from WitnessFunction< T >
virtual ~WitnessFunction ()
 
 WitnessFunction (const System< T > &system, const WitnessFunctionDirection &dtype)
 Constructs the witness function with the given direction type. More...
 
const std::string & get_name () const
 Gets the name of this witness function (used primarily for logging and debugging). More...
 
void set_name (const std::string &name)
 Sets the name of this witness function. More...
 
void AddEvent (CompositeEventCollection< T > *events) const
 Adds the appropriate event that will be dispatched when this witness function triggers. More...
 
WitnessFunctionDirection get_dir_type () const
 Gets the direction(s) under which this witness function triggers. More...
 
Evaluate (const Context< T > &context) const
 Evaluates the witness function at the given context. More...
 
const System< T > & get_system () const
 Gets a reference to the System used by this witness function. More...
 
decltype(T()< T()) should_trigger (const T &w0, const T &wf) const
 Checks whether the witness function should trigger using given values at w0 and wf. More...
 
 WitnessFunction (const WitnessFunction &)=delete
 
WitnessFunctionoperator= (const WitnessFunction &)=delete
 
 WitnessFunction (WitnessFunction &&)=delete
 
WitnessFunctionoperator= (WitnessFunction &&)=delete
 

Protected Member Functions

DoEvaluate (const Context< T > &context) const override
 Derived classes will implement this function to evaluate the witness function at the given context. More...
 
void DoAddEvent (CompositeEventCollection< T > *events) const override
 Derived classes will override this function to add the appropriate event that will be dispatched when this witness function triggers. More...
 

Additional Inherited Members

- Protected Attributes inherited from WitnessFunction< T >
std::string name_
 

Detailed Description

template<class T>
class drake::systems::analysis_test::ClockWitness< T >

Witness function for determining when the time of the empty system crosses zero.

The witness function is just the time in the context.

Constructor & Destructor Documentation

ClockWitness ( const ClockWitness< T > &  )
delete
ClockWitness ( ClockWitness< T > &&  )
delete
ClockWitness ( double  trigger_time,
const System< T > &  system,
const WitnessFunctionDirection dir_type 
)
inlineexplicit

Member Function Documentation

void DoAddEvent ( CompositeEventCollection< T > *  events) const
inlineoverrideprotectedvirtual

Derived classes will override this function to add the appropriate event that will be dispatched when this witness function triggers.

Example events are publish, perform a discrete variable update, and performing an unrestricted update. events is guaranteed to be non-null on entry.

Implements WitnessFunction< T >.

Here is the call graph for this function:

T DoEvaluate ( const Context< T > &  context) const
inlineoverrideprotectedvirtual

Derived classes will implement this function to evaluate the witness function at the given context.

Parameters
contextan already-validated Context

Implements WitnessFunction< T >.

Here is the call graph for this function:

double get_trigger_time ( ) const
inline

Get the time at which this witness triggers.

ClockWitness& operator= ( const ClockWitness< T > &  )
delete
ClockWitness& operator= ( ClockWitness< T > &&  )
delete

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