Class TransmissionSimulator
- java.lang.Object
-
- org.eclipse.mosaic.fed.sns.ambassador.TransmissionSimulator
-
public class TransmissionSimulator extends Object
-
-
Constructor Summary
Constructors Constructor Description TransmissionSimulator(RandomNumberGenerator randomNumberGenerator, CSns config)
Constructor forTransmissionSimulator
, sets the configuration, transmission models & RNG.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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.protected Map<String,TransmissionResult>
sendMessageAsTopocast(String senderName, DestinationAddressContainer dac)
Simulates topolocically-scoped Unicast or Broadcast as direct singlehop transmission.
-
-
-
Constructor Detail
-
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 Detail
-
sendMessageAsTopocast
protected Map<String,TransmissionResult> sendMessageAsTopocast(String senderName, DestinationAddressContainer dac)
Simulates topolocically-scoped Unicast or Broadcast as direct singlehop transmission. (NO multi-hops are implemented by now)- Verify if configured transmission can be send using the topocast logic
- Differentiate between Unicast and Broadcast
- Simulate transmission with one hop
- 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. (ONLY Broadcasts are implemented by now)- Verify if configured transmission can be send using the topocast logic
- determine all potential receiver nodes in the destination area (including original sender due to re-broadcasting in geocast)
- simulate message transmission via
- simplified Multihop mode (possibly needed hops to reach destination not regarded)
- with more elaborated approaching and flooding modes
- 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.
-
-