|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjadex.bdi.planlib.protocols.Selector
public class Selector
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. |
protected java.util.Comparator |
comp
The comparator for comparing proposals. |
protected int |
max_winners
The max number of proposals to be chosen. |
static int |
ONE
The constant for specifiying that one proposal should be chosen. |
| Constructor Summary | |
|---|---|
Selector()
Create a new selector. |
|
Selector(java.util.Comparator comp)
Create a new selector. |
|
Selector(java.util.Comparator comp,
int max_winners)
Create a new selector. |
|
Selector(int max_winners)
Create a new selector. |
|
| Method Summary | |
|---|---|
protected java.lang.Object[] |
determineAcceptableProposals(java.lang.Object[] proposals)
Get all acceptable proposals. |
protected java.lang.Object[] |
determineWinners(java.lang.Object[] proposals)
Select proposals. |
boolean |
isAcceptable(java.lang.Object proposal)
Test if a proposal is acceptable. |
java.lang.Object[] |
select(java.lang.Object[] proposals)
Select proposals. |
protected void |
sortProposals(java.lang.Object[] proposals)
Sort the proposals. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ALL
public static final int ONE
protected java.util.Comparator comp
protected int max_winners
| Constructor Detail |
|---|
public Selector()
public Selector(java.util.Comparator comp)
comp - The optional comparator for sorting proposals.public Selector(int max_winners)
max_winners - The number of proposals to be chosen at most.
public Selector(java.util.Comparator comp,
int max_winners)
comp - The optional comparator for sorting proposals.max_winners - The number of proposals to be chosen at most.| Method Detail |
|---|
public java.lang.Object[] select(java.lang.Object[] proposals)
select in interface ISelectorproposals - The proposals.
protected java.lang.Object[] determineAcceptableProposals(java.lang.Object[] proposals)
proposals - The proposals.
protected void sortProposals(java.lang.Object[] proposals)
proposals - The proposals to sort.protected java.lang.Object[] determineWinners(java.lang.Object[] proposals)
proposals - The proposals.
public boolean isAcceptable(java.lang.Object proposal)
proposal - The proposal.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||