|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.problem.MOFitness
public class MOFitness
Constructor Summary | |
---|---|
MOFitness(MOFitness copy)
|
|
MOFitness(MOOptimisationProblem problem,
Type[] solution,
boolean count)
|
|
MOFitness(MOOptimisationProblem problem,
Type solution,
boolean count)
|
Method Summary | |
---|---|
int |
compareTo(Fitness other)
Compare the current fitness instance to the provided instance. |
boolean |
dominates(MOFitness other)
|
boolean |
equals(Object obj)
Compare the specified object with this type for equality. |
MOFitness |
getClone()
Create a cloned copy of the current object and return it. |
int |
getDimension()
|
Fitness |
getFitness(int index)
|
Double |
getValue()
Returns the underlying fitness value. |
int |
hashCode()
Returns the hash code value for this list. |
Fitness |
newInstance(Double value)
Creation method that maintains Fitness object immutability by returning a new instance of the current class type. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MOFitness(MOOptimisationProblem problem, Type[] solution, boolean count)
public MOFitness(MOOptimisationProblem problem, Type solution, boolean count)
public MOFitness(MOFitness copy)
Method Detail |
---|
public MOFitness getClone()
Fitness
getClone
in interface Fitness
getClone
in interface Type
getClone
in interface Cloneable
Object.clone()
public Double getValue()
Fitness
getValue
in interface Fitness
public final Fitness newInstance(Double value)
newInstance
in interface Fitness
value
- The desired value of the Fitness
object.public Fitness getFitness(int index)
public int getDimension()
public boolean dominates(MOFitness other)
public int compareTo(Fitness other)
compareTo
in interface Comparable<Fitness>
compareTo
in interface Fitness
other
- The fitness to be compared.
Comparable
public int hashCode()
int hashCode = 7; Iterator<E> i = list.iterator(); while (i.hasNext()) { E obj = i.next(); hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode()); }This ensures that type1.equals(type2) implies that type1.hashCode()==type2.hashCode() for any two types, type1 and type2, as required by the general contract of
Object.hashCode()
.
hashCode
in interface Type
hashCode
in class Object
Object.equals(Object)
,
Type.equals(Object)
public boolean equals(Object obj)
true
if and only if the specified object is also an instance
of the same type.
equals
in interface Type
equals
in class Object
obj
- The object to compare.
true
if equality exists, false
otherwise.Object.equals(Object)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |