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. A call to a method :method:`displayRoute` displays the node route after instantiating this class and creating an object.

class toolkit5G.ChannelModels.NodeMobility(typeOfMobility='randomWalk', *args)[source]

A class which implements the mobility of nodes 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 == “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 == “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 == “vehicle”:
    • arg[0] correspond to different kinds of options available in implementing vehicle drops. current implementation support 3 options (‘optionA’, ‘optionB’, and ‘optionC’).

    • arg[1] is the highway lane width in meters.

    • arg[2] is the number of lanes in a highway. Must be a postivie int.

    • arg[3] 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).

displayRoute(*args)[source]

Method to display the route of a node in simulation.

property randomizeOrientations

A boolean variable specifying whether the orientations of each node is random or not in the simulation.

property timeInstances

This property specifies the time instant of each snap-shot in the simulation

property typeOfMobility

Specifies the type of node mobility. current implementation support three types of mobility models namely “vehicle”, “randomWalk”, “circular”

NodeMobility.displayRoute(*args)[source]

Method to display the route of a node in simulation.

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]

r RandomWalk(numNodes, timeInstances, minVelocity = 0, maxVelocity = 1, phiMin = -np.pi/4, phiMax = np.pi/4, randomizeOrientations = False)

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.

property maxVelocity

Specifies the maximum velocity. i.e., every node moves with a velocity not greater than this value

property minVelocity

Specifies the minimum velocity. i.e., every node moves with a velocity not less than this value

property numNodes

number of Nodes, typically the sum of number of BSs and number of UEs in the simulation

property numSnapshots

This property captures the number of Snap-Shots at which the cluster or link level channel is being simulated

property phiMax

Specifies the maximum angle in Azimuth direction. i.e, in the plane where every node moves.

property phiMin

Specifies the minimum angle in Azimuth direction. i.e, in the plane where every node moves.

property randomizeOrientations

Specifies whether the orientations of each node is random or not in the simulation.

property timeInstances

This property specifies the time instant of each snap-shot 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.

property initAngle

Specifies the initial angle of each node in the simulation. Must be in radians and from the interval [0,2*pi].

property isInitSnapShotLocationRandom

A boolean specifying whether initial snap-shot locations are random or not in the simulation.

property isSamplingUniform

A boolean specifying whether sampling the points on a circle uniformly or not.

property maxVelocity

Specifies the maximum velocity with which every node moves with a velocity not greaten than this value

property minVelocity

Specifies the minimum velocity with which every node moves with a velocity not less than this value

property numNodes

Specifies number of nodes in the simulation. Must be always a positive int.

property numSnapshots

Specifies number of snap-shots in the simulation.

property radiusMax

Specifies the maximum radius of circular track in meters.

property radiusMin

Specifies the minimum radius of circular track in meters.

property randomizeOrientations

Specifies whether the orientations of each node is random or not in the simulation.

property timeInstances

Specifies the time instant of each snap-shot in the simulation. Must be non-decreasing.

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.

property option

Specifies the different options supported in the dropping vehicles in a highway. Current implementation support three options.

property randomizeOrientations

A boolean variable specifying whether the orientations of each node is random or not in the simulation.

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.