Class TransmissionSimulator
java.lang.Object
org.eclipse.mosaic.fed.sns.ambassador.TransmissionSimulator
-
Constructor Summary
ConstructorsConstructorDescriptionTransmissionSimulator
(RandomNumberGenerator randomNumberGenerator, CSns config) Constructor forTransmissionSimulator
, sets the configuration, transmission models & RNG. -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<String,
SimulationNode> getEntitiesInArea
(Map<String, SimulationNode> relevantEntities, Area<CartesianPoint> range) This method collects all entities, that are within the givenGeoArea
.protected Map<String,
TransmissionResult> sendMessageAsGeocast
(String senderName, DestinationAddressContainer dac) Simulates geocast routing transmission, either broadcast or unicast.protected Map<String,
TransmissionResult> sendMessageAsTopocast
(String senderName, DestinationAddressContainer dac) Simulates topolocically-scoped Unicast (singlehop or multihop transmissions) or Broadcast (only singlehop).
-
Constructor Details
-
TransmissionSimulator
public TransmissionSimulator(RandomNumberGenerator randomNumberGenerator, CSns config) throws InternalFederateException Constructor forTransmissionSimulator
, sets the configuration, transmission models & RNG.- Parameters:
randomNumberGenerator
- theRandomNumberGenerator
to be used for transmission calculations- Throws:
InternalFederateException
- if config couldn't be read or was malformed
-
-
Method Details
-
sendMessageAsTopocast
protected Map<String,TransmissionResult> sendMessageAsTopocast(String senderName, DestinationAddressContainer dac) Simulates topolocically-scoped Unicast (singlehop or multihop transmissions) or Broadcast (only singlehop).- Parameters:
senderName
- The Sender of the message.dac
-DestinationAddressContainer
containing information about the destination for the message.- Returns:
- a Map containing the summarized transmission results
-
sendMessageAsGeocast
protected Map<String,TransmissionResult> sendMessageAsGeocast(String senderName, DestinationAddressContainer dac) Simulates geocast routing transmission, either broadcast or unicast.- Parameters:
senderName
- The Sender of the message.dac
-DestinationAddressContainer
containing information about the destination for the message.- Returns:
- a Map containing the summarized transmission results
-
getEntitiesInArea
public static Map<String,SimulationNode> getEntitiesInArea(Map<String, SimulationNode> relevantEntities, Area<CartesianPoint> range) This method collects all entities, that are within the givenGeoArea
. It is static because it is also required in some of theAdhocTransmissionModel
s.- Parameters:
relevantEntities
- a map of all entities and their names, which should be checked against the arearange
- theGeoArea
within which the entities should be. It is called "range" because it reflects the communication range- Returns:
- A map of the given entities, which are in the destination area.
-