Package es.uam.eps.ir.relison.grid
Class ParametersReader
java.lang.Object
es.uam.eps.ir.relison.grid.ParametersReader
- Direct Known Subclasses:
AlgorithmParametersReader
,CommunityDetectionParametersReader
,DistributionParameterReader
,ExpirationParameterReader
,FilterParameterReader
,IndividualSamplingAlgorithmGridReader
,LinkPredictionMetricParametersReader
,MetricParameterReader
,MetricParametersReader
,PropagationParameterReader
,ProtocolParameterReader
,RecommMetricParametersReader
,RerankerParametersReader
,SelectionParameterReader
,SightParameterReader
,SimulationParameterReader
,StopConditionParameterReader
,UpdateParameterReader
public abstract class ParametersReader
extends java.lang.Object
Class for reading parameters from a YAML file. Given a single parameter, it only has
a single possible value. The format of the file should then be:
param_name:
type: value_of_type
value: value
object:
name: grid_name
params:
param_name1:
type:
...
We should note that
param_name:
type: value_of_type
value: value
object:
name: grid_name
params:
param_name1:
type:
...
We should note that
- object is the only tag that appears if we have to retrieve an internal object which has its own parameters (i.e. a similarity in UB kNN).
- value is compulsory for all types except for GRID.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
NAME
Identifier for the name of a parameter.private static java.lang.String
OBJECT
Identifier for the grid.private static java.lang.String
PARAMS
Identifier for the parameters.private static java.lang.String
TYPE
Identifier for the type of a parameter.private static java.lang.String
VALUE
Identifier for the values. -
Constructor Summary
Constructors Constructor Description ParametersReader()
-
Method Summary
Modifier and Type Method Description protected java.lang.Boolean
readBoolean(java.util.Map<java.lang.String,java.lang.Object> map)
Reads a boolean value from the parameters file.protected java.lang.Double
readDouble(java.util.Map<java.lang.String,java.lang.Object> map)
Reads a double value from the parameters file.protected java.lang.Integer
readInteger(java.util.Map<java.lang.String,java.lang.Object> map)
Reads an integer value from the parameters file.protected java.lang.Long
readLong(java.util.Map<java.lang.String,java.lang.Object> map)
Reads an long value from the parameters file.protected EdgeOrientation
readOrientation(java.util.Map<java.lang.String,java.lang.Object> map)
Reads an edge orientation value from the parameters file.protected Tuple2oo<java.lang.String,Parameters>
readParameters(java.util.Map<java.lang.String,java.lang.Object> map)
Reads the parameters for the internal elements of the algorithm, metric, etc.protected Parameters
readParameterValues(java.util.Map<java.lang.String,java.lang.Object> parameters)
Reads the values of the parameters for a single algorithm, metric, etc.protected java.lang.String
readString(java.util.Map<java.lang.String,java.lang.Object> map)
Reads a string value from the parameters file.
-
Field Details
-
VALUE
private static final java.lang.String VALUEIdentifier for the values.- See Also:
- Constant Field Values
-
NAME
private static final java.lang.String NAMEIdentifier for the name of a parameter.- See Also:
- Constant Field Values
-
TYPE
private static final java.lang.String TYPEIdentifier for the type of a parameter.- See Also:
- Constant Field Values
-
PARAMS
private static final java.lang.String PARAMSIdentifier for the parameters.- See Also:
- Constant Field Values
-
OBJECT
private static final java.lang.String OBJECTIdentifier for the grid.- See Also:
- Constant Field Values
-
-
Constructor Details
-
ParametersReader
public ParametersReader()
-
-
Method Details
-
readParameterValues
protected Parameters readParameterValues(java.util.Map<java.lang.String,java.lang.Object> parameters)Reads the values of the parameters for a single algorithm, metric, etc.- Parameters:
parameters
- a map, indexed by parameter name, containing the values for those parameters.- Returns:
- the parameter configuration.
-
readInteger
protected java.lang.Integer readInteger(java.util.Map<java.lang.String,java.lang.Object> map)Reads an integer value from the parameters file.- Parameters:
map
- a map containing the value of the parameter.- Returns:
- the integer value.
-
readLong
protected java.lang.Long readLong(java.util.Map<java.lang.String,java.lang.Object> map)Reads an long value from the parameters file.- Parameters:
map
- a map containing the value of the parameter.- Returns:
- the long value.
-
readDouble
protected java.lang.Double readDouble(java.util.Map<java.lang.String,java.lang.Object> map)Reads a double value from the parameters file.- Parameters:
map
- a map containing the value of the parameter.- Returns:
- the double value.
-
readString
protected java.lang.String readString(java.util.Map<java.lang.String,java.lang.Object> map)Reads a string value from the parameters file.- Parameters:
map
- a map containing the value of the parameter.- Returns:
- the string value.
-
readBoolean
protected java.lang.Boolean readBoolean(java.util.Map<java.lang.String,java.lang.Object> map)Reads a boolean value from the parameters file.- Parameters:
map
- a map containing the value of the parameter.- Returns:
- the boolean value.
-
readOrientation
Reads an edge orientation value from the parameters file.- Parameters:
map
- a map containing the value of the parameter.- Returns:
- the edge orientation value.
-
readParameters
protected Tuple2oo<java.lang.String,Parameters> readParameters(java.util.Map<java.lang.String,java.lang.Object> map)Reads the parameters for the internal elements of the algorithm, metric, etc.- Parameters:
map
- a map containing the value of the parameter.- Returns:
- a tuple containing the name of the internal element, and its parameters.
-