High-level architecture

A graphic simulation program needs to manage moving, interacting items under partial user control. This goal is reflected by Concurrent Actors' subsystems:


Program subsystem
CommonPoint frameworks
and class libraries

Key CommonPoint classes used
Frameworks and class libraries
used by Concurrent Actors subsystems
Universe subsystem Data Structures TDequeOf
Tasks and Threads TThreadProgram
Game subsystem 2-D Graphics MGraphic
Sequences TDequeOf
Synchronization services TLocalSemaphore
Interface subsystem 2-D Graphics TIndexedImage
2-D Ports TGrafPort
Input system MKeyEventHandler
Presentation framework TGUIEmbedderModel
TGUIEmbedderModelView
Movement subsystem Tasks and Threads TThreadProgram
Time services TSystemClock
TDelay
Refresh subsystem 2-D Ports TGrafPort
Tasks and Threads TThreadProgram
Time services TSystemClock
TDelay
Collision subsystem Notification TNotifier
TMemberFunctionConnectionTo
Local utility classes Synchronization services TMonitorCondition
TMonitorEntry
TMonitorLock
Tasks and Threads TThreadProgram
Time services TSystemClock
TDelay

All subsystems operate concurrently. This design simplifies the implementation of Concurrent Actors because each subsystem can operate as though in isolation. (In the future, this design will let the program take advantage of multiprocessing systems.)

In addition, you'll notice that some of the subsystems are actually frameworks. This design allows you to expand or reuse the subsystems in your own program. For example, reusing the subsystems could be as simple as replacing the visual representation and behavior of the actors, or as radical as changing the program premise to a traffic flow simulation.

For suggestions on expanding this program to support additional features, see "Extensions" (page 45).


The TSimulationModel object holds all persistent simulation data--it provides an interface to the document framework storage services. The TSimulationView instance manages the display of the simulation as it runs. The view updates the display whenever it receives a notification that the simulation has changed.

Starting and stopping the simulation in an orderly fashion and saving the simulation's state is handled by the TSimulationLevel instance.

The TAbstractActor abstract class defines an abstract protocol for all objects in a simulation. Managing the actual mechanics of the simulation is handled by the TUniverse instance. Specifically, this instance handles the multiple threads that make the simulation run.

The TCollisionBehavior abstract class provides a protocol for objects representing different types of interactions between actors. The orderly creation and destruction of actors that occurs while running the simulation is managed by the TUniverseThread instance.

The TMoverThread instance performs all movement in the simulation while the TRefreshThread instance of this object acts as a clock, ticking off times when the TSimulationView should update the display. It updates an internal offscreen buffer and then sends a notification that the simulation has changed.

Following are the subsystems that comprise Concurrent Actors.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker