Presentation is loading. Please wait.

Presentation is loading. Please wait.

Distributed Virtual Environment and Simulation Package Stephen Lawrence

Similar presentations


Presentation on theme: "Distributed Virtual Environment and Simulation Package Stephen Lawrence"— Presentation transcript:

1 Distributed Virtual Environment and Simulation Package Stephen Lawrence stevel@cc.gatech.edu

2 Overview of Topics Type of Simulation Federation Organization Class Organization Internals of some DVESIM classes Creating a Federate Creating Simulation Objects

3 Type of Simulation –Object Based Simulation (using c++) Simulator, object(such as a tank or projectile), and battlefield classes new object types are created by sub-classing existing objects –Event Driven Classes define event handlers to process events –Federated (using DRTI) Each federate has local and non-local entities object updates are only send when needed Messages are sent between user and entities

4 Federation Organization Simulator Federate UI Federate Simulator Federate

5 Federation Organization (cont) Simulator Federates –Each controls a number of objects within the simulation world –Sends and received updates and interactions concerning it’s objects, and objects controlled by other federates UI Federates –Allows users to view and interact with object in the Federation

6 Class Organization Entity Structure Projectile Tick New Object Collision Order Movement Simulator Federate Classes SimulatorEventObjectBattlefield = subclass

7 Internals: Simulator Class Each simulator federate runs one instance of the simulator class Manages Event Queue –Schedules events –Dispatches events to objects Simulates Battlefield –Collision/proximity detection –Projectile detonation Federate communication –sends and receives events such as object updates and messages

8 Internals: Simulator Class (continued)

9 Simulation Class Execution –init() Schedule all new object events for all local objects. Sets up simulation state schedules first new state event –run() while event-queue not empty –process event –deliver event to object if necessary –finishUp()

10 Internals: Simulator Class Example 1.The federates executive function removes the tick event from the event queue. 2.The tick event is passed to the federates tick event handler (a method of it's simulator class). 3.The tick event is forwarded, by the simulators event handler, to all objects in the battlefield. 4.The simulator class checks for collision between it's local objects and all objects in the battlefield (local and foreign). 5.A new tick event is created and scheduled for some small time in the future.

11 Internals: Battlefield Class Manages objects –objects hashed by RTI::ObjectHandle for fast access –Provides means for objects to access other objects –Contains both locally controlled objects, and objects controlled by other federates. Terrain Information (not implemented) –provides terrain type for given coordinates on the battlefield –objects view the world in only two dimensions, the battlefield provides additional elevation and slope information when needed

12 Internals: Event Class Stores Event Information (TimeStamp, details) Tick Event -> triggers location updates and collision detection New Object Event -> adds a new object to the battlefield Order Event -> sends object and simulation messages, such as orders, simulation over, etc… Other Events –Movement Event, Collision Event, Proximity Event,Detonation Event, User Defined Events

13 Internals: Event Class Example 1.Collision event is passed to the event handler by the executive function when it is safe to process. 2.The event handler passes the collision event to the local object involved in the collision (if two local objects are in collision, each will get it's own event). 3.The object reacts to the collision event. The default action is to do nothing, but subclasses of the object type can redefine the event handlers to do something interesting, such as stop, change direction, or calculate a new path.

14 Internals: Object Class Physical State Information (location, velocity, acceleration) Processes New State events to update it’s physical state Entity Subclass –Provides basic movement services (set heading/location, etc) –Fires projectiles

15 Internals: Object Class (continued) Object Class Execution –A new object is created and stored in new object event –The simulator later processes new object event Calls object init() function Sends New State and other events to object Object is removed by a call to exitObject() objects finishUp() function is called, and the object is deleted

16 Internals: Object Class Example 1.Simulator federate #1 schedules schedules a new object event for object A at time 1, register's an object instance for it within the federation, and sends an attribute update for the the object with timestamp 1 2.Simulator federate #2 discovers the object, creates a new object instance, and puts it in a temporary holding place. 3.When requesting a Next Event Request for time 1, federate #2's RTI ambassador delivers the attribute update for object A 4.Federate #2, now having received the first attribute information about object A, schedules a new object event with timestamp 1, which will be processed to add object A to it's battlefield. 5.After completing a Next Event Request for timestep 1, federate #1 will be able to process it's new object event and add object A to it's battlefield.

17 Internals: Visualization Display’s all the objects in the federation Paces the simulation with wallclock time Allows user to send messages to the objects (entities)


Download ppt "Distributed Virtual Environment and Simulation Package Stephen Lawrence"

Similar presentations


Ads by Google