Class ComposedEvaluator<S>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.List<jadex.commons.Tuple2<IServiceEvaluator,​java.lang.Double>> evaluators
      The evaluators.
    • Constructor Summary

      Constructors 
      Constructor Description
      ComposedEvaluator()
      Creates the combiner.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addEvaluator​(IServiceEvaluator evaluator)
      Adds a new evaluator with a weight of 1.0.
      void addEvaluator​(IServiceEvaluator evaluator, double weight)
      Adds a new evaluator.
      jadex.commons.future.IFuture<java.lang.Double> evaluate​(IService service)
      Evaluates the service in detail.
      jadex.commons.future.IFuture<java.util.List<S>> rank​(java.util.List<S> unrankedservices)
      Ranks services according to non-functional criteria.
      jadex.commons.future.IFuture<java.util.List<jadex.commons.Tuple2<S,​java.lang.Double>>> rankWithScores​(java.util.List<S> unrankedservices)
      Ranks services according to non-functional criteria.
      void removeEvaluator​(IServiceEvaluator evaluator)
      Removes an evaluator.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • evaluators

        protected java.util.List<jadex.commons.Tuple2<IServiceEvaluator,​java.lang.Double>> evaluators
        The evaluators.
    • Constructor Detail

      • ComposedEvaluator

        public ComposedEvaluator()
        Creates the combiner.
    • Method Detail

      • addEvaluator

        public void addEvaluator​(IServiceEvaluator evaluator)
        Adds a new evaluator with a weight of 1.0.
        Parameters:
        evaluator - The new evaluator.
      • addEvaluator

        public void addEvaluator​(IServiceEvaluator evaluator,
                                 double weight)
        Adds a new evaluator.
        Parameters:
        evaluator - The new evaluator.
        weight - The weight of the evaluator relative to other evaluators.
      • removeEvaluator

        public void removeEvaluator​(IServiceEvaluator evaluator)
        Removes an evaluator.
        Parameters:
        evaluator - The evaluator.
      • evaluate

        public jadex.commons.future.IFuture<java.lang.Double> evaluate​(IService service)
        Evaluates the service in detail. This method must return an evaluation of the service in the range between 0 (worst/unacceptable) to 1 (best/preferred).
        Specified by:
        evaluate in interface IServiceEvaluator
        Parameters:
        service - The service being evaluated.
        Returns:
        An evaluation of the service in a range between 0 and 1 (inclusive).
      • rank

        public jadex.commons.future.IFuture<java.util.List<S>> rank​(java.util.List<S> unrankedservices)
        Ranks services according to non-functional criteria.
        Specified by:
        rank in interface IServiceRanker<S>
        Parameters:
        unrankedservices - Unranked list of services.
        Returns:
        Ranked list of services.
      • rankWithScores

        public jadex.commons.future.IFuture<java.util.List<jadex.commons.Tuple2<S,​java.lang.Double>>> rankWithScores​(java.util.List<S> unrankedservices)
        Ranks services according to non-functional criteria.
        Specified by:
        rankWithScores in interface IServiceRanker<S>
        Parameters:
        unrankedservices - Unranked list of services.
        Returns:
        Ranked list of services and scores.