Class DistributionParameterReader
java.lang.Object
es.uam.eps.ir.relison.grid.ParametersReader
es.uam.eps.ir.relison.grid.diffusion.metrics.distributions.DistributionParameterReader
public class DistributionParameterReader extends ParametersReader
Reads the parameter for a distribution during information diffusion simulations.
It reads a single configuration for each distribution. In a file, it should look as:
distrib_name:
params:
param1: ...
times:
values: [value1,value2,...,valueN] or value1
range: - start: start_val
end: end_val
step: steps_val
- start: ...
params:
param1: ...
times:
values: [value1,value2,...,valueN] or value1
range: - start: start_val
end: end_val
step: steps_val
- start: ...
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringENDprivate java.lang.StringnameName of the selection mechanism.private static java.lang.StringPARAMSIdentifier for the parameters.private static java.lang.StringRANGEprivate static java.lang.StringSTARTprivate static java.lang.StringSTEPprivate java.util.List<java.lang.Integer>timesTimes in which to store the timesprivate static java.lang.StringTIMESIdentifiers for the times.private ParametersvaluesParameter values for the distribution.private static java.lang.StringVALUESIdentifier for the time values. -
Constructor Summary
Constructors Constructor Description DistributionParameterReader() -
Method Summary
Modifier and Type Method Description java.lang.StringgetName()Obtains the name of the selection mechanism.ParametersgetParams()Obtains the values of the parameters of the selection mechanism.java.util.List<java.lang.Integer>getTimes()Obtains the list of iterations when the distribution will be written into a file.java.lang.StringprintDistribution()Shows the configuration of a distribution.voidreadDistribution(java.util.Map.Entry<java.lang.String,java.lang.Object> node)Reads the elements of a distributionprivate voidreadTimes(java.util.Map<java.lang.String,java.lang.Object> map)Obtains the list of iterations of the simulation when the distribution shall be stored in a file.Methods inherited from class es.uam.eps.ir.relison.grid.ParametersReader
readBoolean, readDouble, readInteger, readLong, readOrientation, readParameters, readParameterValues, readString
-
Field Details
-
PARAMS
private static final java.lang.String PARAMSIdentifier for the parameters.- See Also:
- Constant Field Values
-
TIMES
private static final java.lang.String TIMESIdentifiers for the times.- See Also:
- Constant Field Values
-
VALUES
private static final java.lang.String VALUESIdentifier for the time values.- See Also:
- Constant Field Values
-
RANGE
private static final java.lang.String RANGE- See Also:
- Constant Field Values
-
START
private static final java.lang.String START- See Also:
- Constant Field Values
-
END
private static final java.lang.String END- See Also:
- Constant Field Values
-
STEP
private static final java.lang.String STEP- See Also:
- Constant Field Values
-
name
private java.lang.String nameName of the selection mechanism. -
values
Parameter values for the distribution. -
times
private java.util.List<java.lang.Integer> timesTimes in which to store the times
-
-
Constructor Details
-
DistributionParameterReader
public DistributionParameterReader()
-
-
Method Details
-
readDistribution
public void readDistribution(java.util.Map.Entry<java.lang.String,java.lang.Object> node)Reads the elements of a distribution- Parameters:
node- the node containing the information for that selection mechanism.
-
readTimes
private void readTimes(java.util.Map<java.lang.String,java.lang.Object> map)Obtains the list of iterations of the simulation when the distribution shall be stored in a file.- Parameters:
map- a map containing the times to use.
-
getName
public java.lang.String getName()Obtains the name of the selection mechanism.- Returns:
- the name of the selection mechanism.
-
getParams
Obtains the values of the parameters of the selection mechanism.- Returns:
- the values of the parameters.
-
getTimes
public java.util.List<java.lang.Integer> getTimes()Obtains the list of iterations when the distribution will be written into a file.- Returns:
- the list of iterations.
-
printDistribution
public java.lang.String printDistribution()Shows the configuration of a distribution.- Returns:
- a string containing the configuration of the distribution.
-