Simple Network Simulator (Sim2net) Documentation: Release
Simple Network Simulator (Sim2net) Documentation: Release
Simple Network Simulator (Sim2net) Documentation: Release
Documentation
Release
Michal Kalewski
1 Installation 3
1.1 1. Using the pip installation tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 2. Manually from the source code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3 Contents 7
3.1 Command-line interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.1.1 Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.1.2 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2 sim2net.application.Application abstract class . . . . . . . . . . . . . . . . . . . . . . 8
3.2.1 Default configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.3 Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.3.1 Package sim2net . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.3.2 Package sim2net.area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3.3 Package sim2net.failure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.3.4 Package sim2net.mobility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.3.5 Package sim2net.packet_loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.3.6 Package sim2net.placement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.3.7 Package sim2net.propagation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.3.8 Package sim2net.speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.3.9 Package sim2net.utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5 Links 45
6 Copyright 47
Bibliography 49
i
ii
Simple Network Simulator (sim2net) Documentation, Release
Simple Network Simulator (sim2net) is a discrete event simulator of mobile ad hoc networks (MANETs) imple-
mented in Python (version 2.7). The simulator allows us to simulate networks of a given number of nodes that move
according to the selected mobility model, run custom applications, and communicate only by sending application
messages through wireless links.
Contents 1
Simple Network Simulator (sim2net) Documentation, Release
2 Contents
CHAPTER 1
Installation
There are two possibilities to install the sim2net simulator: with the use of the pip installation tool, or from the source
code obtained from GitHub.
3
Simple Network Simulator (sim2net) Documentation, Release
4 Chapter 1. Installation
CHAPTER 2
$ sim2net -i .
$ sim2net ./configuration.py ./application.py
5
Simple Network Simulator (sim2net) Documentation, Release
Contents
Command-line interface
This package provides a command-line interface for the sim2net simulator, which allows users to initialize and start
simulations.
Synopsis
positional arguments:
CONFIGURATION simulation configuration file
APPLICATION simulation application file
optional arguments:
-h, --help show this help message and exit
-d, --description show description message and exit
-i DIRECTORY, --initialize DIRECTORY
write configuration and application files to given
directory
-v, --version show version message and exit
Description
To start a simulation with the sim2net simulator, two files are necessary: a configuration file (with the simulator
settings) and an application file that is run by every node in the simulated network (the application must implement
the sim2net.application.Application abstract class). The easiest way to obtain both files is to execute the
sim2net command with the -i option, eg.:
7
Simple Network Simulator (sim2net) Documentation, Release
sim2net -i .
After that, two files are created in the given directory: configuration.py and application.py. Both files
may be edited – for more information about configuration parameters see Packages section, and for more information
about application implementation see the sim2net.application.Application abstract class.
Next, to start the simulation, the sim2net command should be executed with both files as arguments, eg.:
See also:
Packages, sim2net.application.Application
class sim2net.application.Application
Bases: object
failure(time, shared)
finalize(shared)
initialize(node_id, shared)
main(time, communication, neighbors, shared)
Default configuration
test.
Packages
Simple Network Simulator (sim2net) – a discrete-event simulation of mobile ad hoc networks (MANETs).
Package sim2net
Package modules:
• Module sim2net._version
• Module sim2net._time
• Module sim2net._channel
• Module sim2net._network
• Module sim2net.simulator
8 Chapter 3. Contents
Simple Network Simulator (sim2net) Documentation, Release
Module sim2net._version
Module sim2net._time
class sim2net._time.Time
Bases: object
This class provides time abstractions for simulations.
Class Time keeps track of simulation steps and time in accordance with a given simulation frequency value.
setup(simulation_frequency=1)
Initializes time abstractions for simulations.
Parameters:
• simulation_frequency (int): a value of the simulation frequency (greater than 0).
3.3. Packages 9
Simple Network Simulator (sim2net) Documentation, Release
Raises:
• ValueError: raised when a given value of the simulation frequency is less or equal to 0.
Examples:
simulation_frequency
(Property) The simulation frequency of type int.
simulation_period
(Property) The simulation period of type float.
simulation_step
(Property) The current simulation step value of type int.
simulation_time
(Property) The current simulation time value of type float.
tick()
Advances the simulation step and time values.
Returns: A tuple of two values: the current simulation step (int) and the current simulation time (float).
Note: The first call to this method will always returns (0, 0.0).
Module sim2net._channel
Provides an implementation of bidirectional communication channels for nodes in the simulated network.
The channels transmit packets that transport application messages between neighboring nodes. Each packet has its
own identifier that is unique under the same sender, and can be received only by these nodes that are neighbors of
the sender for the duration of the packet transmission according to the wireless signal propagation model used (see:
10 Chapter 3. Contents
Simple Network Simulator (sim2net) Documentation, Release
sim2net.propagation). Potential packet losses are determined on the basis of the given model (see: sim2net.
packet_loss), and transmission time of each packet is uniformly randomized in range (0, 𝑡𝑚𝑎𝑥 ], where 𝑡𝑚𝑎𝑥 is the
given maximum transmission time in the simulation time units (see: sim2net._time).
class sim2net._channel.Channel(time, packet_loss, node_id, maximum_transmission_time)
Bases: sim2net._channel._Output, sim2net._channel._Input
This class implements bidirectional communication channels for each node in the simulated network.
The class has no members and inherits all its methods from two classes: _Input and _Output.
Application message passing is implemented here as follows. First, a message is sent locally by the _Output.
send_message() method. Then, it is transmitted in a packet to neighboring nodes by the _Output.
transmit_packets() method. If the transmission is successful, the packet leaves the output channel by
calling the _Output.deliver_packet() method and will be transferred to receiving nodes by calling the
_Input.capture_packet() methods. Finally, the message can be received by the application by calling
the _Input.receive_message() method.
Parameters:
• time: a simulation time object of the sim2net._time.Time class;
• packet_loss: an object representing the packet loss model (see sim2net.packet_loss);
• node_id (int): an identifier of the node;
• maximum_transmission_time (float): maximum message transmission time between neighboring
nodes in the simulation time units (see: sim2net._time).
Raises:
• ValueError: raised when the given value of the time or packet_loss parameter is None; or when the
given value of the node_id or maximum_transmission_time parameter is less than zero.
class sim2net._channel._Input(node_id)
Bases: object
This class implements input channels for nodes in the simulated network.
Parameters:
• node_id (int): an identifier of the node for which the input channel is created.
capture_packet(packet)
Captures packets transmitted by neighboring nodes.
Parameters:
• packet (tuple): a packet to capture represented by a tuple that contains the packet’s identifier and
transported application message, which is also a tuple containing an identifier of the sender and
the message.
receive_message()
Returns a received application message.
Returns: None value if there is no message at the current simulation step, or a tuple that contains an
identifier of the sender and the received application message.
class sim2net._channel._Output(time, packet_loss, node_id, maximum_transmission_time)
Bases: object
This class implements output channels for nodes in the simulated network.
3.3. Packages 11
Simple Network Simulator (sim2net) Documentation, Release
Note: Methods transmit_packets() and deliver_packet() are responsible for the transmission
and delivery of packages, so it is presumed that these methods are called at each step of the simulation.
Parameters:
• time: a simulation time object of the sim2net._time.Time class;
• packet_loss: an object representing a packet loss model to use (see sim2net.packet_loss);
• node_id (int): an identifier of the node for which the output channel is created;
• maximum_transmission_time (float): maximum message transmission time between neighboring
nodes in the simulation time units (see: sim2net._time).
Hint:
•It is possible that at one simulation step there will be multiple packets to deliver, so this method should
be called as long until it returns None value.
•This method requires the use of complementary method _Input.capture_packet() of input
channels of all nodes receiving the packet.
send_message(message, neighbors)
Sends an application message.
Parameters:
• message: the application message to send of any type;
• neighbors (list): a list of identifiers of all neighboring nodes of the sender at the current simulation
step.
transmit_packets(neighbors)
Transmits packets to neighboring nodes.
12 Chapter 3. Contents
Simple Network Simulator (sim2net) Documentation, Release
Parameters:
• neighbors (list): a list of identifiers of all neighboring nodes of the sender at the current simulation
step according to the wireless signal propagation model used (see: sim2net.propagation).
Module sim2net._network
This module provides an implementation of the mobile ad hoc network that is to be simulated.
The network is composed of the given number of nodes running the provided simulation application. The main method
of this module, the sim2net._network.Network.step() method, is called at each simulation step and it
advances the simulation by computing node failures, new positions of the nodes, performing direct communication
between neighboring nodes, and executing the simulation application at each node.
Additionally, the sim2net._network._Communication class is implemented, which serves as a communica-
tion interface for the simulated nodes.
class sim2net._network.Network(environment)
Bases: object
This class implements the mobile ad hoc network that is to be simulated.
Parameters:
• environment: a dictionary that contains objects, which form the network environment for simulations
(see sim2net._network.Network.__ENVIRONMENT for the objects list).
_Network__application()
Executes the simulation application at each operative node at the current simulation step.
See also:
sim2net.application
_Network__communication()
Performs packets propagation in the network at the current simulation step.
See also:
sim2net._channel.Channel
_Network__failure()
Computes node failures at the current simulation step.
See also:
sim2net.failure
_Network__move()
Calculates new positions of the simulated nodes at the current simulation step.
See also:
sim2net.mobility
_Network__neighborhood()
Calculates neighboring nodes at the current simulation step.
See also:
sim2net.propagation
communication_receive(node_id)
Receives an application message for the given node.
3.3. Packages 13
Simple Network Simulator (sim2net) Documentation, Release
Parameters:
• node_id (int): an identifier of the receiver.
Returns: None value if there is no message at the current simulation step for the receiver, or a tuple that
contains an identifier of the sender and the received application message.
See also:
sim2net._network._Communication
communication_send(node_id, message)
Sends an application message.
Parameters:
• node_id (int): an identifier of the sender;
• message: the application message to send of any type.
Warning: This method uses the copy.deepcopy() function, and hence may be slow.
See also:
sim2net._network._Communication
finalize()
Calls the sim2net.application.Application.finalize() finalization method at each node
after all simulation steps.
step()
Advances the simulation by one simulation step. This method is called as many times as there is simulation
steps by the sim2net.simulator.Sim2Net.run() method.
This method calls: sim2net._network.Network._Network__failure(),
sim2net._network.Network._Network__move(), sim2net._network.
Network._Network__neighborhood(), sim2net._network.Network.
_Network__communication(), sim2net._network.Network.
_Network__application(), and sim2net._time.Time.tick() methods.
class sim2net._network._Communication(node_id, send_message, receive_message)
Bases: object
This class implements a communication interface for the simulated nodes providing two methods for sending
and receiving application messages.
Parameters:
• node_id (int): an identifier of the node;
• send_message: a sending method in the sim2net._network.Network class;
• receive_message: a receiving method in the sim2net._network.Network class.
receive()
Returns None value if there is no message at the current simulation step, or a tuple that contains an identifier
of the sender and the received application message.
send(message)
Sends an application message.
Parameters:
• message: the application message to send of any type.
14 Chapter 3. Contents
Simple Network Simulator (sim2net) Documentation, Release
Module sim2net.simulator
This module provides an interface to the simulator for the sim2net.cli command-line tool and its main entry point
for conducting simulations.
class sim2net.simulator.Sim2Net(configuration, application_file)
Bases: object
This class is the main entry point for conducting simulations.
Based on the given simulation configuration and application file, the class initializes and runs the simulation.
_Sim2Net__get_application_class(application_file)
_Sim2Net__get_arguments(name, configuration)
_Sim2Net__get_element(name, configuration, environment, number=None)
_Sim2Net__get_value(name, configuration)
_Sim2Net__report_error(element, name)
run()
Package sim2net.area
Package modules:
• Module sim2net.area._area
• Module sim2net.area.rectangle
• Module sim2net.area.square
See also:
sim2net.placement
Module sim2net.area._area
Contains an abstract class that should be implemented by all simulation area classes.
class sim2net.area._area.Area(name)
Bases: object
This class is an abstract class that should be implemented by all simulation area classes.
Parameters:
• name (str): a name of the implemented simulation area.
ORIGIN = (0.0, 0.0)
The origin for simulation areas.
get_area()
Creates a dictionary that stores information about the simulation area.
3.3. Packages 15
Simple Network Simulator (sim2net) Documentation, Release
Module sim2net.area.rectangle
16 Chapter 3. Contents
Simple Network Simulator (sim2net) Documentation, Release
Module sim2net.area.square
Note: In this case, the sim2net.area.rectangle.Rectangle() method is called with the width and
height parameters set to the value of the given side argument.
get_area()
Creates a dictionary that stores information about the simulation area.
Returns: A dictionary that stores information about the simulation area; it has the following fields:
• ‘area name’: a name of the simulation area of type str,
• ‘side’: a side length of the square simulation area of type float.
Package sim2net.failure
3.3. Packages 17
Simple Network Simulator (sim2net) Documentation, Release
eavesdropping (where a process leaks information obtained in its algorithm to an outside entity); and arbitrary
(where a process may deviate in any conceivable way from its algorithm).
Package modules:
• Module sim2net.failure._failure
• Module sim2net.failure.crash
Module sim2net.failure._failure
Contains an abstract class that should be implemented by all process failure model classes.
class sim2net.failure._failure.Failure(name)
Bases: object
This class is an abstract class that should be implemented by all process failure model classes.
Parameters:
• name (str): a name of the implemented process failure model.
logger
(Property) A logger object of the logging.Logger class with an appropriate channel name.
See also:
sim2net.utility.logger
node_failure(failures)
Gives in place information about nodes which processes have failed according to the implemented process
failure model.
Parameters:
• failures (list): a list of boolean values of the size equal to the total number of nodes in the
simulated network; True value in position 𝑖 indicates that the process on node number 𝑖 has
failed.
random_generator
(Property) An object representing the sim2net.utility.randomness._Randomness pseudo-
random number generator.
Module sim2net.failure.crash
18 Chapter 3. Contents
Simple Network Simulator (sim2net) Documentation, Release
Note: It is presumed that the node_failure() method is called at each step of the simulation.
Parameters:
• time: a simulation time object of the sim2net._time.Time class;
• nodes_number (int): the total number of nodes in the simulated network;
• crash_probability (float): the probability that a single process will crash during the total simulation
time;
• maximum_crash_number (int): the maximum number of faulty processes;
• total_simulation_steps (int): the total number of simulation steps;
• transient_steps (int): a number of steps at the beginning of the simulation during which no crashes
occur (default: 0).
Raises:
• ValueError: raised when the given value of the time object is None; or when the given number of
nodes is less than or equal to zero; or when the given crash probability is less than zero or grater than
one; or when the given value of the maximum number of faulty processes or the given value of the
total simulation steps is less than zero; or when the number of steps in the transient period is less than
zero or greater than the given value of the total simulation steps.
3.3. Packages 19
Simple Network Simulator (sim2net) Documentation, Release
Examples:
In order to avoid any process failures use this class with the crash_probability and/or maxi-
mum_crash_number parameters set to 0, as in the examples below.
Package sim2net.mobility
Package modules:
• Module sim2net.mobility._mobility
20 Chapter 3. Contents
Simple Network Simulator (sim2net) Documentation, Release
• Module sim2net.mobility.gauss_markov
• Module sim2net.mobility.nomadic_community
• Module sim2net.mobility.random_direction
• Module sim2net.mobility.random_waypont
Module sim2net.mobility._mobility
Contains an abstract class that should be implemented by all mobility model classes.
class sim2net.mobility._mobility.Mobility(name)
Bases: object
This class is an abstract class that should be implemented by all mobility model classes.
Parameters:
• name (str): a name of the implemented mobility model.
get_current_position(node_id, node_speed, node_coordinates)
Calculates and returns a node’s position at the current simulation step in accordance with the implemented
mobility model. It is assumed that this method is called at each step of the simulation.
Parameters:
• node_id (int): an identifier of the node;
• node_speed: an object representing the node’s speed;
• node_coordinates (list): values of the node’s horizontal and vertical coordinates at the previous
simulation step.
Returns: A tuple containing current values of the node’s horizontal and vertical coordinates.
Raises:
• NotImplementedError: this method is an abstract method.
logger
(Property) A logger object of the logging.Logger class with an appropriate channel name.
See also:
sim2net.utility.logger
random_generator
(Property) An object representing the sim2net.utility.randomness._Randomness pseudo-
random number generator.
Module sim2net.mobility.gauss_markov
3.3. Packages 21
Simple Network Simulator (sim2net) Documentation, Release
√︀
• 𝑑𝑛 = 𝛼 × 𝑑𝑛−1 + (1 − 𝛼) × 𝑑 + (1 − 𝛼2 ) × 𝑑𝑥 ;
where:
• 0 6 𝛼 6 1 is a tuning parameter used to vary the randomness;
• 𝑣 is constant representing the mean value of speed;
• 𝑑 is constant representing the mean value of direction;
• 𝑣𝑥 and 𝑑𝑥 are random variables from a normal (Gaussian) distribution.
Consequently, at time interval 𝑛, node’s horizontal (𝑥) and vertical (𝑦) coordinates in the simulation area are given by
the following equations:
• 𝑥𝑛 = 𝑥𝑛−1 + 𝑣𝑛−1 × cos 𝑑𝑛−1 ;
• 𝑦𝑛 = 𝑦𝑛−1 + 𝑣𝑛−1 × sin 𝑑𝑛−1 .
It is worth to note that when 𝛼 is equal to 1, movement becomes predictable, losing all randomness. On the other
hand, if 𝛼 is equal to 0, the model becomes memoryless: the new speed and direction are based completely upon the
mean speed and direction constants (𝑣 and 𝑑) and the Gaussian random variables (𝑣𝑥 and 𝑑𝑥 ).
class sim2net.mobility.gauss_markov.GaussMarkov(area, time, initial_coordinates, ini-
tial_speed, **kwargs)
Bases: sim2net.mobility._mobility.Mobility
This class implements the Gauss-Markov mobility model, in which motion of each node is modelled in the form
of a Gauss-Markov stochastic process.
Note:
•Due to the characteristics of this model, it is expected that each node has assigned the normal speed
distribution (see: sim2net.speed.normal) – the speed is used as random variable 𝑣𝑥 when a new
speed is calculated.
•All direction values used in this implementation are expressed in radians.
•The get_current_position() method computes a position of a node at the current simulation step
(see: sim2net._time), so it is presumed that the method is called at each step of the simulation.
Parameters:
• area: an object representing the simulation area;
• time: a simulation time object of the sim2net._time.Time class;
• initial_coordinates (list): initial coordinates of all nodes; each element of this parameter should be a
tuple of two coordinates: horizontal and vertical (respectively) of type float;
• initial_speed (float): a value of the initial speed that is assigned to each node at the beginning of the
simulation;
• kwargs (dict): a dictionary of (optional) keyword parameters related to the Gauss-Markov mobility
model; the following parameters are accepted:
alpha (float) The tuning parameter 0 6 𝛼 6 1 used to vary the randomness of movements (default:
0.75).
direction_deviation (float) Constant representing the standard deviation of direction random vari-
able 𝑑𝑥 (it defaults to 𝜋2 ).
22 Chapter 3. Contents
Simple Network Simulator (sim2net) Documentation, Release
direction_margin (float) Constant used to change direction mean 𝑑 to ensure that nodes do not
remain near a border of the simulation area for a long period of time (it defaults to 0.15, or
15% of the simulation area width/height, and cannot be less than zero and greater than one; see:
_GaussMarkov__velocity_recalculation()).
direction_mean (float) Constant representing mean value 𝑑 of direction (it defaults to 𝜋6 ). The same
value is used as mean of direction random variable 𝑑𝑥 .
recalculation_interval (int) Velocity (i.e. speed and direction) recalculation time interval (it defaults
to the simulation frequency; see: sim2net._time). It determines how often, counting in
simulation steps, new values of velocity are recalculated.
Raises:
• ValueError: raised when the given value of the area, time, initial_coordinates or initial_speed pa-
rameter is None; or when the given value of the keyword parameter alpha is less than zero or greater
that one; or when the given value of the (optional) keyword parameter direction_margin is less than
zero or greater than one.
Example:
_GaussMarkov__get_new_direction()
Randomizes a new direction with the normal (Gaussian) distribution.
Returns: (float) a newly randomized direction value.
_GaussMarkov__step_move(node_id, node_coordinates)
Computes a node’s position at the current simulation step.
Parameters:
• node_id (int): an identifier of the node;
• node_coordinates (list): values of the node’s horizontal and vertical coordinates at the previous
simulation step.
Returns: (tuple) current values of the node’s horizontal and vertical coordinates.
_GaussMarkov__velocity_recalculation(node_id, node_speed, node_coordinates)
Recalculates a node’s velocity, i.e. its speed and direction, as a Gauss-Markov stochastic process.
To ensure that a node does not remain near a border of the simulation area for a long period of time, the
node is forced away from the border when it moves within certain distance of the edge. This is done by
modifying mean direction 𝑑. For example, when a node is near the right border of the simulation area, the
value of 𝑑 changes to 180 degrees (𝜋). The distance that is used in this method is calculated as a product
of the direction margin and area width or height.
Parameters:
• node_id (int): an identifier of the node;
• node_speed: an object representing the node’s speed;
• node_coordinates (list): values of the node’s horizontal and vertical coordinates at the previous
simulation step.
get_current_position(node_id, node_speed, node_coordinates)
Calculates and returns a node’s position at the current simulation step in accordance with the Gauss-
Markov mobility model.
3.3. Packages 23
Simple Network Simulator (sim2net) Documentation, Release
A distance of the route traveled by the node, between the current and previous simulation steps, is cal-
culated as the product of the current node’s speed and the simulation period (see: sim2net._time
module). Therefore, it is assumed that this method is called at every simulation step.
Parameters:
• node_id (int): an identifier of the node;
• node_speed: an object representing the node’s speed;
• node_coordinates (list): values of the node’s horizontal and vertical coordinates at the previous
simulation step.
Returns: A tuple containing current values of the node’s horizontal and vertical coordinates.
Module sim2net.mobility.nomadic_community
Note: The get_current_position() method computes a position of a node at the current simulation
step (see: sim2net._time), so it is presumed that the method is called at each step of the simulation.
Parameters:
• area: an object representing the simulation area;
• time: a simulation time object of the sim2net._time.Time class;
• initial_coordinates (list): initial coordinates of all nodes; each element of this parameter should be a
tuple of two coordinates: horizontal and vertical (respectively) of type float;
• pause_time (float): a maximum value of the pause time in the simulation time units (default: 0.0, see
also: sim2net._time);
24 Chapter 3. Contents
Simple Network Simulator (sim2net) Documentation, Release
• area_factor (float): a factor used to determine the width and height of the free roam area around the
reference point (default: 0.25).
Raises:
• ValueError: raised when the given value of the area, time or initial_coordinates parameter is None;
or when the given value of the pause_time parameter is less that zero; or when the given value of the
area_factor parameter is less than zero or greater than one.
(At the beginning, nodes’ destination points are set to be equal to its initial coordinates passed by the ini-
tial_coordinates parameter.)
_NomadicCommunity__get_free_roam_area_edges(reference_point)
Computes boundaries of a free roam area around a given reference point.
Parameter:
• reference_point (tuple) containing horizontal and vertical coordinates (respectively) of the refer-
ence point.
Returns: A tuple containing values of the top, right, bottom and left boundaries (respectively) in the
simulation area.
_NomadicCommunity__get_new_reference_point()
Uniformly randomizes new coordinates of the reference point. The vertical and horizontal coordinates are
returned (respectively) as a tuple.
_NomadicCommunity__get_new_relocation_time()
Randomizes and returns a new relocation time of type float, after which coordinates of the reference point
will be changed.
_NomadicCommunity__reference_point_relocation()
Relocates the reference point by picking its new coordinates. The relocation takes place only if all nodes
are within the current area of free roam and the relocation time has expired. Otherwise, the current coor-
dinates of the reference point are preserved.
_get_new_destination()
Uniformly randomizes a new waypoint within the range of free roam and returns its coordinates as a tuple.
get_current_position(node_id, node_speed, node_coordinates)
Calculates and returns a node’s position at the current simulation step in accordance with the Nomadic
Community mobility model (and Random Waypoint model within the area of free roam).
A distance of the route traveled by the node, between the current and previous simulation steps, is cal-
culated as the product of the current node’s speed and the simulation period (see: sim2net._time
module). Therefore, it is assumed that this method is called at every simulation step.
Parameters:
• node_id (int): an identifier of the node;
• node_speed: an object representing the node’s speed;
• node_coordinates (list): values of the node’s horizontal and vertical coordinates at the previous
simulation step.
Returns: A tuple containing current values of the node’s horizontal and vertical coordinates.
Module sim2net.mobility.random_direction
3.3. Packages 25
Simple Network Simulator (sim2net) Documentation, Release
At the beginning of the simulation, with the use of the Random Direction mobility model ([RMM01]), a node first
stops for some random pause time, and then randomly selects a direction in which to move. The direction is measured
in degrees, and at first, the node selects a degree between 0 and 359. Next, it finds a destination point on the boundary
of the simulation area in this direction of travel and moves with a constant, but randomly selected (between the
minimum and maximum values), speed to its destination. Once it reaches the destination, it pauses, and then selects
a new direction between 0 and 180 degree (the degree is limited because the node is already on the boundary of the
simulation area). The node then identifies the destination on the boundary in this line of direction, selects a new speed,
and resumes travel. The whole process is repeated again and again until simulation ends. The speed and destination
of each node are chosen independently of other nodes.
class sim2net.mobility.random_direction.RandomDirection(area, time, ini-
tial_coordinates,
pause_time=0.0)
Bases: sim2net.mobility.random_waypoint.RandomWaypoint, sim2net.mobility.
_mobility.Mobility
This class implements the Random Direction mobility model, in which each node moves along straight lines
from one destination point, on the boundary of the simulation area, to another.
The nodes may also have pause times when they reach their destination points, and their speeds are selected at
random between the minimum and maximum speed values. (All random picks are uniformly distributed).
Note: The get_current_position() method computes a position of a node at the current simulation
step (see: sim2net._time), so it is presumed that the method is called at each step of the simulation.
See also:
sim2net.mobility.random_waypoint
Parameters:
• area: an object representing the simulation area;
• time: a simulation time object of the sim2net._time.Time class;
• initial_coordinates (list): initial coordinates of all nodes; each element of this parameter should be a
tuple of two coordinates: horizontal and vertical (respectively) of type float;
• pause_time (float): a maximum value of the pause time in the simulation time units (default: 0.0, see
also: sim2net._time).
Raises:
• ValueError: raised when the given value of the area, time or initial_coordinates parameter is None
or when the given value of the pause_time parameter is less that zero.
(At the beginning, nodes’ destination points are set to be equal to its initial coordinates passed by the ini-
tial_coordinates parameter.)
_get_new_destination()
Randomizes a new destination point on the boundary of the simulation area and returns its coordinates as
a tuple.
Module sim2net.mobility.random_waypont
26 Chapter 3. Contents
Simple Network Simulator (sim2net) Documentation, Release
In this model ([JM96], [BMJ+98]), a node first stops for some random pause time. Then, the node randomly picks
a point within the simulation area and starts moving toward it with a constant, but randomly selected, speed that
is uniformly distributed between the minimum and maximum speed values. Upon reaching the destination point (or
waypoint), the node pauses again and then moves toward a newly randomized point. (If the pause time is equal to zero,
this leads to continuous mobility.) The whole process is repeated again and again until simulation ends. The speed
and destination of each node are chosen independently of other nodes.
class sim2net.mobility.random_waypoint.RandomWaypoint(area, time, initial_coordinates,
pause_time=0.0)
Bases: sim2net.mobility._mobility.Mobility
This class implements the Random Waypoint mobility model, in which each node moves along straight lines
from one waypoint to another.
The waypoints are randomly picked within the simulation area. The nodes may also have pause times when they
reach waypoints, and their speeds are selected at random between the minimum and maximum speed values. (All
random picks are uniformly distributed).
Note: The get_current_position() method computes a position of a node at the current simulation
step (see: sim2net._time), so it is presumed that the method is called at each step of the simulation.
Parameters:
• area: an object representing the simulation area;
• time: a simulation time object of the sim2net._time.Time class;
• initial_coordinates (list): initial coordinates of all nodes; each element of this parameter should be a
tuple of two coordinates: horizontal and vertical (respectively) of type float;
• pause_time (float): a maximum value of the pause time in the simulation time units (default: 0.0, see
also: sim2net._time).
Raises:
• ValueError: raised when the given value of the area, time or initial_coordinates parameter is None
or when the given value of the pause_time parameter is less that zero.
(At the beginning, nodes’ destination points are set to be equal to its initial coordinates passed by the ini-
tial_coordinates parameter.)
_assign_new_destination(node_id, node_speed)
Assigns a new destination point for a node of a given ID and picks its new speed value. (See also:
_get_new_destination())
Parameters:
• node_id (int): an identifier of the node;
• node_speed: an object representing the node’s speed.
_assign_new_pause_time(node_id)
Assigns a new pause time for a node of a given ID and returns the value. If the maximum pause time is set
to 0, None value is assigned and returned.
Parameters:
• node_id (int): an identifier of the node.
Returns: (float) a newly randomized pause time.
3.3. Packages 27
Simple Network Simulator (sim2net) Documentation, Release
28 Chapter 3. Contents
Simple Network Simulator (sim2net) Documentation, Release
Package sim2net.packet_loss
Package modules:
• Module sim2net.packet_loss._packet_loss
• Module sim2net.packet_loss.gilbert_elliott
See also:
sim2net.propagation
Module sim2net.packet_loss._packet_loss
Contains an abstract class that should be implemented by all packet loss model classes.
class sim2net.packet_loss._packet_loss.PacketLoss(name)
Bases: object
This class is an abstract class that should be implemented by all packet loss model classes.
Parameters:
• name (str): a name of the implemented placement model.
logger
(Property) A logger object of the logging.Logger class with an appropriate channel name.
See also:
sim2net.utility.logger
3.3. Packages 29
Simple Network Simulator (sim2net) Documentation, Release
packet_loss()
Returns information about whether a transmitted packet has been lost or can be successfully received by
destination nodes according to the implemented packet loss model.
Returns: (bool) True if the packet has been lost, or False otherwise.
Raises:
• NotImplementedError: this method is an abstract method.
random_generator
(Property) An object representing the sim2net.utility.randomness._Randomness pseudo-
random number generator.
Module sim2net.packet_loss.gilbert_elliott
+-------+ p +-------+ { }
+----| |------------>| |<---+ { 1-p p }
1-p | | G | | B | | 1-r A = { }
| | (1-k) | | (1-h) | | { r 1-r }
+--->| |<------------| |----+ { }
+-------+ r +-------+
𝑟 𝑝
Then, error rate 𝑝𝐸 is obtained (in steady mode) for the model as follows: 𝑝𝐸 = (1 − 𝑘) × 𝑝+𝑟 + (1 − ℎ) × 𝑝+𝑟
(assuming: 0 < 𝑝, 𝑟 < 1).
It is worth to note that when 𝑞 = 1 − 𝑝 (and 𝑘 = 1, ℎ = 0), this model reduces to the Bernoulli model – a very simple
loss model, characterized by a single parameter, the loss rate 𝑟, used for modeling packet loss.
Finally, 𝑝 equal to 0 means that no losses are possible, whereas 𝑟 equal to 0 means that no transmission is successful
(once the B state is reached).
class sim2net.packet_loss.gilbert_elliott.GilbertElliott(prhk=None)
Bases: sim2net.packet_loss._packet_loss.PacketLoss
This class implements the Gilbert-Elliott packet loss model.
Parameters:
• prhk (tuple): a tuple that contains four model parameters: 0 6 𝑝, 𝑟, ℎ, 𝑘 6 1, respectively (each of
type float). The parameters default to the following values:
– 𝑝 = 0.00001333,
– 𝑟 = 0.00601795,
– ℎ = 0.55494900,
– 𝑘 = 0.99999900;
(which leads to error rate equal to 0.098% and the mean packet loss rate equal to 0.1% ([HH08])).
Raises:
• ValueError: raised when the given value any model parameter is less than zero or greater that one.
30 Chapter 3. Contents
Simple Network Simulator (sim2net) Documentation, Release
Package sim2net.placement
Package modules:
• Module sim2net.placement._placement
• Module sim2net.placement.grid
• Module sim2net.placement.normal
• Module placement.uniform
See also:
sim2net.area
Module sim2net.placement._placement
3.3. Packages 31
Simple Network Simulator (sim2net) Documentation, Release
same horizontal and vertical coordinates. Otherwise, checks if there is a point that has the same coordinates
as these at the index position.
Parameters:
• horizontal_coordinates (list): a list of horizontal coordinates;
• vertical_coordinates (list): a list of vertical coordinates;
• index (int): an index of the coordinate lists; if greater than -1, it is checked whether there is a
point with the same horizontal and vertical coordinates as at index.
Returns: (int) an index of the coordinate that is in conflict, or -1 if the given coordinates are unique.
Raises:
• ValueError: if given coordinate lists have different lengths, or if a given value of the index
parameter is greater than the total number of coordinates.
Examples:
random_generator
(Property) An object representing the sim2net.utility.randomness._Randomness pseudo-
random number generator.
Module sim2net.placement.grid
32 Chapter 3. Contents
Simple Network Simulator (sim2net) Documentation, Release
If both shapes are rectangular, the longer side of the grid is placed along the longer size of the simulation
area.
Parameters:
• columns (int): a number of grid columns;
• rows (int): a number of grid rows.
Returns: A number of grid columns and rows as a tuple.
_Grid__get_grid_dimensions()
Calculates dimensions of the grid based on the number of nodes. If the number has a square root, the grid
shape will be a square, otherwise it will be a rectangular. In the worst case if the number of nodes is prime,
the number of rows (or columns) will be equal to one.
Returns: A number of grid columns and rows as a tuple.
_Grid__get_horizontal_coordinates(columns, rows, distance)
Generates horizontal coordinates of nodes based on the number of columns, rows and the distance between
nodes.
Returns: A list of horizontal coordinates.
_Grid__get_nodes_distance(columns, rows)
Calculates a distance between nodes in the same row and column based on the their transmission ranges.
The distance is also adjust to fit the dimensions of the simulation area.
Returns: A distance between nodes in the grid of type float.
_Grid__get_vertical_coordinates(columns, rows, distance)
Generates vertical coordinates of nodes based on the number of columns, rows and the distance between
nodes.
Returns: A list of vertical coordinates.
get_placement()
Generates grid placement coordinates for the given number of nodes and its transmission ranges and returns
the result as a dictionary.
Returns: A list of tuples of horizontal and vertical coordinates for each host.
Module sim2net.placement.normal
3.3. Packages 33
Simple Network Simulator (sim2net) Documentation, Release
• ValueError: raised when the number of nodes is less or equal to 0, or when the given value of the
area parameter is None.
get_placement()
Generates normal (Gaussian) placement coordinates for the given number of nodes and returns the result
as a dictionary.
1 1
The means used here are computed as follows: 2 × 𝑎𝑟𝑒𝑎 𝑤𝑖𝑑𝑡ℎ and 2 × 𝑎𝑟𝑒𝑎 ℎ𝑒𝑖𝑔ℎ𝑡.
Returns: A list of tuples of horizontal and vertical coordinates for each host.
Module placement.uniform
Package sim2net.propagation
Package modules:
• Module sim2net.propagation._propagation
• Module sim2net.propagation.path_loss
34 Chapter 3. Contents
Simple Network Simulator (sim2net) Documentation, Release
See also:
sim2net.packet_loss
Module sim2net.propagation._propagation
Contains an abstract class that should be implemented by all wireless signal propagation model classes.
class sim2net.propagation._propagation.Propagation(name)
Bases: object
This class is an abstract class that should be implemented by all wireless signal propagation model classes.
Parameters:
• name (str): a name of the implemented placement model.
get_neighbors(coordinates)
Calculates identifiers of all nodes in a network that would be able to receive a wireless signal transmitted
from a source node, according to the implemented propagation model. All nodes in the network are
considered, one by one, as the source node.
Parameters:
• coordinates (list): a list of coordinates of all nodes in the simulated network at the current simu-
lation step.
Returns: A list that in position i is a list of all nodes that would be able to receive a wireless signal
transmitted by a node whose identifier is equal to i.
Raises:
• NotImplementedError: this method is an abstract method.
logger
(Property) A logger object of the logging.Logger class with an appropriate channel name.
See also:
sim2net.utility.logger
random_generator
(Property) An object representing the sim2net.utility.randomness._Randomness pseudo-
random number generator.
Module sim2net.propagation.path_loss
3.3. Packages 35
Simple Network Simulator (sim2net) Documentation, Release
• transmission_range (float): a value of the transmission (or communication) radius of nodes, that is,
the distance from a transmitter at which the signal strength remains above the minimum usable level.
Raises:
• ValueError: raised when the given transmission range is less or equal to 0.
_PathLoss__distance(source_coordinates, destination_coordinates)
Calculates the distance between source and destination nodes in Cartesian space.
Parameters:
• source_coordinates (list): values of the source node’s horizontal and vertical coordinates at the
current simulation step;
• destination_coordinates (list): values of the destination node’s horizontal and vertical coordi-
nates at the current simulation step.
Returns: The distance between source and destination nodes in Cartesian space of type float.
get_neighbors(coordinates)
Calculates identifiers of all nodes in a network that would be able to receive a wireless signal transmitted
from a source node, according to the implemented propagation model. All nodes in the network are
considered, one by one, as the source node.
Parameters:
• coordinates (list): a list of coordinates of all nodes in the simulated network at the current simu-
lation step.
Returns: A list that in position i is a list of all nodes that would be able to receive a wireless signal
transmitted by a node whose identifier is equal to i.
Examples:
>>> pathloss = PathLoss(1.0)
>>> coordinates = [[1.0, 2.0], [1.5, 2.5], [2.0, 3.0], [2.5, 3.5]]
>>> print pathloss.get_neighbors(coordinates)
[[1], [0, 2], [1, 3], [2]]
>>> coordinates = [[1.0, 2.0], [1.1, 2.1], [1.2, 2.2], [1.3, 2.3]]
>>> print pathloss.get_neighbors(coordinates)
[[1, 2, 3], [0, 2, 3], [0, 1, 3], [0, 1, 2]]
Package sim2net.speed
Note: In all speed distribution classes the quantity of speed should be considered as simulation area units per one
simulation time unit (see: sim2net._time).
For example, the value of speed equal to 5 would mean five units of simulation area per one unit of simulation time.
Package modules:
• Module sim2net.speed._speed
36 Chapter 3. Contents
Simple Network Simulator (sim2net) Documentation, Release
• Module sim2net.speed.constant
• Module sim2net.speed.normal
• Module sim2net.speed.uniform
See also:
sim2net.placement, sim2net._time
Module sim2net.speed._speed
Contains an abstract class that should be implemented by all speed distribution classes.
class sim2net.speed._speed.Speed(name)
Bases: object
This class is an abstract class that should be implemented by all speed distribution classes.
Parameters:
• name (str): a name of the implemented speed distribution.
current
(Property) A value of the current speed of type float.
Raises:
• NotImplementedError: this property is an abstract property.
get_new()
Assigns a new speed value.
Returns: (float) a new speed value.
Raises:
• NotImplementedError: this method is an abstract method.
logger
(Property) A logger object of the logging.Logger class with an appropriate channel name.
See also:
sim2net.utility.logger
random_generator
(Property) An object representing the sim2net.utility.randomness._Randomness pseudo-
random number generator.
Module sim2net.speed.constant
Provides an implementation of a constant node speed. In this case a speed of a node is constant at a given value.
class sim2net.speed.constant.Constant(speed)
Bases: sim2net.speed._speed.Speed
This class implements a constant node speed fixed at a given value.
Parameters:
• speed (float): a value of the node speed.
3.3. Packages 37
Simple Network Simulator (sim2net) Documentation, Release
Example:
current
(Property) The absolute value of the current speed of type float.
get_new()
Returns the absolute value of the given node speed of type float.
Module sim2net.speed.normal
Provides an implementation of the normal speed distribution. In this case a speed of a node is assigned at random with
the normal, i.e. Gaussian, probability distribution.
class sim2net.speed.normal.Normal(mean=0.0, standard_deviation=0.2)
Bases: sim2net.speed._speed.Speed
This class implements the normal speed distribution that assigns node’s speeds with the Gaussian probability
distribution.
(Defaults to standard normal distribution.)
Parameters:
• mean (float): a value of the expectation (default: 0.0);
• standard_deviation (float): a value of the standard deviation (default: 0.2).
current
(Property) A value of the current speed of type float (or None if the value has yet not been assigned).
get_new()
Assigns a new speed value.
mean
(Property) A value of the expectation of type float.
Module sim2net.speed.uniform
Provides an implementation of the uniform speed distribution. In this case a speed of a node is assigned at random
with the uniform probability distribution.
38 Chapter 3. Contents
Simple Network Simulator (sim2net) Documentation, Release
Package sim2net.utility
Package modules:
• Module sim2net.utility.logger
• Module sim2net.utility.randomness
• Module sim2net.utility.validation
Module sim2net.utility.logger
Provides functions which implement an event logging system with the use of the logging module from the standard
library.
class sim2net.utility.logger.Sim2NetFormatter(time=None)
Bases: logging.Formatter
Implements a custom logging.Formatter that can also log simulation steps and time (see: sim2net.
_time).
Parameters:
• time: a simulation time object of the sim2net._time.Time class to log simulation steps and
time.
format(record)
Formats the specified record as text and adds the current simulations step and time if the time object is
present.
sim2net.utility.logger.__channel_string(channel)
Returns a logging channel string for a given string.
3.3. Packages 39
Simple Network Simulator (sim2net) Documentation, Release
Module sim2net.utility.randomness
40 Chapter 3. Contents
Simple Network Simulator (sim2net) Documentation, Release
set_state(generator_state)
Sets a new internal state of the generator.
The state can be obtained from a call to get_state() method.
Parameters:
• generator_state: an internal state of the generator to set.
Raises:
• ValueError: raised when a given value of the generator_state parameter is None.
uniform(begin, end)
Returns a random floating point number 𝑁 such that 𝑏𝑒𝑔𝑖𝑛 6 𝑁 6 𝑒𝑛𝑑 for 𝑏𝑒𝑔𝑖𝑛 6 𝑒𝑛𝑑 and 𝑒𝑛𝑑 6 𝑁 6
𝑏𝑒𝑔𝑖𝑛 for 𝑒𝑛𝑑 < 𝑏𝑒𝑔𝑖𝑛.
sim2net.utility.randomness.get_random_generator()
Returns an object representing the _Randomness pseudo-random number generator. Multiple calls to this
function will return the same object.
Module sim2net.utility.validation
3.3. Packages 41
Simple Network Simulator (sim2net) Documentation, Release
42 Chapter 3. Contents
CHAPTER 4
• genindex
• modindex
• search
43
Simple Network Simulator (sim2net) Documentation, Release
Links
Repository https://github.com/mkalewski/sim2net
Bug reports https://github.com/mkalewski/sim2net/issues
Documentation https://sim2net.readthedocs.org/en/latest/
45
Simple Network Simulator (sim2net) Documentation, Release
46 Chapter 5. Links
CHAPTER 6
Copyright
47
Simple Network Simulator (sim2net) Documentation, Release
48 Chapter 6. Copyright
Bibliography
[CGR11] Christian Cachin, Rachid Guerraoui, Luís Rodrigues. Introduction to Reliable and Secure Distributed Pro-
gramming, 2ed Edition. Springer-Verlag, 2011.
[LNR04] Guolong Lin, Guevara Noubir, Rajmohan Rajamaran. Mobility Models for Ad-Hoc Network Simulation. In
Proceedings of the 23rd Conference of the IEEE Communications Society (INFOCOM 2004), pp. 463-473. Hong
Kong, March 2004.
[CBD02] Tracy Camp, Jeff Boleng, Vanessa Davies. A Survey of Mobility Models for Ad-Hoc Network Research.
In Wireless Communications Mobile Computing. Special Issue on Mobile Ad Hoc Networking: Research, Trends
and Applications, vol. 2(5), 483–502. John Wiley & Sons, 2002.
[LH99] Ben Liang, Zygmunt J. Haas. Predictive Distance-Based Mobility Management for PCS Networks. In Pro-
ceedings of the 18th Annual Joint Conference of the IEEE Computer and Communications Societies (INFOCOM
1999), pp. 1377–1384, vol. 3. New York, NY, United States, March 1999.
[RMM01] Elizabeth M. Royer, P. Michael Melliar-Smithy, Louise E. Moser. An Analysis of the Optimum Node
Density for Ad Hoc Mobile Networks. In Proceedings of the IEEE International Conference on Communications
(ICC 2001), pp. 857–861, vol. 3. Helsinki, Finland, June 2001.
[JM96] David B. Johnson and David A. Maltz. Dynamic Source Routing in Ad Hoc Wireless Networks. In Mobile
Computing, edited by Tomasz Imielinski and Hank Korth, chapter 5, pp. 153–181. Kluwer Academic Publishers,
1996.
[BMJ+98] Josh Broch, David A. Maltz, David B. Johnson, Yih-Chun Hu, Jorjeta Jetcheva. A Performance Compar-
ison of Multi-hop Wireless Ad Hoc Network Routing Protocols. In Proceedings of the 4th Annual ACM/IEEE
International Conference on Mobile Computing and Networking (MobiCom 1998), pp. 85–97. Dallas, Texas,
United States, October 1998.
[Ell63] E. O. Elliott. Estimates of Error Rates for Codes on Burst-Noise Channels. In Bell System Technical Journal,
vol. 42(5), 1977–1997. Bell Laboratories, September 1963.
[Gil60] Edgar Nelson Gilbert. Capacity of a Burst-Noise Channel. In Bell System Technical Journal, vol. 39(5), 1253–
1265. Bell Laboratories, September 1960.
[HH08] Gerhard Haßlinger, Oliver Hohlfeld. The Gilbert-Elliott Model for Packet Loss in Real Time Services on the
Internet. In Proceedings of the 14th GI/ITG Conference on Measurement, Modelling and Evaluation of Computer
and Communication Systems (MMB 2008), pp. 269–286. Dortmund, Germany, April 2008.
49
Simple Network Simulator (sim2net) Documentation, Release
50 Bibliography
Python Module Index
s sim2net.utility, 39
sim2net, 8 sim2net.utility.logger, 39
sim2net._channel, 10 sim2net.utility.randomness, 40
sim2net._network, 13 sim2net.utility.validation, 41
sim2net._time, 9
sim2net._version, 9
sim2net.application, 8
sim2net.area, 15
sim2net.area._area, 15
sim2net.area.rectangle, 16
sim2net.area.square, 17
sim2net.cli, 7
sim2net.cli.cli, 7
sim2net.failure, 17
sim2net.failure._failure, 18
sim2net.failure.crash, 18
sim2net.mobility, 20
sim2net.mobility._mobility, 21
sim2net.mobility.gauss_markov, 21
sim2net.mobility.nomadic_community, 24
sim2net.mobility.random_direction, 25
sim2net.mobility.random_waypoint, 26
sim2net.packet_loss, 29
sim2net.packet_loss._packet_loss, 29
sim2net.packet_loss.gilbert_elliott, 30
sim2net.placement, 31
sim2net.placement._placement, 31
sim2net.placement.grid, 32
sim2net.placement.normal, 33
sim2net.placement.uniform, 34
sim2net.propagation, 34
sim2net.propagation._propagation, 35
sim2net.propagation.path_loss, 35
sim2net.simulator, 15
sim2net.speed, 36
sim2net.speed._speed, 37
sim2net.speed.constant, 37
sim2net.speed.normal, 38
sim2net.speed.uniform, 38
51
Simple Network Simulator (sim2net) Documentation, Release
Symbols method), 25
_Communication (class in sim2net._network), 14 _NomadicCommunity__get_new_relocation_time()
_Crash__crashes() (sim2net.failure.crash.Crash method), (sim2net.mobility.nomadic_community.NomadicCommunity
19 method), 25
_GaussMarkov__get_new_direction() _NomadicCommunity__reference_point_relocation()
(sim2net.mobility.gauss_markov.GaussMarkov (sim2net.mobility.nomadic_community.NomadicCommunity
method), 23 method), 25
_GaussMarkov__step_move() _Output (class in sim2net._channel), 11
(sim2net.mobility.gauss_markov.GaussMarkov _Output__get_transmission_neighbors()
method), 23 (sim2net._channel._Output method), 12
_GaussMarkov__velocity_recalculation() _PathLoss__distance() (sim2net.propagation.path_loss.PathLoss
(sim2net.mobility.gauss_markov.GaussMarkov method), 36
method), 23 _Randomness (class in sim2net.utility.randomness), 40
_Grid__adjust_grid_dimensions() _Sim2Net__get_application_class()
(sim2net.placement.grid.Grid method), 32 (sim2net.simulator.Sim2Net method), 15
_Grid__get_grid_dimensions() _Sim2Net__get_arguments()
(sim2net.placement.grid.Grid method), 33 (sim2net.simulator.Sim2Net method), 15
_Grid__get_horizontal_coordinates() _Sim2Net__get_element() (sim2net.simulator.Sim2Net
(sim2net.placement.grid.Grid method), 33 method), 15
_Grid__get_nodes_distance() _Sim2Net__get_value() (sim2net.simulator.Sim2Net
(sim2net.placement.grid.Grid method), 33 method), 15
_Grid__get_vertical_coordinates() _Sim2Net__report_error() (sim2net.simulator.Sim2Net
(sim2net.placement.grid.Grid method), 33 method), 15
_Input (class in sim2net._channel), 11 __channel_string() (in module sim2net.utility.logger), 39
_Network__application() (sim2net._network.Network _assign_new_destination()
method), 13 (sim2net.mobility.random_waypoint.RandomWaypoint
_Network__communication() method), 27
(sim2net._network.Network method), 13 _assign_new_pause_time()
_Network__failure() (sim2net._network.Network (sim2net.mobility.random_waypoint.RandomWaypoint
method), 13 method), 27
_Network__move() (sim2net._network.Network _diagonal_trajectory() (sim2net.mobility.random_waypoint.RandomWaypoi
method), 13 method), 27
_Network__neighborhood() (sim2net._network.Network _get_new_destination() (sim2net.mobility.nomadic_community.NomadicCo
method), 13 method), 25
_NomadicCommunity__get_free_roam_area_edges() _get_new_destination() (sim2net.mobility.random_direction.RandomDirecti
(sim2net.mobility.nomadic_community.NomadicCommunity method), 26
method), 25 _get_new_destination() (sim2net.mobility.random_waypoint.RandomWaypo
_NomadicCommunity__get_new_reference_point() method), 28
_get_new_pause_time()
(sim2net.mobility.nomadic_community.NomadicCommunity (sim2net.mobility.random_waypoint.RandomWayp
method), 28
53
Simple Network Simulator (sim2net) Documentation, Release
_parallel_trajectory() (sim2net.mobility.random_waypoint.RandomWaypoint
get_logger() (in module sim2net.utility.logger), 40
method), 28 get_neighbors() (sim2net.propagation._propagation.Propagation
_pause() (sim2net.mobility.random_waypoint.RandomWaypoint method), 35
method), 28 get_neighbors() (sim2net.propagation.path_loss.PathLoss
_step_move() (sim2net.mobility.random_waypoint.RandomWaypoint method), 36
method), 28 get_new() (sim2net.speed._speed.Speed method), 37
get_new() (sim2net.speed.constant.Constant method), 38
A get_new() (sim2net.speed.normal.Normal method), 38
Application (class in sim2net.application), 8 get_new() (sim2net.speed.uniform.Uniform method), 39
Area (class in sim2net.area._area), 15 get_placement() (sim2net.placement._placement.Placement
method), 31
C get_placement() (sim2net.placement.grid.Grid method),
capture_packet() (sim2net._channel._Input method), 11 33
Channel (class in sim2net._channel), 11 get_placement() (sim2net.placement.normal.Normal
check_argument_type() (in module method), 34
sim2net.utility.validation), 41 get_placement() (sim2net.placement.uniform.Uniform
communication_receive() (sim2net._network.Network method), 34
method), 13 get_random_generator() (in module
communication_send() (sim2net._network.Network sim2net.utility.randomness), 41
method), 14 get_state() (sim2net.utility.randomness._Randomness
Constant (class in sim2net.speed.constant), 37 method), 40
Crash (class in sim2net.failure.crash), 18 get_version() (in module sim2net._version), 9
create_logger() (in module sim2net.utility.logger), 39 GilbertElliott (class in
current (sim2net.speed._speed.Speed attribute), 37 sim2net.packet_loss.gilbert_elliott), 30
current (sim2net.speed.constant.Constant attribute), 38 Grid (class in sim2net.placement.grid), 32
current (sim2net.speed.normal.Normal attribute), 38
current (sim2net.speed.uniform.Uniform attribute), 39
H
height (sim2net.area._area.Area attribute), 16
D height (sim2net.area.rectangle.Rectangle attribute), 17
deliver_packet() (sim2net._channel._Output method), 12 I
F initialize() (sim2net.application.Application method), 8
Failure (class in sim2net.failure._failure), 18 L
failure() (sim2net.application.Application method), 8
logger (sim2net.area._area.Area attribute), 16
finalize() (sim2net._network.Network method), 14
logger (sim2net.failure._failure.Failure attribute), 18
finalize() (sim2net.application.Application method), 8
logger (sim2net.mobility._mobility.Mobility attribute), 21
format() (sim2net.utility.logger.Sim2NetFormatter
logger (sim2net.packet_loss._packet_loss.PacketLoss at-
method), 39
tribute), 29
logger (sim2net.placement._placement.Placement at-
G tribute), 31
GaussMarkov (class in sim2net.mobility.gauss_markov), logger (sim2net.propagation._propagation.Propagation
22 attribute), 35
get_area() (sim2net.area._area.Area method), 15 logger (sim2net.speed._speed.Speed attribute), 37
get_area() (sim2net.area.rectangle.Rectangle method), 16
get_area() (sim2net.area.square.Square method), 17 M
get_current_position() (sim2net.mobility._mobility.Mobilitymain() (sim2net.application.Application method), 8
method), 21 mean (sim2net.speed.normal.Normal attribute), 38
get_current_position() (sim2net.mobility.gauss_markov.GaussMarkov
Mobility (class in sim2net.mobility._mobility), 21
method), 23
N
get_current_position() (sim2net.mobility.nomadic_community.NomadicCommunity
method), 25
Network (class in sim2net._network), 13
get_current_position() (sim2net.mobility.random_waypoint.RandomWaypoint
node_failure() (sim2net.failure._failure.Failure method),
method), 28
18
54 Index
Simple Network Simulator (sim2net) Documentation, Release
Index 55
Simple Network Simulator (sim2net) Documentation, Release
T
tick() (sim2net._time.Time method), 10
Time (class in sim2net._time), 9
transmit_packets() (sim2net._channel._Output method),
12
U
Uniform (class in sim2net.placement.uniform), 34
Uniform (class in sim2net.speed.uniform), 38
uniform() (sim2net.utility.randomness._Randomness
method), 41
W
width (sim2net.area._area.Area attribute), 16
width (sim2net.area.rectangle.Rectangle attribute), 17
within() (sim2net.area._area.Area method), 16
within() (sim2net.area.rectangle.Rectangle method), 17
56 Index