Internet-based Simulation using off-the-shelf Simulation Too(6)
发布时间: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
If an external event has to be processed, the grant time may be smaller than the actual time advance that had been requested. The user then is expected to check the static and dynamic SLX objects for any data or events that need to be processed. After that the normal
simulation execution can proceed; possibly by issuing the same time advance request again. Figure 5 shows the suggested usage of the time advance functions provided by the wrapper library for SLX.
To ensure the behavior outlined above the functions of the wrapper library for requesting the time advances work synchronously, i.e. the wrapper library keeps control until a time advance grant is received. This is different from the original RTI ambassador functions which work asynchronously. Figure 6 shows a simplified code fragment illustrating the basic algorithm of the time management functions provided by the wrapper library. //global variables
boolean timeAdvGrant;
double grantTime;
...
double RTI_NextEventRequest (double NextEventTime)
{
try
{
timeAdvGrant
= RTI::RTI_FALSE;
ms_rtiAmb->nextEventRequest(NextEventTime);
}
catch ( RTI::Exception& e )
{
return (-1);
}
while (timeAdvGrant == RTI::RTI_FALSE)
{
int eventsToProcess = 1;
while ( eventsToProcess )
{
eventsToProcess = ms_rtiAmb->tick();
//tick the RTI until timeAdvanceGrant callback
//is invoked (which will set timeAdvGrant and
grantTime)
}
}
return (grantTime);
}
Figure 6: Code fragment of the RTI_NextEventRequest function of the wrapper library for SLX
Performance
The wrapper library offers acceptable performance. We have successfully tested several sample federations with up to 4 federates (3 of them SLX) which were all strictly synchronized via the RTI. A part of a reference federation modeling a traffic light scenario is shown in figure 7.
The execution speed of the same model implemented in a monolithic fashion without HLA (as one single SLX model) would be much faster (between 10 to 50 times). However, the primary goal of HLA is not to gain speedups through parallel processing of models. Rather,the main focus of HLA is to facilitate interoperability among a wide variety of simulation tools. To improve general RTI performance is one of the major goals of the current development efforts for an RTI version 2.0.
Figure 7: HLA federation with two SLX federates running on the same computer
It was possible to run all three SLX federates of this federation on one high performance PC (Dual-Pentium II System with 64 Mbytes memory).
Sample Applications
The solution for SLX has been successfully tested in the following sample applications:
•Federation “Traffic Light“: Three SLX federates (car traffic, pedestrian traffic, and traffic light control) were developed to simulate a classical traffic light scenario (Klein and Straßburger 1997).•Federation “Manufacturing“: Two SLX federates (a manufacturing federate, a command and control federate), and a visualization federate (the animation system Skopeo mentioned earlier) were implemented (Schulze et al. 1998).•Federation “Shipping Agencies“: A variable number of SLX federates, each modeling a shipping agency can interact with each other in this federation (Schulze et al. 1998a).
•Federation “Free Driving“: A single SLX federate modeling psycho/physical vehicle-following behavior was coupled with a real-time training simulator. The SLX model had to appropriately react to the vehicle modeled by the training simulator (Klein et al. 1998a).