Class AlgorithmConfigurationsReader
java.lang.Object
es.uam.eps.ir.relison.grid.ConfigurationsReader
es.uam.eps.ir.relison.grid.links.recommendation.algorithms.AlgorithmConfigurationsReader
public class AlgorithmConfigurationsReader extends ConfigurationsReader
Class for reading contact recommendation / link prediction algorithms.
For each algorithm, it reads a list of configurations.
File format:
algorithms:
algorithm_name:
- param1: ...
param2: ...
- param1: ...
...
File format:
algorithms:
algorithm_name:
- param1: ...
param2: ...
- param1: ...
...
- See Also:
ConfigurationsReader
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,Configurations>
algorithmConfs
Map for storing the different configurations of an algorithm.private static java.lang.String
ALGORITHMS
-
Constructor Summary
Constructors Constructor Description AlgorithmConfigurationsReader()
Constructor. -
Method Summary
Modifier and Type Method Description java.util.Set<java.lang.String>
getAlgorithms()
Once the configurations have been read, it obtains the set of algorithms which have been read from the file.Configurations
getConfigurations(java.lang.String algorithm)
Gets the different configurations for a single algorithm.void
read(java.util.Map<java.lang.String,java.lang.Object> map)
Reads a YAML document containing the different configurations of a list of algorithms.private void
readAlgorithm(java.util.Map.Entry<java.lang.String,java.lang.Object> element)
Reads the configurations for a single algorithm.
-
Field Details
-
ALGORITHMS
private static final java.lang.String ALGORITHMS- See Also:
- Constant Field Values
-
algorithmConfs
Map for storing the different configurations of an algorithm.
-
-
Constructor Details
-
AlgorithmConfigurationsReader
public AlgorithmConfigurationsReader()Constructor.
-
-
Method Details
-
read
public void read(java.util.Map<java.lang.String,java.lang.Object> map)Reads a YAML document containing the different configurations of a list of algorithms.- Parameters:
map
- the object containing the configurations.
-
readAlgorithm
private void readAlgorithm(java.util.Map.Entry<java.lang.String,java.lang.Object> element)Reads the configurations for a single algorithm.- Parameters:
element
- an object containing the configurations for a single algorithm.
-
getAlgorithms
public java.util.Set<java.lang.String> getAlgorithms()Once the configurations have been read, it obtains the set of algorithms which have been read from the file. Otherwise, it returns an empty set.- Returns:
- a set containing the names of the algorithms in the configuration file.
-
getConfigurations
Gets the different configurations for a single algorithm.- Parameters:
algorithm
- the name of the algorithm.- Returns:
- the configurations for the given algorithm if exists, an empty list of configurations otherwise.
-