Node Mobility
This module provides classes and the functions that implements Node Mobility.
The class NodeMobility
implement the mobility of each node in the simulation.
- class toolkit5G.ChannelModels.NodeMobility(typeOfMobility='randomWalk', *args)[source]
A class which implements the mobility of nodes (typicall UEs) in the simulation.
- Parameters:
typeOfMobility (str or None) – Specifies the type of mobility. Defaults to “randomWalk”. Supported types are “vehicle”,”randomWalk” and “circular”. None correspond to all the nodes are static and not mobile.
args –
Its a Variable length argument list which accepts values based on the parameter
typeOfMobility
.If ``typeOfMobility``is “randomWalk”
arg[0]
is number of nodes (i.e., either Base Stations (BSs) or User Equipments (UEs)) in simulation.arg[1]
is an array of time instances (or snapshots) at which the channel is being computed for a mobile node.arg[2]
is the minimum velocity in m/s. Node velocity must not fall below this value (i.e., It gives a lower bound on the node velocity).arg[3]
is the maximum velocity in m/s. Node velocity must not exceed this value (i.e., It gives an upper bound on the node velocity).arg[4]
is the minimum azimuth angle in radians. It gives a lower bound on the angle at which the node is moving in azimuth direction.arg[5]
is the maximum azimuth angle in radians. It gives an upper bound on the angle at which the node is moving in azimuth direction.arg[6]
is a boolean specifying whether the node orientations are random or not.
If
typeOfMobility
is “circular”arg[0]
is number of nodes (i.e., either Base Stations (BSs) or User Equipments (UEs)) in simulation.arg[1]
is an array of time instances (or snapshots) at which the channel is being computed for a mobile node.arg[2]
is the minimum radius in meters. Circular trajectory radius must not fall below this value (i.e., It gives a lower bound on the radius of circular trajectory on which the node is moving).arg[3]
is the maximum radius in meters. It gives an upper bound on the radius of circular trajectory.arg[4]
is the minimum velocity in m/s. It gives a lower bound on the node velocity.arg[5]
is the maximum velocity in m/s. It gives an upper bound on the node velocity.arg[6]
is a boolean specifying whether the nodes initial snapshot locations are random or not. When it is True, node locations can be anywhere on the circumference of circle. Otherwise it starts at angle 0 (deg/rad).arg[7]
specifies initial angle of each node. When passed as a 1D array it should be of shape (number of nodes,) with each element to be either an int or a float.arg[8]
is a boolean specifying whether the node orientations are random or not.
If
typeOfMobility
is “vehicle”arg[0]
is number of vehicles to drop in simulation.arg[1]
is an array of time instances (or snapshots) at which the channel is being computed for a mobile node.arg[2]
correspond to different kinds of options available in implementing vehicle drops. current implementation support 3 options (‘optionA’, ‘optionB’, and ‘optionC’).arg[3]
is the highway lane width in meters.arg[4]
is the number of lanes in a highway. Must be a postivie int.arg[5]
is type of the vehicle drop. current implementation support “random” drops.arg[6]
is a boolean specifying whether the node orientations are random or not.
- Attributes:
nodeOrientation (np.ndarray) – Specifies the orientation of each node in the simulation. Shape of this array is (number of timeInstances, number of nodes, 3).
velocityVector (NumPy.ndarray) – Specifies the velocity of each node in the simulation. Shape of this array is (number of timeInstances, number of nodes, 3).
- Output:
initLocation (np.ndarray of float) – Specifies the initial locations of nodes with shape (number of nodes, 3).
nodeRoute (np.ndarray of float) – Specifies the node route having a shape of (number of snapshots or time instances, number of nodes, 3).
Mobility Models
This module provides classes and functions that implement different types of mobility models to support node mobility.
Current implementation support three mobility models namely Random-Walk , Circular and Highway drops.
Classes RandomWalk
implement Random-Walk, CircularRoute
implement Circular route and DropVehiclesHighway
implements vehicle drops
in highway respectively.
Random-Walk
- class toolkit5G.ChannelModels.nodeMobility.RandomWalk(numNodes, timeInstances, minVelocity=0, maxVelocity=1, phiMin=-0.7853981633974483, phiMax=0.7853981633974483, randomizeOrientations=False)[source]
A class which implement mobility model Random Walk.
- Parameters:
numNodes (int) – Number of Nodes in simulation. Must be a positive int.
timeInstances (NumPy.ndarray) – Specify the time instance at each snapshot for all the mobile nodes in simulation. Must be a non decreasing numpy array of int/float.
minVelocity (int or float) – Specify minimum velocity. Must be an int/float. Defaults to 0 m/s
maxVelocity (int or float) – Specify maximum velocity. Must be greater than minVelocity. Also must be an int or float. Defaults to 1 m/s
phiMin (int or float) – Minimum Azimuth angle in rad. Must be an int or float.
phiMax (int or float) – Maximum Azimuth angle in rad. Must be an int or float.
randomizeOrientations (bool) – A boolean variable specifying whether the node orientations are random or not. Defaults to False.
- Attributes:
nodeRoute (NumPy.ndarray) – Specify the route of each node in the simulation.
velocityVector (NumPy.ndarray) – Specify the velocity of each node in the simulation.
Circular Route
- class toolkit5G.ChannelModels.nodeMobility.CircularRoute(numNodes, timeInstances, radiusMin=0, radiusMax=100, minVelocity=0, maxVelocity=0.833, isInitSnapShotLocationRandom=True, initAngle=None, randomizeOrientations=False)[source]
A class which implements circular route of node mobility.
- Parameters:
numNodes (int) – Number of Nodes in simulation. Must be a positive int.
timeInstances (NumPy.ndarray) – Specify the time instance at each snapshot for all the mobile nodes in simulation. Must be a non decreasing numpy array of int/float.
radiusMin (int or float) – Minimum radius. Must be a positive int or float. Defaults to 0 meter.
radiusMax (int or float) – Maximum radius. Must be a positive int or float greater than radiusMax. Defaults to 100 meter.
minVelocity (int or float) – Minimum velocity. Must be an int/float. Defaults to 0 m/s
maxVelocity (int or float) – Maximum velocity. Must be greater than minVelocity and an int or float. Defaults to 0.833 m/s or 3 Kmph.
isInitSnapShotLocationRandom (bool) – A boolean variable specifying whether the initiatal snap-shot location are random or not. Defaults to True.
initAngle (None or int or float or NumPy.ndarray) – Specify the initial angle of each node. Defaults to None. When passed as an array it must be of 1D (or size numNodes) with each element to be either an int or a float.
randomizeOrientations (bool) – A boolean variable specifying whether the node orientations are random or not. Defaults to False.
- Attributes:
initLocations (NumPy.ndarray) – Specifies initial locations of each node in the simulation.
nodeRoute (NumPy.ndarray) – Specify the route of each node in the simulation.
velocityVector (NumPy.ndarray) – Specify the velocity of each node in the simulation.
Vehicle Drops on HighWays
- class toolkit5G.ChannelModels.nodeMobility.DropVehiclesHighway(option, laneWidth, numLanes=6, randomizeOrientations=False)[source]
A class which implement vehicle drops in a highway.
- Parameters:
option (str) – A variable specifying the options available in the implementation of dropping vehicles in highway.
laneWidth (int or float) – Specify the width of the lane in meters on a highway.
numLanes (int) – Number of lanes in a highway. Must be a positive int.
randomizeOrientations (bool) – A boolean variable specifying whether the node orientations are random or not. Defaults to False.
- Input:
numVehicles (int) – Specifies number of vehicles to drop in the simulation.
timeInstances (NumPy.ndarray) – Specify the time instance at each snapshot for all the mobile nodes in simulation. Must be a non decreasing numpy array of int or float.
vehicledropType (str) – Type of the vehicle drop. current implementation support “random” drops.
Note
All the classes have the following attributes nodeRoute
, velocityVector
from which the user can access the
route and the velocity of each node respectively.