Jadex 0.96

jadex.planlib
Class ProposalEvaluator

java.lang.Object
  extended by jadex.planlib.ProposalEvaluator
All Implemented Interfaces:
IProposalEvaluator

public class ProposalEvaluator
extends Object
implements IProposalEvaluator

A default implementation of the proposal evaluator interface. The implementation determines acceptable proposals by comparing proposals or evaluations to a given limit value.

The evaluation process implemented in the evaluateProposals() method is distributed across three methods, which can be separately overwritten if needed, while reusing functionality of the other methods.

  1. The proposals are evaluated by calling the the evaluateProposal() method for each of the proposals. The evaluation result is written back into the proposal. The default implementation just checks, if the proposal object itself is suitable as an evaluation (i.e. if it is comparable).
  2. For each of the proposals, the acceptability is determined. By default, the given string constants are interpreted or, if a limit value is given, the proposal evaluations are compared to the limit value.
  3. Finally, the acceptable proposals are ordered by preference. As a default, the proposals are compared to each other and sorted according to the given ordering.


Field Summary
static String EVALUATION_ACCEPTABLE
          Evaluation value indicating an acceptable proposal that should be considered in further negotiation rounds.
static String EVALUATION_INACCEPTABLE
          Evaluation value indicating an inacceptable proposal that should be excluded.
 
Constructor Summary
ProposalEvaluator(Comparator evaluation_comparator, Object evaluation_limit, boolean ascending)
          Create a default proposal evaluator with a given limit value.
ProposalEvaluator(Object evaluation_limit, boolean ascending)
          Create a default proposal evaluator with a given limit value.
 
Method Summary
 ParticipantProposal[] evaluateProposals(Object cfp, Object cfp_info, NegotiationRecord[] history, ParticipantProposal[] proposals)
          Evaluate the given proposals and determine winning proposals.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVALUATION_INACCEPTABLE

public static final String EVALUATION_INACCEPTABLE
Evaluation value indicating an inacceptable proposal that should be excluded.

See Also:
Constant Field Values

EVALUATION_ACCEPTABLE

public static final String EVALUATION_ACCEPTABLE
Evaluation value indicating an acceptable proposal that should be considered in further negotiation rounds.

See Also:
Constant Field Values
Constructor Detail

ProposalEvaluator

public ProposalEvaluator(Object evaluation_limit,
                         boolean ascending)
Create a default proposal evaluator with a given limit value. This constructor can be used without overwriting any methods, if the proposal objects are comparable to each other and the limit value. Otherwise, the evaluateProposal() method should be overwritten to provide comparable evaluation values for the proposal objects.

Parameters:
evaluation_limit - The limit specifying which proposals are acceptable.
ascending - Sort order, which specifies that all evaluations below or equal (true) or above or equal (false) to the limit are acceptable.

ProposalEvaluator

public ProposalEvaluator(Comparator evaluation_comparator,
                         Object evaluation_limit,
                         boolean ascending)
Create a default proposal evaluator with a given limit value. This constructor can be used without overwriting any methods, if the proposal objects are comparable to each other and the limit value using the given comparator. Otherwise, the evaluateProposal() method should be overwritten to provide comparable evaluation values for the proposal objects.

Parameters:
evaluation_comparator - A comparator used to compare proposal evaluations.
evaluation_limit - The limit specifying which proposals are acceptable.
ascending - Sort order, which specifies that all evaluations below or equal (true) or above or equal (false) to the limit are acceptable.
Method Detail

evaluateProposals

public ParticipantProposal[] evaluateProposals(Object cfp,
                                               Object cfp_info,
                                               NegotiationRecord[] history,
                                               ParticipantProposal[] proposals)
Evaluate the given proposals and determine winning proposals.

Specified by:
evaluateProposals in interface IProposalEvaluator
Parameters:
cfp - The original call-for-proposal object.
cfp_info - Local meta information associated to the interaction.
history - The history of negotiation rounds.
proposals - The received proposals.
Returns:
The winners among the proposals.

Jadex 0.96

Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples.

Copyright (C) 2002-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.