Internet-based Simulation using off-the-shelf Simulation Too(3)
发布时间:2021-06-06
发布时间:2021-06-06
provides a standardized interface for distributed simulations. The recent advent of HLA has greatly increased interest in the use of distributed, interoperable simulation model components. To date, most models using HLA have been developed in conventional
of methods of the RTI ambassador object. The definitions a federate needs to be able to construct proper calls are provided as part of HLA. For simulations developed in C++, these definitions are provided in the form of header (“.hh”) files. For federates developed in languages other than C++, alternative means must be used to construct calls to the RTI ambassador.
A federate must also provide an ambassador object which contains “callback”functions (methods) which can be called by the RTI. These methods must conform to the HLA standard. The skeletal definitions of the calling sequences of the required federate ambassador methods are provided in the form of C++ header files. The header files contain an abstract object class for the federate ambassador. To construct a federate, one fills in the skeleton with actual code by deriving a concrete object class from the abstract one. While this is straightforward for federates written in C++, alternative means must be developed to construct ambassadors for simulations developed in other languages.
3.2 R equirements derived from being part of
a distributed simulation
Being member of a distributed simulation imposes some general problems that stand-alone simulations do not have to deal with.
Synchronization
Participants in a distributed simulation have to coordinate their local advances in logical simulation time. To do so they have to take into account their mutual dependencies. In previous approaches to distributed simulation, developers had to devise and implement their own time management algorithms (Fujimoto 1990).
HLA provides a mechanism for coordinating logical simulation time of event driven simulators. Actually HLA offers much more than simple “coordination”: it provides a transparent time management that makes it almost unnecessary for federates to know the time regime used by other federates.
In order for this to work, the RTI requires federates to request their time advances by calling the appropriate methods of the RTI ambassador object. For discrete event simulation tools, which are the focus of this paper, the interface function “nextEventRequest”is of major interest. A federate must issue a call to this function before advancing in its logical time. A federate is then expected to honor certain callback functions that the RTI might call. In particular, it must wait for a “timeAdvanceGrant“callback.
The latter is the typical scenario for a conservative synchronization. In such a scenario the need to constantly request the time advances could be automated by adding a new synchronization thread to the simulation model (Figure 2). This thread should have the lowest priority to ensure that at a certain logical simulation time all actual “simulation“events have been processed before the time stamp of the next event is determined. This way no event can be scheduled with a time stamp lower than the one the request is issued for. As a prerequisite for this kind of synchronization to work the simulation tool has to offer a function for the determination of the next scheduled event time (e.g. GPSS/H: NAC1, SLX: next_imminent_time( )).
Figure 2: Principle of the synchronization thread
HLA also supports optimistically synchronized federates. Although we are currently experimenting with this approach, our experiments are not discussed in this paper.
In a distributed simulation a model also has to react to external events. The occurrence of such an event is communicated to the federate through certain callback functions in the federate (e.g. attribute updates, interaction messages etc.) which are called by the RTI.
The two fundamental actions a simulation must perform in order to achieve synchronization are to:•determine the next logical event time of the simulator and request an advancement to this time at the RTI;
and
•wait for a time advance grant from the RTI and react to any external events that have been sent to the federate.
Data exchange and data representation
A simulator must also have the capability of receiving and sending data about the objects comprising a model. This is done by using HLA interface functions and is a