|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbabase.ranker.AutoRanker
public class AutoRanker
A utility that allows for the automatic ranking of individual baboons within a Cage. Has varios methods that can be called to produce a list of matrix positions 0-n which would be the returned ranking for the Cage.
| Constructor Summary | |
|---|---|
AutoRanker(GUI g,
Controller c)
Constructor which takes a GUI g, in order to maintain communication with the rest of the program, and a controller c in order to have access to the Cage. |
|
| Method Summary | |
|---|---|
int |
checkInconsistancies(int[][] rankMatrix,
Ranking ranks)
|
void |
constructDG(Cage c)
Constructs a directed graph within a Cage of individuals by creating edges or connections among them to represent dominance. |
void |
createDomScore()
Find and store a domination score for all individuals in myCage Domination scores are the number of wins an individual has |
void |
createMatrixScore()
Find and store matrix scores for all the individuals in myCage Matrix scores are the number of wins less the number of losses an individual has. |
java.util.Vector<Individual> |
DFS(Cage c)
Performs a depth first search in order to get a post ordering of individuals. |
java.util.ArrayList<Cage> |
DFST(Cage c,
java.util.Vector<Individual> postorder)
Do a modified depth first search on a Cage using the post ordering as starting nodes in order to identify the strongly connected components and create an arraylist which contains them individually. |
int |
findDomScore(int row)
Finds the domination score for an individual given their row in the ranking matrix, otherwise known as the matrix position |
int |
findMatrixScore(int matrixPos)
finds the matrix score for an individual given their matrix position |
java.util.ArrayList<Cage> |
findSCC(Cage currentCage)
Finds the strongly connected components within a Cage. |
int |
findWinner(int f,
int t)
Figures which individual dominated the other when comparing the number of interactions won between them. |
boolean |
hasInteractions(int f,
int t)
Returns a boolean that is true of the individuals have had interactions |
Cage |
rankDirectedGraph(Cage currentCage)
Ranks the directed graph within a cage using the connections amongst individuals to determine who should be ranked above who. |
Cage |
RankSCC(Cage c)
Produces a Rank for a strongly connected component of individuals. |
void |
runBrockRank(int[][] rm,
Ranking r)
Runs an automatic Brock ranking that produces a ranking based upon dyadic interaction data, breaking ties using a matrix score. |
void |
runBrute(int[][] rankMatrix,
Ranking ranks)
Runs a brute force automatic ranking which runs through all possible permutations of rankings to determin which has the smallest amount of interactions below the diagonal. |
void |
runDOM(int[][] rm,
Ranking r)
Runs an automatic domination ranking that produces a ranking based on the number of wins an individual has. |
void |
search(Individual i,
java.util.Vector<Individual> postorder)
The actual depth first search implementation |
void |
searchMod(Individual i,
Cage scc,
java.util.Vector<Individual> postorder)
Performs a modified depth first search in order to find the SCCs. |
Ranking |
topologicalSort(Cage c)
Performs a topological sort on the Cage c which contains individuals connected through a directed acyclic graph. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AutoRanker(GUI g,
Controller c)
g - the GUIc - the Controller| Method Detail |
|---|
public void runDOM(int[][] rm,
Ranking r)
rm - a ranking matrixr - the current ranking
public void runBrockRank(int[][] rm,
Ranking r)
rm - a ranking matrixr - the current rankingpublic Cage rankDirectedGraph(Cage currentCage)
currentCage - a Cage to rank with individuals connected in a
directed graph
public Cage RankSCC(Cage c)
c - is the cage containing a strongly connected component of individuals
public java.util.ArrayList<Cage> findSCC(Cage currentCage)
currentCage - the cage which contain SCCs
public java.util.ArrayList<Cage> DFST(Cage c,
java.util.Vector<Individual> postorder)
c - a cage with strongly connected componentspostorder - is the post order of the initial DFS
public void searchMod(Individual i,
Cage scc,
java.util.Vector<Individual> postorder)
i - is the starting element from the post orderingscc - is the new cage to put the individuals in this SCCspostorder - is the post ordering of individuals obtained from DFSpublic java.util.Vector<Individual> DFS(Cage c)
c - the cage of individuals which to get post ordering from
public void search(Individual i,
java.util.Vector<Individual> postorder)
i - starting individual nodepostorder - a post ordering that we are constructingpublic Ranking topologicalSort(Cage c)
c - cage to be topologically sorted
public void createMatrixScore()
public void createDomScore()
public void constructDG(Cage c)
c -
public int findWinner(int f,
int t)
f - is the first individualt - is the second individual
public boolean hasInteractions(int f,
int t)
f - first individualt - second individual
public int findDomScore(int row)
row - a row in the ranking matrix, or mp
public int findMatrixScore(int matrixPos)
matrixPos - a matrix position
public void runBrute(int[][] rankMatrix,
Ranking ranks)
rankMatrix - a ranking matrix to be rankedranks - a current ranking
public int checkInconsistancies(int[][] rankMatrix,
Ranking ranks)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||