net.sourceforge.cilib.coevolution.score
Class EntityScore

java.lang.Object
  extended by net.sourceforge.cilib.coevolution.score.EntityScore

public class EntityScore
extends Object

This class is used to store history of competitions the entity stored in this class against one other specific entity.

Author:
cornelius gouws, leo
See Also:
EntityScoreboard

Constructor Summary
EntityScore(int round, int competitorGroup)
          Create a CoevolutionEntityScore for the given entity.
 
Method Summary
 void draw(Fitness score)
          Indicate that the entity that is contained in this EntityScore has drawn.
 boolean equals(Object obj)
          
 int getCompetitorGroup()
           
 int getDrawCount()
          Get the number of times this entity drew.
 int getLoseCount()
          Get the number of times this entity lost
 int getPlayCount()
          Get the number of games played
 int getRound()
           
 ArrayList<Fitness> getRoundsDrawn()
          Get a list of all the rounds the entity has drawn.
 ArrayList<Fitness> getRoundsLost()
          Get a list of all the rounds the entity has lost.
 ArrayList<Fitness> getRoundsWon()
          Get a list of all the rounds the entity has won.
 int getWinCount()
          Get the number of times this entity won
 int hashCode()
          
 void lose(Fitness score)
          Indicate that the entity that is contained in this EntityScore has been defeated.
 void mergeScoreBoard(EntityScore other)
          Merge this scoreboard with another one
 void win(Fitness score)
          Indicate that the entity that is contained in this CoevolutionEntityScore won.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityScore

public EntityScore(int round,
                   int competitorGroup)
Create a CoevolutionEntityScore for the given entity.

Parameters:
entity - The entity that should be kept score of.
Method Detail

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

win

public void win(Fitness score)
Indicate that the entity that is contained in this CoevolutionEntityScore won.

Parameters:
score - The Fitness achieved

lose

public void lose(Fitness score)
Indicate that the entity that is contained in this EntityScore has been defeated.

Parameters:
score - the Fitness achieved

draw

public void draw(Fitness score)
Indicate that the entity that is contained in this EntityScore has drawn.

Parameters:
round - The round that the entity drawed.

getWinCount

public int getWinCount()
Get the number of times this entity won

Returns:
The number of times this entiy won.

getLoseCount

public int getLoseCount()
Get the number of times this entity lost

Returns:
The number of times this entity lost

getDrawCount

public int getDrawCount()
Get the number of times this entity drew.

Returns:
The number of times this entity has drawn.

getPlayCount

public int getPlayCount()
Get the number of games played

Returns:
The trtal number of games played

mergeScoreBoard

public void mergeScoreBoard(EntityScore other)
Merge this scoreboard with another one

Parameters:
other - the other scoreboard

getRoundsDrawn

public ArrayList<Fitness> getRoundsDrawn()
Get a list of all the rounds the entity has drawn.

Returns:
The rounds the entity drawn.

getRoundsLost

public ArrayList<Fitness> getRoundsLost()
Get a list of all the rounds the entity has lost.

Returns:
The rounds the entity lost.

getRoundsWon

public ArrayList<Fitness> getRoundsWon()
Get a list of all the rounds the entity has won.

Returns:
The rounds the entity has won.

getRound

public int getRound()

getCompetitorGroup

public int getCompetitorGroup()


Copyright © 2009 CIRG. All Rights Reserved.