Class SimulationMetricsParameterReader
java.lang.Object
es.uam.eps.ir.relison.grid.diffusion.SimulationMetricsParameterReader
public class SimulationMetricsParameterReader
extends java.lang.Object
Obtains the configuration of metrics to use in the evaluation of the information diffusion process.
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,org.jooq.lambda.tuple.Tuple2<Parameters,java.util.List<java.lang.Integer>>>distribParamsParameters for the different distributions to compute.private static java.lang.StringDISTRIBUTIONSIdentifier for the distributions listprivate static java.lang.StringFILTERIdentifier for the filterprivate java.util.List<FilterParameterReader>filterParamsParameters for the different filters.private static java.lang.StringFILTERSIdentifier for filtersprivate java.util.Map<java.lang.String,Parameters>metricParamsParameters for the different metrics to compute.private static java.lang.StringMETRICSIdentifier for the metrics list. -
Constructor Summary
Constructors Constructor Description SimulationMetricsParameterReader()Constructor -
Method Summary
Modifier and Type Method Description org.jooq.lambda.tuple.Tuple2<Parameters,java.util.List<java.lang.Integer>>getDistributionParameters(java.lang.String distrib)Obtains the set of parameters for a single distribution.java.util.List<java.lang.String>getDistributions()Obtains the list of metrics.FilterParameterReadergetFilterParameter(int num)Gets the parameters for a single filter.java.util.List<FilterParameterReader>getFiltersParameters()Gets the filter parameters for a given simulation.ParametersgetMetricParameters(java.lang.String metric)Obtains the set of parameters for a single metric.java.util.List<java.lang.String>getMetrics()Obtains the list of metrics.voidread(java.util.Map<java.lang.String,java.lang.Object> map)Obtains the metric configuration for the diffusion simulation from a YAML file.private voidreadDistributions(java.util.Map<java.lang.String,java.lang.Object> node)Reads the configuration parameters for a list of information propagation distributions.private voidreadFilters(java.util.Map<java.lang.String,java.lang.Object> filters)Reads the configuration parameters for the data filters.private voidreadMetrics(java.util.Map<java.lang.String,java.lang.Object> node)Reads the configuration parameters for a list of information propagation metrics.
-
Field Details
-
METRICS
private static final java.lang.String METRICSIdentifier for the metrics list.- See Also:
- Constant Field Values
-
DISTRIBUTIONS
private static final java.lang.String DISTRIBUTIONSIdentifier for the distributions list- See Also:
- Constant Field Values
-
FILTERS
private static final java.lang.String FILTERSIdentifier for filters- See Also:
- Constant Field Values
-
FILTER
private static final java.lang.String FILTERIdentifier for the filter- See Also:
- Constant Field Values
-
filterParams
Parameters for the different filters. -
metricParams
Parameters for the different metrics to compute. -
distribParams
private final java.util.Map<java.lang.String,org.jooq.lambda.tuple.Tuple2<Parameters,java.util.List<java.lang.Integer>>> distribParamsParameters for the different distributions to compute.
-
-
Constructor Details
-
SimulationMetricsParameterReader
public SimulationMetricsParameterReader()Constructor
-
-
Method Details
-
read
public void read(java.util.Map<java.lang.String,java.lang.Object> map)Obtains the metric configuration for the diffusion simulation from a YAML file.- Parameters:
map- a map representing the contents of the YAML file.
-
readMetrics
private void readMetrics(java.util.Map<java.lang.String,java.lang.Object> node)Reads the configuration parameters for a list of information propagation metrics.- Parameters:
node- the map specifying the list of metrics.
-
readDistributions
private void readDistributions(java.util.Map<java.lang.String,java.lang.Object> node)Reads the configuration parameters for a list of information propagation distributions.- Parameters:
node- the node containing the list of distributions.
-
readFilters
private void readFilters(java.util.Map<java.lang.String,java.lang.Object> filters)Reads the configuration parameters for the data filters.- Parameters:
filters- a map containing the filters to apply.
-
getMetrics
public java.util.List<java.lang.String> getMetrics()Obtains the list of metrics.- Returns:
- a list containing the names of the metrics.
-
getMetricParameters
Obtains the set of parameters for a single metric.- Parameters:
metric- the name of the metric.- Returns:
- the parameters for the given metric if they exist, an empty parameter set otherwise.
-
getDistributions
public java.util.List<java.lang.String> getDistributions()Obtains the list of metrics.- Returns:
- a list containing the names of the metrics.
-
getDistributionParameters
public org.jooq.lambda.tuple.Tuple2<Parameters,java.util.List<java.lang.Integer>> getDistributionParameters(java.lang.String distrib)Obtains the set of parameters for a single distribution.- Parameters:
distrib- the name of the distribution.- Returns:
- the parameters for the given distribution if they exist, an empty parameter set otherwise.
-
getFiltersParameters
Gets the filter parameters for a given simulation.- Returns:
- the filter parameters.
-
getFilterParameter
Gets the parameters for a single filter.- Parameters:
num- the index of the filter- Returns:
- the filter parameters, or null if it does not exist.
-