|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--Member
| Field Summary | |
static int |
NUM_OF_ATTRIBUTES
The number of attributes each member has. |
| Constructor Summary | |
Member()
|
|
| Method Summary | |
java.lang.String |
display()
Returns a binary representation of the member's attributes. |
double |
fitness()
Calculates the fitness of the member. |
boolean[] |
getAttributes()
Returns the boolean attributes of the member. |
double |
getProbability()
Returns the probability of the member. |
void |
Member()
Creates the member. |
void |
mutate()
Mutates the member by randomly toggling one of its attributes. |
void |
setAttributeAt(int i,
boolean b)
Sets the boolean attributes i of the member to b. |
void |
setAttributes()
Randomly selects a boolean value for the member. |
void |
setProbability(double p)
Sets the probability associated with the member. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int NUM_OF_ATTRIBUTES
| Constructor Detail |
public Member()
| Method Detail |
public void Member()
public void setAttributes()
public double fitness()
public void setProbability(double p)
p - The probability associated with the member.public double getProbability()
public boolean[] getAttributes()
public void setAttributeAt(int i,
boolean b)
i - The attribute to be set.b - The boolean value.public void mutate()
public java.lang.String display()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||