Class ComposedEvaluator<S>
- java.lang.Object
-
- jadex.bridge.nonfunctional.search.ComposedEvaluator<S>
-
- All Implemented Interfaces:
IServiceEvaluator
,IServiceRanker<S>
public class ComposedEvaluator<S> extends java.lang.Object implements IServiceEvaluator, IServiceRanker<S>
Evaluator composed of multiple weighted evaluators.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<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.IFuture<java.lang.Double>
evaluate(IService service)
Evaluates the service in detail.IFuture<java.util.List<S>>
rank(java.util.List<S> unrankedservices)
Ranks services according to non-functional criteria.IFuture<java.util.List<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.
-
-
-
Field Detail
-
evaluators
protected java.util.List<Tuple2<IServiceEvaluator,java.lang.Double>> evaluators
The evaluators.
-
-
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 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 interfaceIServiceEvaluator
- Parameters:
service
- The service being evaluated.- Returns:
- An evaluation of the service in a range between 0 and 1 (inclusive).
-
rank
public IFuture<java.util.List<S>> rank(java.util.List<S> unrankedservices)
Ranks services according to non-functional criteria.- Specified by:
rank
in interfaceIServiceRanker<S>
- Parameters:
unrankedservices
- Unranked list of services.- Returns:
- Ranked list of services.
-
rankWithScores
public IFuture<java.util.List<Tuple2<S,java.lang.Double>>> rankWithScores(java.util.List<S> unrankedservices)
Ranks services according to non-functional criteria.- Specified by:
rankWithScores
in interfaceIServiceRanker<S>
- Parameters:
unrankedservices
- Unranked list of services.- Returns:
- Ranked list of services and scores.
-
-