Class AdaptationManagerImpl<TCase extends DataObject,TQuery extends DataObject>
java.lang.Object
de.uni_trier.wi2.procake.adaptation.manager.Impl.AdaptationManagerImpl<TCase,TQuery>
- All Implemented Interfaces:
AdaptationManager<TCase,
TQuery>
public class AdaptationManagerImpl<TCase extends DataObject,TQuery extends DataObject>
extends Object
implements AdaptationManager<TCase,TQuery>
Definition of a AdaptationManager. Refer to the corresponding interface
AdaptationManager
for more information.-
Constructor Summary
ConstructorDescriptionConstructor for AdaptationManagerImpl.AdaptationManagerImpl
(WriteableObjectPool<TCase> pool, AdaptationConfiguration adaptationConfig) The adaptation manager will be initiated with the given configuration directlyAdaptationManagerImpl
(WriteableObjectPool<TCase> pool, AdaptationConfiguration adaptationConfig, SimilarityCache similarityCache) The adaptation manager will be initiated with the given configuration directly and algorithms use the specified similarity cache. -
Method Summary
Modifier and TypeMethodDescriptionexecute.getAdaptationAlgorithm
(String adaptationAlgorithmId) getAdaptationAlgorithm.<TAdaptationKnowledge extends DataObject>
WriteableObjectPool<TAdaptationKnowledge>getAdaptationKnowledge
(String adaptationAlgorithmId) getAdaptationKnowledge.static String[]
getAvailableParameterNames
(String algorithmName) getAvailableParameterNames.static AlgorithmParameters[]
getAvailableParameters
(String algorithmName) getAvailableParameters.getCoverageResults
(TCase caseObject, String adaptationAlgorithmId) getCoverageResults.static Class<?>
getParameterClass
(String algorithmName, String parameterName) getParameterClass.getSimilarityMeasure.init
(AdaptationConfiguration adaptationConfig) Inits the adaptation algorithms according to the configurationinit
(AdaptationConfiguration adaptationConfig, SimilarityCache simCache) Initializes the adaptation algorithms according to the configurationstatic boolean
isValidAdaptationAlgorithmName
(String algorithmName) isValidAdaptationAlgorithmName.static boolean
isValidParameterName
(String algorithmName, String parameterName) isValidParameterName.boolean
reusedAdaptationKnowledge
(String adaptationAlgorithmId) reusedAdaptationKnowledge.void
setAdaptationKnowledge
(String adaptationAlgorithmId, WriteableObjectPool adaptationKnowledge) setAdaptationKnowledge.
-
Constructor Details
-
AdaptationManagerImpl
Constructor for AdaptationManagerImpl.
- Parameters:
pool
- aWriteableObjectPool
object
-
AdaptationManagerImpl
public AdaptationManagerImpl(WriteableObjectPool<TCase> pool, AdaptationConfiguration adaptationConfig) The adaptation manager will be initiated with the given configuration directly- Parameters:
pool
- Object pooladaptationConfig
- Adaptation configuration
-
AdaptationManagerImpl
public AdaptationManagerImpl(WriteableObjectPool<TCase> pool, AdaptationConfiguration adaptationConfig, SimilarityCache similarityCache) The adaptation manager will be initiated with the given configuration directly and algorithms use the specified similarity cache.- Parameters:
pool
- Object pooladaptationConfig
- Adaptation configurationsimilarityCache
- Similarity cache
-
-
Method Details
-
isValidAdaptationAlgorithmName
isValidAdaptationAlgorithmName.
- Parameters:
algorithmName
- Algorithm name- Returns:
- true if the algorithm name is valid
-
isValidParameterName
isValidParameterName.
- Parameters:
algorithmName
- Algorithm nameparameterName
- Parameter name- Returns:
- true if the given parameter name is valid for the algorithm
-
getAvailableParameterNames
getAvailableParameterNames.
- Parameters:
algorithmName
- Algorithm name- Returns:
- availableParams An array of available parameter names. Returns null if the algorithm name is not valid.
-
getAvailableParameters
getAvailableParameters.
- Parameters:
algorithmName
- Algorithm name- Returns:
- availableParams An array of available parameters. Returns null if the algorithm name is not valid.
-
getParameterClass
getParameterClass.
-
init
Inits the adaptation algorithms according to the configuration- Specified by:
init
in interfaceAdaptationManager<TCase extends DataObject,
TQuery extends DataObject> - Parameters:
adaptationConfig
- Adaptation config- Returns:
- objectpool that results from the initialization of all defined algorithms
-
init
public WriteableObjectPool<TCase> init(AdaptationConfiguration adaptationConfig, SimilarityCache simCache) Initializes the adaptation algorithms according to the configuration- Specified by:
init
in interfaceAdaptationManager<TCase extends DataObject,
TQuery extends DataObject> - Parameters:
adaptationConfig
- Adaptation configurationsimCache
- similarity cache- Returns:
- objectpool that results from the initialization of all defined algorithms
-
execute
execute.
- Specified by:
execute
in interfaceAdaptationManager<TCase extends DataObject,
TQuery extends DataObject> - Parameters:
caseObject
- Case objectqueryObject
- Query object- Returns:
- NESTAdaptationSession
-
getCoverageResults
public Set<AdaptationSession<TCase,?>> getCoverageResults(TCase caseObject, String adaptationAlgorithmId) throws Exception getCoverageResults.
- Specified by:
getCoverageResults
in interfaceAdaptationManager<TCase extends DataObject,
TQuery extends DataObject> - Parameters:
caseObject
- Case objectadaptationAlgorithmId
- Adaptation algorithm identifier- Returns:
- WriteableObjectPool pool with adapted cases
- Throws:
Exception
- java.lang.Exception
-
getAdaptationAlgorithm
getAdaptationAlgorithm.
- Specified by:
getAdaptationAlgorithm
in interfaceAdaptationManager<TCase extends DataObject,
TQuery extends DataObject> - Parameters:
adaptationAlgorithmId
- Adaptation algorithm identifier- Returns:
- AdaptationAlgorithm
- Throws:
Exception
- java.lang.Exception
-
reusedAdaptationKnowledge
reusedAdaptationKnowledge.
- Specified by:
reusedAdaptationKnowledge
in interfaceAdaptationManager<TCase extends DataObject,
TQuery extends DataObject> - Parameters:
adaptationAlgorithmId
- Adaptation algorithm identifier- Returns:
- boolean whether adaptation knowledge was loaded
- Throws:
Exception
- java.lang.Exception
-
getAdaptationKnowledge
public <TAdaptationKnowledge extends DataObject> WriteableObjectPool<TAdaptationKnowledge> getAdaptationKnowledge(String adaptationAlgorithmId) throws Exception getAdaptationKnowledge.
- Specified by:
getAdaptationKnowledge
in interfaceAdaptationManager<TCase extends DataObject,
TQuery extends DataObject> - Type Parameters:
TAdaptationKnowledge
- a TAdaptationKnowledge class- Parameters:
adaptationAlgorithmId
- Adaptation algorithm identifier- Returns:
- pool with adaptation knowledge for the given adaptation algorithm
- Throws:
Exception
- java.lang.Exception
-
setAdaptationKnowledge
public void setAdaptationKnowledge(String adaptationAlgorithmId, WriteableObjectPool adaptationKnowledge) throws Exception setAdaptationKnowledge.
- Specified by:
setAdaptationKnowledge
in interfaceAdaptationManager<TCase extends DataObject,
TQuery extends DataObject> - Parameters:
adaptationAlgorithmId
- Adaptation algorithm identifieradaptationKnowledge
- for the given adaptation algorithm- Throws:
Exception
- java.lang.Exception
-
getSimilarityMeasure
getSimilarityMeasure.
- Specified by:
getSimilarityMeasure
in interfaceAdaptationManager<TCase extends DataObject,
TQuery extends DataObject> - Returns:
- returns current similarity measure defining the adaptation goal
-