public class IntegerRepresentation extends Representation<int[]>
Constructor and Description |
---|
IntegerRepresentation(int size)
Constructor.
|
IntegerRepresentation(int[] x)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Representation<int[]> |
duplicate()
Duplicates the representation.
|
boolean |
equals(java.lang.Object obj) |
void |
generate(int min,
int max)
Generates a random instance of the problem
|
int |
getSize()
Returns the size of the solution vector.
|
int[] |
getSolution()
Returns the solution vector.
|
int |
hashCode() |
void |
setSolution(int[] x)
Replaces the solution vector.
|
java.lang.String |
toString() |
public IntegerRepresentation(int size)
size
- the size of the Integer representationpublic IntegerRepresentation(int[] x)
x
- the solution vectorpublic void generate(int min, int max)
min
- the minimum intmax
- the maximum intpublic int getSize()
Representation
getSize
in class Representation<int[]>
public int[] getSolution()
Representation
getSolution
in class Representation<int[]>
public void setSolution(int[] x)
Representation
setSolution
in class Representation<int[]>
x
- the solution vector.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public Representation<int[]> duplicate()
Representation
duplicate
in class Representation<int[]>
public int hashCode()
hashCode
in class java.lang.Object