Class AlgorithmGridReader
java.lang.Object
es.uam.eps.ir.relison.grid.GridReader
es.uam.eps.ir.relison.grid.links.recommendation.algorithms.AlgorithmGridReader
public class AlgorithmGridReader extends GridReader
Class for reading contact recommendation / link prediction algorithms.
For each algorithm, a grid of parameters is read.
File format:
algorithms:
algorithm_name:
param1: ...
File format:
algorithms:
algorithm_name:
param1: ...
- See Also:
GridReader
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
ALGORITHMS
private java.util.Map<java.lang.String,Grid>
algorithmsGrid
Algorithms grid. -
Constructor Summary
Constructors Constructor Description AlgorithmGridReader()
Constructor -
Method Summary
Modifier and Type Method Description java.util.Set<java.lang.String>
getAlgorithms()
Gets the set of algorithms previously read.Grid
getGrid(java.lang.String algorithm)
Gets the grid for a given algorithmvoid
read(java.util.Map<java.lang.String,java.lang.Object> map)
Obtains the algorithm grids for different people-to-people recommendation algorithms.private void
readAlgorithm(java.util.Map.Entry<java.lang.String,java.lang.Object> element)
Reads the grid for a single algorithm.Methods inherited from class es.uam.eps.ir.relison.grid.GridReader
readBooleanGrid, readDoubleGrid, readGridGrid, readIntegerGrid, readLongGrid, readOrientationGrid, readParameterGrid, readStringGrid
-
Field Details
-
ALGORITHMS
private static final java.lang.String ALGORITHMS- See Also:
- Constant Field Values
-
algorithmsGrid
Algorithms grid. Uses a grid for each algorithm.
-
-
Constructor Details
-
AlgorithmGridReader
public AlgorithmGridReader()Constructor
-
-
Method Details
-
read
public void read(java.util.Map<java.lang.String,java.lang.Object> map)Obtains the algorithm grids for different people-to-people recommendation algorithms.- Parameters:
map
- a map containing the information in the YAML file about the different algorithms.
-
readAlgorithm
private void readAlgorithm(java.util.Map.Entry<java.lang.String,java.lang.Object> element)Reads the grid for a single algorithm.- Parameters:
element
- A map containing the information in the YAML file about the algorithm.
-
getAlgorithms
public java.util.Set<java.lang.String> getAlgorithms()Gets the set of algorithms previously read.- Returns:
- The set of algorithms previously read from the grid file.
-
getGrid
Gets the grid for a given algorithm- Parameters:
algorithm
- the algorithm to search- Returns:
- the grid if exists, an empty grid if not.
-