EventHandler Class Reference

#include <EventHandler.h>

Inheritance diagram for EventHandler:

ScheduledEventHandler TriggeredEventHandler PeriodicEventHandler VelocityRescalingThermostat

List of all members.


Detailed Description

An EventHandler is an object that defines an event that can occur within a system.

It is an abstract class. Subclasses define how to determine when the event occurs, and what happens when it does. You will not generally subclass EventHandler directly. Instead, subclass ScheduledEventHandler (for events that occur at a particular time that is know in advance) or TriggeredEventHandler (for events that occur when some condition is satisfied within the system). ScheduledEventHandler also has another subclass, PeriodicEventHandler, for the common situation of events that occur at regular intervals.

An EventHandler should be thought of as an integral part of the system it belongs to, and may alter the physical properties or behavior of the system. If you merely want to observe the system but not to alter it, you should generally use a EventReporter instead.

Once you have created an EventHandler, you can add it to a System by calling updDefaultSubsystem().addEventHandler() on the System.

Public Member Functions

virtual ~EventHandler ()
virtual void handleEvent (State &state, Real accuracy, const Vector &yWeights, const Vector &ooConstraintTols, Stage &lowestModified, bool &shouldTerminate) const =0
 This method is invoked to handle the event.


Constructor & Destructor Documentation

virtual ~EventHandler (  )  [virtual]


Member Function Documentation

virtual void handleEvent ( State state,
Real  accuracy,
const Vector yWeights,
const Vector ooConstraintTols,
Stage lowestModified,
bool &  shouldTerminate 
) const [pure virtual]

This method is invoked to handle the event.

It is given a State which describes the system at the time when the event occurs, and it is permitted to modify any aspect of the state except the time. In doing so, it should respect the specified accuracy requirements for the continuous variables and constraints.

Parameters:
state the state of the system when the event occurred. This method should modify it to reflect the changes caused by the event.
accuracy the overall accuracy for the simulation. This acts as a multiplier for the weights and constraint tolerances.
yWeights a vector of weights for the continuous state variables. If this method modifies a variable, its new value should be accurate to within accuracy*yWeight.
ooConstraintTols a vector of constraint tolerances. If this method modifies the state, each constraint should be satisfied to within accuracy*ooConstraintTol.
lowestModified if this method modifies the state, it should set this to the lowest stage which it modified, so that the realization cache can be updated.
shouldTerminate if the event handler sets this to true, it will cause the simulation to terminate immediately.

Implemented in VelocityRescalingThermostat.


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

Generated on Fri Sep 26 07:44:30 2008 for SimTKcore by  doxygen 1.5.6