Traffic Simulation
- class dsns.traffic_sim.GenerateMessagesEvent(time: float)
Event to add more messages to the simulation queue.
- __init__(time: float)
- class dsns.traffic_sim.Sampler
Base class for sampling strategies.
- sample_float(min: float = None, max: float = None) float
Sample a value from the distribution.
- sample_int(min: int = None, max: int = None) int
Sample a value from the distribution and convert it to an integer.
- class dsns.traffic_sim.ConstantSampler(value: float)
A simple constant sampler that returns a fixed value.
- __init__(value: float)
- class dsns.traffic_sim.UniformSampler(min: float, max: float)
A simple uniform sampler that generates random numbers within a specified range.
- __init__(min: float, max: float)
- class dsns.traffic_sim.NormalSampler(mean: float, std: float)
A simple normal sampler that generates random numbers from a normal distribution.
- __init__(mean: float, std: float)
- class dsns.traffic_sim.ParetoSampler(scale: float, shape: float)
A simple Pareto sampler that generates random numbers from a Pareto distribution.
- __init__(scale: float, shape: float)
- class dsns.traffic_sim.MultiPointToPointTrafficActor(message_config: list[tuple[str, int, int, int, float]], update_interval: float = 60, reliable_messages: bool = False, cutoff: int | None = None)
Actor that simulates point-to-point traffic between multiple pairs of nodes.
- __init__(message_config: list[tuple[str, int, int, int, float]], update_interval: float = 60, reliable_messages: bool = False, cutoff: int | None = None)
- Parameters:
message_config – List of tuples containing (name, source, destination, message_size, message_interval).
update_interval – Time interval to generate new messages in seconds.
reliable_messages – Whether to use reliable message delivery (i.e. generate HybridDirectMessages).
- class dsns.traffic_sim.RandomTrafficActor(satellites: list[int], message_interval: float = 1, message_size: ~dsns.traffic_sim.Sampler = <dsns.traffic_sim.ConstantSampler object>, message_source: ~dsns.traffic_sim.Sampler = <dsns.traffic_sim.UniformSampler object>, message_destination: ~dsns.traffic_sim.Sampler = <dsns.traffic_sim.UniformSampler object>, update_interval: float = 60, reliable_messages: bool = False)
Actor that simulates random traffic across the network.
- __init__(satellites: list[int], message_interval: float = 1, message_size: ~dsns.traffic_sim.Sampler = <dsns.traffic_sim.ConstantSampler object>, message_source: ~dsns.traffic_sim.Sampler = <dsns.traffic_sim.UniformSampler object>, message_destination: ~dsns.traffic_sim.Sampler = <dsns.traffic_sim.UniformSampler object>, update_interval: float = 60, reliable_messages: bool = False)
- Parameters:
satellites – List of satellite IDs to use as sources and destinations.
message_interval – Time interval between messages in seconds.
message_size – Sampler for the size of the messages in bytes.
message_source – Sampler for the source of the messages (e.g. satellite ID).
message_destination – Sampler for the destination of the messages (e.g. satellite ID).
update_interval – Time interval to generate new messages in seconds.
reliable_messages – Whether to use reliable message delivery (i.e. generate HybridDirectMessages).
- class dsns.traffic_sim.PointToPointTrafficActor(source: int, destination: int, message_interval: float, update_interval: float = 60)
Actor that simulates point-to-point traffic between two satellites.
- __init__(source: int, destination: int, message_interval: float, update_interval: float = 60)
- Parameters:
source – The satellite sending the messages.
destination – The satellite receiving the messages.
message_interval – Time interval between messages in seconds.
update_interval – Time interval to generate new messages in seconds.