Package jadex.bridge.sensor.service
Class AverageEvaluator
- java.lang.Object
-
- jadex.bridge.sensor.service.AverageEvaluator
-
- All Implemented Interfaces:
IServiceEvaluator
public class AverageEvaluator extends java.lang.Object implements IServiceEvaluator
-
-
Field Summary
Fields Modifier and Type Field Description protected IServiceEvaluator
evaluator
The contained evaluator.protected int
period
The avg period.protected java.lang.Double
value
The last average value.
-
Constructor Summary
Constructors Constructor Description AverageEvaluator(IServiceEvaluator evaluator)
Create a new AverageEvaluator.AverageEvaluator(IServiceEvaluator evaluator, int period)
Create a new AverageEvaluator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<java.lang.Double>
evaluate(IService service)
Evaluates the service in detail.
-
-
-
Field Detail
-
evaluator
protected IServiceEvaluator evaluator
The contained evaluator.
-
value
protected java.lang.Double value
The last average value.
-
period
protected int period
The avg period.
-
-
Constructor Detail
-
AverageEvaluator
public AverageEvaluator(IServiceEvaluator evaluator)
Create a new AverageEvaluator.
-
AverageEvaluator
public AverageEvaluator(IServiceEvaluator evaluator, int period)
Create a new AverageEvaluator.
-
-
Method Detail
-
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).
-
-