Class AlgorithmConfiguration
java.lang.Object
es.urjc.etsii.grafo.autoconfig.irace.AlgorithmConfiguration
Algorithm configuration via pairs of key values
-
Constructor Summary
ConstructorsConstructorDescriptionAlgorithmConfiguration
(String[] args) Build an algorithm configuration from a string value, such those returned from Irace.AlgorithmConfiguration
(Map<String, String> params) Initialize an algorithm configuration from a map -
Method Summary
Modifier and TypeMethodDescriptionGet all config properties related to the irace algorithmGet the value of a config propertyGet the value of a config propertygetValueAsDouble
(String key) Get the value of a config property and parse as double valuedouble
getValueAsDouble
(String key, double defaultValue) Get the value of a config property and parse as a double valuegetValueAsInt
(String key) Get the value of a config property and parse as integer valueint
getValueAsInt
(String key, int defaultValue) Get the value of a config property and parse as integer value
-
Constructor Details
-
AlgorithmConfiguration
Initialize an algorithm configuration from a map- Parameters:
params
- algorithm parameters as pairs of key-value
-
AlgorithmConfiguration
Build an algorithm configuration from a string value, such those returned from Irace. Example: "constructive=random balanced=true initialmaxdiffratio=0.8193 cooldownexpratio=0.9438 cyclelength=9"- Parameters:
args
- String representation of the algorithm parameters, see example in method description
-
-
Method Details
-
getValue
Get the value of a config property- Parameters:
property
- config key- Returns:
- Optional with value if key was in config map, empty Optional if key was not in config map.
-
getValue
Get the value of a config property- Parameters:
key
- config keydefaultValue
- value to return if key is not in config map- Returns:
- Config value if key present, default value otherwise
-
getValueAsInt
Get the value of a config property and parse as integer value- Parameters:
key
- config key- Returns:
- Optional with value if key was in config map, empty Optional if key was not in config map.
-
getValueAsInt
Get the value of a config property and parse as integer value- Parameters:
key
- config keydefaultValue
- value to return if key is not in config map- Returns:
- Config value if key present, default value otherwise
-
getValueAsDouble
Get the value of a config property and parse as double value- Parameters:
key
- config key- Returns:
- Optional with value if key was in config map, empty Optional if key was not in config map.
-
getValueAsDouble
Get the value of a config property and parse as a double value- Parameters:
key
- config keydefaultValue
- value to return if key is not in config map- Returns:
- Config value as double if key present, default value otherwise
-
getConfig
Get all config properties related to the irace algorithm- Returns:
- all key/values as a map.
-