Package com.embabel.agent.api.annotation
Annotation Cost
-
- All Implemented Interfaces:
@Target(allowedTargets = {AnnotationTarget.FUNCTION}) public @interface Cost
Annotates a method that computes the dynamic cost or value of an action at planning time. Similar to @Condition, this method can take domain object parameters from the blackboard. Unlike @Condition, all domain object parameters must be nullable. If a parameter is not available on the blackboard, null will be passed.
The method can also take a
Blackboardparameter for direct access to all available objects.The method must return a Double between 0.0 and 1.0.
Example:
@Cost(name = "processingCost") public double computeProcessingCost(@Nullable LargeDataSet largeData) { return largeData != null ? 0.9 : 0.1; } @Action(costMethod = "processingCost") public DataOutput processData(DataInput input) { ... }