Jadex 0.96-beta1

jadex.planlib
Class Selector

java.lang.Object
  extended by jadex.planlib.Selector
All Implemented Interfaces:
ISelector

public class Selector
extends Object
implements ISelector

Default selector implementation for evaluating a set of proposals. The proposals will be first tested on acceptability. In the second (optional) step they will be sorted according to the specified comparator/comparable. In the third step a (sub)set will be filtered out according to the specified number chooseable of resuls (choose).


Field Summary
static int ALL
          The constant for specifiying that all proposals should be chosen.
static int ONE
          The constant for specifiying that one proposal should be chosen.
 
Constructor Summary
Selector()
          Create a new selector.
Selector(Comparator comp)
          Create a new selector.
Selector(Comparator comp, int max_winners)
          Create a new selector.
Selector(int max_winners)
          Create a new selector.
 
Method Summary
 boolean isAcceptable(Object proposal)
          Test if a proposal is acceptable.
 Object[] select(Object[] proposals)
          Select proposals.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL

public static final int ALL
The constant for specifiying that all proposals should be chosen.

See Also:
Constant Field Values

ONE

public static final int ONE
The constant for specifiying that one proposal should be chosen.

See Also:
Constant Field Values
Constructor Detail

Selector

public Selector()
Create a new selector.


Selector

public Selector(Comparator comp)
Create a new selector.

Parameters:
comp - The optional comparator for sorting proposals.

Selector

public Selector(int max_winners)
Create a new selector.

Parameters:
max_winners - The number of proposals to be chosen at most.

Selector

public Selector(Comparator comp,
                int max_winners)
Create a new selector.

Parameters:
comp - The optional comparator for sorting proposals.
max_winners - The number of proposals to be chosen at most.
Method Detail

select

public Object[] select(Object[] proposals)
Select proposals.

Specified by:
select in interface ISelector
Parameters:
proposals - The proposals.
Returns:
The selected proposal(s) or none. todo: include information about negotiation history?

isAcceptable

public boolean isAcceptable(Object proposal)
Test if a proposal is acceptable.

Parameters:
proposal - The proposal.
Returns:
True, if proposal is acceptable.

Jadex 0.96-beta1

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.