Class AdaptationAlgorithm<TCase extends DataObject,TQuery extends DataObject,TAdaptationKnowledge extends DataObject>

All Implemented Interfaces:
AdaptationFactoryObject

public abstract class AdaptationAlgorithm<TCase extends DataObject,TQuery extends DataObject,TAdaptationKnowledge extends DataObject> extends AbstractEmptyFactoryObjectImplementation implements AdaptationFactoryObject
Abstract class of all adaptation algorithms
  • Field Details

  • Constructor Details

    • AdaptationAlgorithm

      public AdaptationAlgorithm()
  • Method Details

    • init

      public WriteableObjectPool<TCase> init(WriteableObjectPool<TCase> pool, SimilarityCache simCache, AlgorithmConfiguration algorithmConfig, AlgorithmConfiguration globalConfig)
      Init the adaptation algorithm according to the given configuration. During the initialization the adaptation knowledge will be created. The given object pool might be adapted and should be returned for further adaptations.
      Parameters:
      pool - that can be adapted
      simCache - Similarity Cache
      algorithmConfig - Algorithm Configuration
      globalConfig - Global Configuration
      Returns:
      pool that might be adapted during initialization by this adaptation algorithm
    • execute

      public abstract AdaptationSession<TCase,TQuery> execute(AdaptationSession<TCase,TQuery> adaptationSession, TQuery query)

      execute.

      Parameters:
      adaptationSession - a AdaptationSession object
      query - a TQuery object
      Returns:
      a AdaptationSession object
    • getCoverageResults

      public abstract Set<AdaptationSession<TCase,?>> getCoverageResults(TCase caseObject)

      getCoverageResults.

      Parameters:
      caseObject - a TCase object
      Returns:
      a Set object
    • storeAdaptationKnowledge

      protected void storeAdaptationKnowledge()

      storeAdaptationKnowledge.

    • getAlgorithmConfig

      public AlgorithmConfiguration getAlgorithmConfig()

      Getter for the field algorithmConfig.

      Returns:
      a AlgorithmConfiguration object
    • setAlgorithmConfig

      public void setAlgorithmConfig(AlgorithmConfiguration algorithmConfig)

      Setter for the field algorithmConfig.

      Parameters:
      algorithmConfig - a AlgorithmConfiguration object
    • getAdaptationAlgorithmId

      public String getAdaptationAlgorithmId()
      Each adaptation algorithm must have an unique id since . This id can be used to associate an adaptation algorithm instance with a file containing adaptation knowledge.
      Returns:
      Returns the id of the adaptation algorithm.
    • setAdaptationAlgorithmId

      public void setAdaptationAlgorithmId(String id)

      Setter for the field adaptationAlgorithmId.

      Parameters:
      id - a String object
    • getParameterOrDefault

      public <t> t getParameterOrDefault(AlgorithmParameters param)

      getParameterOrDefault.

      Type Parameters:
      t - a t class
      Parameters:
      param - a AlgorithmParameters object
      Returns:
      a t object
    • getAdaptationKnowledge

      public WriteableObjectPool<TAdaptationKnowledge> getAdaptationKnowledge()

      Getter for the field adaptationKnowledge.

      Returns:
      pool with adaptation knowledge used with this adaptation algorithm
    • setAdaptationKnowledge

      public void setAdaptationKnowledge(WriteableObjectPool<TAdaptationKnowledge> adaptationKnowledge)

      Setter for the field adaptationKnowledge.

      Parameters:
      adaptationKnowledge - that should be used with this adaptation algorithm
    • reusedAdaptationKnowledge

      public boolean reusedAdaptationKnowledge()

      reusedAdaptationKnowledge.

      Returns:
      true if adaptation knowledge from previous calculations was loaded successfully
    • usesAdaptationKnowledge

      public abstract boolean usesAdaptationKnowledge()

      usesAdaptationKnowledge.

      Returns:
      true if the algorithm uses adaptation knowledge that can be stored and loaded
    • alwaysExecute

      public boolean alwaysExecute()

      alwaysExecute.

      Returns:
      true if the algorithm should be always executed even if the initial similarity between the query and the case is 1.0
    • isRemoveEqualSemanticAdaptationKnowledge

      public boolean isRemoveEqualSemanticAdaptationKnowledge()

      isRemoveEqualSemanticAdaptationKnowledge.

      Returns:
      a boolean
    • isRemoveEqualSyntacticAdaptationKnowledge

      public boolean isRemoveEqualSyntacticAdaptationKnowledge()

      isRemoveEqualSyntacticAdaptationKnowledge.

      Returns:
      a boolean
    • removeSyntacticallyEqualAdaptationKnowledge

      protected WriteableObjectPool<TAdaptationKnowledge> removeSyntacticallyEqualAdaptationKnowledge(WriteableObjectPool<TAdaptationKnowledge> pool)

      removeSyntacticallyEqualAdaptationKnowledge.

      Parameters:
      pool - a WriteableObjectPool object
      Returns:
      a WriteableObjectPool object
    • removeSemanticallyEqualAdaptationKnowledge

      protected abstract WriteableObjectPool<TAdaptationKnowledge> removeSemanticallyEqualAdaptationKnowledge(WriteableObjectPool<TAdaptationKnowledge> pool)

      removeSemanticallyEqualAdaptationKnowledge.

      Parameters:
      pool - a WriteableObjectPool object
      Returns:
      a WriteableObjectPool object
    • toString

      public String toString()
      Overrides:
      toString in class Object