public class BinaryRepresentation extends Representation<java.util.BitSet>
Constructor and Description |
---|
BinaryRepresentation(java.util.BitSet x,
int size)
Constructor.
|
BinaryRepresentation(boolean[] x)
Constructor.
|
BinaryRepresentation(int size)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Representation<java.util.BitSet> |
duplicate()
Duplicates the representation.
|
boolean |
equals(java.lang.Object obj) |
void |
generate()
Generates a random new instance of the problem.
|
int |
getSize()
Returns the size of the solution vector.
|
java.util.BitSet |
getSolution()
Returns the solution vector.
|
int |
hashCode() |
void |
setSolution(java.util.BitSet x)
Replaces the solution vector.
|
java.lang.String |
toString() |
public BinaryRepresentation(int size)
size
- the size of the Binary representationpublic BinaryRepresentation(java.util.BitSet x, int size)
x
- the solution vectorsize
- the size of the Binary representationpublic BinaryRepresentation(boolean[] x)
x
- the solution vectorpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void generate()
public int getSize()
Representation
getSize
in class Representation<java.util.BitSet>
public java.util.BitSet getSolution()
Representation
getSolution
in class Representation<java.util.BitSet>
public void setSolution(java.util.BitSet x)
Representation
setSolution
in class Representation<java.util.BitSet>
x
- the solution vector.public Representation<java.util.BitSet> duplicate()
Representation
duplicate
in class Representation<java.util.BitSet>
public int hashCode()
hashCode
in class java.lang.Object