![]() |
VR-Forces 4.0.4 Class Documentation
|
Messages that are sent between entities that represent actual radio traffic are sent though the radio message system.
Only other entities that have radios configured on them are able to receive radio messages. An entity can have more than one radio, and messages can be sent and received on any of the radios on the entity.
Radio messages that VR-Forces sends using the radio message system include spot reports and text reports that an entity can be tasked to send from the GUI.
Radio messages are sent over the network inside signal interactions or signal PDUs.
The radio system in VR-Forces has two major pieces: the radio on the entity (DtVrfRadio or subclass) and the communication model (DtCommModel) (commModel.h) associated with the radio. The radio handles message operations for a specific radio on a specific object. When a message is sent from a radio, that radio passes the message to the communication model with which it is associated. The communication model then processes the message, and based on communication model parameters, passes the message to any recipient radios. The radios on the recipient entities then process the message and invoke any callbacks that have been registered on that radio.
Both the radios and the communication models can be configured. For details, please see "Configuring Radios", and "Configuring Communication Models" in VR-Forces Configuration Guide.
You can create new communication models and install them in VR-Forces. This is useful if you want to define your own connectivity model, or write your own algorithms for determining if radio messages get delivered.
Communication model classes are derived from DtCommModel and are generated from the communication model factory based on the string types specified in ./data/simulationModelSets/<model_set>/commModelParams.mtl. A communication model entry contains parameters for the type of communication model descriptor and communication model class being used.
To create a custom communication model, create a new class derived from DtCommModel, or one of its existing subclasses, and implement the sendMessage() member function. This is the member function that is called by a radio when that radio is sending a message. The communication model must then locate other radios on its list of registered radios, and call receiveMessage() on each radio that should receive the message. The communication model can delay the receipt of a message for as long as it likes, and can choose not to deliver a message at all.
If all you want to do is change the connectivity model of the simple radio communication model, derive from DtSimpleRadioCommModel (simpleRadioCommModel.h) and implement the checkRadioConnectivity() member function, which determines if two entities are on the same network or not.
After you define the communication model, register it with the DtCommModelFactory, as follows:
cgf()->factoryManager()->commModelFactory()->addCreatorFcn("custom-comm-model", myCommModel::create);
Add the new communication model to commModelParams.mtl, as follows:
(default-radio-model (comm-model-descriptor-type "simple-radio-comm-model-descriptor") (comm-model-type "custom-comm-model") …
[<< The VR-Forces Simulation Internal Message System] [Home] [Top of Page]