Event Class Reference

An Event is "something that happens" during a Study that is advancing through time. More...

#include <Event.h>

List of all members.

Classes

class  Cause
 These are all the possible causes for events. More...

Public Types

enum  Trigger {
  NoEventTrigger = 0x0000, PositiveToNegative = 0x0001, NegativeToPositive = 0x0002, Falling = (PositiveToNegative),
  Rising = (NegativeToPositive), AnySignChange = (PositiveToNegative|NegativeToPositive)
}
 

Triggered Events respond to zero crossings of their associated trigger function.

More...

Static Public Member Functions

static const char * getCauseName (Cause)
 This is useful for debugging; it translates an Event::Cause into a readable string.
static std::string eventTriggerString (Trigger)
 This is useful for debugging; it translates an Event::Trigger or a mask formed by a union of Event::Triggers, into a readable string.
static Trigger classifyTransition (int before, int after)
 Classify a before/after sign transition.
static Trigger maskTransition (Trigger transition, Trigger mask)
 Given an observed transition, weed out ignorable ones using the supplied mask.

Detailed Description

An Event is "something that happens" during a Study that is advancing through time.

Its occurence interrupts the normal flow of computation, allowing an event Handler to adjust the State prior to resuming the Study.

Events are allocated by Subsystems, but require some System global resources. All Events are given a unique SystemEventId. Some Events require other State resources, such as slots for the values of trigger functions in the case of Triggered events.

Events can be allocated at Topology, Model, and Instance Stages. All Event resources are assigned when the Instance stage is realized. However, if an Event requires state variables, then it must be allocated by Model stage.


Member Enumeration Documentation

enum Trigger

Triggered Events respond to zero crossings of their associated trigger function.

This enum defines constants for use in specifying which kind of zero crossing has been seen, or which kinds are considered interesting. For the latter purpose, these can be or'ed together to make a mask.

Enumerator:
NoEventTrigger 
PositiveToNegative 
NegativeToPositive 
Falling 
Rising 
AnySignChange 

Member Function Documentation

static Trigger classifyTransition ( int  before,
int  after 
) [inline, static]

Classify a before/after sign transition.

Before and after must both be -1,0, or 1 as returned by the SimTK::sign() function applied to the trigger function value at the beginning and end of a step.

References Event::NegativeToPositive, Event::NoEventTrigger, and Event::PositiveToNegative.

static std::string eventTriggerString ( Trigger   )  [static]

This is useful for debugging; it translates an Event::Trigger or a mask formed by a union of Event::Triggers, into a readable string.

static const char* getCauseName ( Cause   )  [static]

This is useful for debugging; it translates an Event::Cause into a readable string.

static Trigger maskTransition ( Trigger  transition,
Trigger  mask 
) [inline, static]

Given an observed transition, weed out ignorable ones using the supplied mask.

That is, the return will indicate NoEventTrigger unless the original Trigger was present in the mask.


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

Generated on Wed Dec 30 11:05:22 2009 for SimTKcore by  doxygen 1.6.1