public class Utils
extends java.lang.Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static double |
calcHopDistance(int m,
int n)
Calculates the average hop distance given the topology size.
|
static int |
calcID(int i,
int j,
int tot)
Calculates a unique identifier given two features
and the total number of items.
|
static double |
calcSNR(double signal_attenuation,
double noise_attenuation)
Calculates the signal-to-noise ratio (SNR)
|
static java.util.ArrayList<BuildingBlock> |
cloneArrayList(java.util.List<BuildingBlock> a)
Clones an ArrayList.
|
static int[][] |
cloneMatrix(int[][] m)
Clones a matrix of integer.
|
static double |
dbToVal(double db)
Converts from dB
|
static double |
sumDB(double a,
double b)
Adds two decibel values.
|
static double |
valToDb(double val)
Converts into dB
|
public static double calcHopDistance(int m, int n)
m
- The number of tiles in the first dimension of the topologyn
- The number of tiles in the second dimension of the topologypublic static double sumDB(double a, double b)
a
- The first term of the sum (dB)b
- The second term of the sum (dB)public static double dbToVal(double db)
db
- a value in decibelpublic static double valToDb(double val)
val
- a valuepublic static final double calcSNR(double signal_attenuation, double noise_attenuation)
signal_attenuation
- The signal powernoise_attenuation
- The noise powerpublic static int[][] cloneMatrix(int[][] m)
m
- The matrixpublic static java.util.ArrayList<BuildingBlock> cloneArrayList(java.util.List<BuildingBlock> a)
a
- The ArrayList to clonepublic static int calcID(int i, int j, int tot)
i
- The first featurej
- The second featuretot
- The total number of items