The org.bzdev.drama.common package

Simulation flavors are simulation packages that are optimized for particular application domains but that share an underlying architecture. Flavors are supported via the use of Java generics. One flavor is provided by the org.bzdev.drama package, which more or less mechanically reproduces the org.bzdev.drama.generic package using similar names for objects and adding no additional functionality. By contrast, a network-simulation package could define a class named Node that extends GenericActor and a class named Link that extends GenericGroup: the subclasses can be named to match particular classes of simulations.

This package provides classes common to drama-based simulation flavors. The core functionality for these simulation flavors are in the org.bzdev.drama.generic package, whose public classes are all abstract classes. Classes that are likely to be needed by multiple simulation flavors appear in the current package (org.bzdev.drama.common). The classes, enumerations, and interfaces for org.bzdev.drama.common are illustrated in the following diagram: The classes

Diagram

The class shown in blue is in the org.bzdev.drama.generic package.

The following interfaces and enumerations are defined in this package:

  • ConditionObserver is an interface implemented by classes that wish to be notified of changes in conditions.
  • ConditionMode is an enumeration that describes the events that cause a condition-change notification to be sent.
  • DramaSimStateEventType is an enumeration providing the event types that the org.bzdev.drama.generic package adds to those defined by the org.bzdev.devqsim package's enumeration SimulationStateEvent.Type.
The following classes are defined in this package:
  • The class CommDomainInfo is used for finding domains of interest when domains are used to determine message delays and message filters.
  • The class CommDomainType defines a type of communication domain and allows these to be looked up by name. It is provided so that communication domain types can be compared using '==' instead of a string comparison.
  • The class GroupInfo is a common base class for simulation-specific classes that allow a group or actor to keep additional data about groups it has joined. That additional data is defined by a subclass.
  • The class CondObserverImpl provides an implementation for a condition observer.
  • The class MessageRecipient provides methods common to all message recipients (instances of Actor and Group in the org.bzdev.drama package). It is provided because the class SimulationAdapter needs it.
  • The class SimulationAdapter provides a default implementation for handling simulation state events. The defaults do nothing (unless a constructor specifying a scripting context and script object are used) and one can override specific methods to obtain data about specific events.
  • The class MessageFilter provides the ability to manipulate messages while in transit, either dropping the message or modifying it in some way.
  • The class CompoundMessageFilter is a message filter that concatenates the effects of several message filters.