public class SwissSystem extends AbstractRanking
Constructor and Description |
---|
SwissSystem() |
Modifier and Type | Method and Description |
---|---|
void |
addResult(int whoId,
int against,
int res)
Adds result to the tournament
|
java.awt.Point |
consumeNextGame()
Returns the next game then removes it from the buffer
|
SwissElement |
getElementWithId(int whoId)
Returns the element with the given id from the maintable
|
java.util.List<java.lang.Integer> |
getResults()
Returns a list enumerating the players in a descending order starting
with the one having the most points
|
int |
getTiePoint() |
int |
getWinPoint() |
int |
sortCandidates(java.util.ArrayList<AbstractRepresentation> pop,
ProblemXMLData problem,
java.util.Random random)
Sorts the given array of representations in a descending order of fitness and returns the number of evaluation that was required for the ranking to finish.
|
getProperties, getPropertyValue, getTypeOfProperty, getXMLData, setProperties, setXMLData
public int sortCandidates(java.util.ArrayList<AbstractRepresentation> pop, ProblemXMLData problem, java.util.Random random)
AbstractRanking
sortCandidates
in class AbstractRanking
pop
- The population to be sorted.problem
- The problem descriptor to be used for evaluation.random
- The random generator object used for sorting.public java.util.List<java.lang.Integer> getResults()
public void addResult(int whoId, int against, int res)
whoId
- against
- res
- +1 means a win, -1 a loss, 0 a tiepublic java.awt.Point consumeNextGame()
public int getWinPoint()
public int getTiePoint()
public SwissElement getElementWithId(int whoId)
whoId
-