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.String
END
private java.lang.String
name
Name of the selection mechanism.private static java.lang.String
PARAMS
Identifier for the parameters.private static java.lang.String
RANGE
private static java.lang.String
START
private static java.lang.String
STEP
private java.util.List<java.lang.Integer>
times
Times in which to store the timesprivate static java.lang.String
TIMES
Identifiers for the times.private Parameters
values
Parameter values for the distribution.private static java.lang.String
VALUES
Identifier for the time values. -
Constructor Summary
Constructors Constructor Description DistributionParameterReader()
-
Method Summary
Modifier and Type Method Description java.lang.String
getName()
Obtains the name of the selection mechanism.Parameters
getParams()
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.String
printDistribution()
Shows the configuration of a distribution.void
readDistribution(java.util.Map.Entry<java.lang.String,java.lang.Object> node)
Reads the elements of a distributionprivate 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.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.
-