|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.functions.Function net.sourceforge.cilib.functions.DiscreteFunction net.sourceforge.cilib.functions.discrete.KnightsTour
public class KnightsTour
An implementation of the Knight's Tour problem function. It is important to note that this implementation implements a repair to the evaluation of the potential solution. The reasoning behind this is that the knight all too often during the testing phase would jump off the board and remain off the board. The repair is a simple in-order operation that determines the position where the error occoured and tries to replace the error move with one of the possible 7 moves remaining. Once the tour can continue, the move is replaced and evaluation continues.
Constructor Summary | |
---|---|
KnightsTour()
|
Method Summary | |
---|---|
double |
evaluate(Vector x)
Evaluate the function output, given the function input, x . |
int |
getBoardSize()
|
KnightsTour |
getClone()
Create a cloned copy of the current object and return it. |
Object |
getMaximum()
Accessor for the function maximum. |
Object |
getMinimum()
Accessor for the function minimum. |
String |
getStartingPos()
|
boolean |
isCyclic()
|
void |
setBoardSize(int boardSize)
|
void |
setCyclic(boolean cyclic)
|
void |
setStartingPos(String startingPos)
Set the starting position on the board. |
Methods inherited from class net.sourceforge.cilib.functions.DiscreteFunction |
---|
evaluate |
Methods inherited from class net.sourceforge.cilib.functions.Function |
---|
getBehavioralDomainRegistry, getDimension, getDomain, getDomainRegistry, setBehavioralDomain, setBehaviouralDomainRegistry, setDomain |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KnightsTour()
Method Detail |
---|
public KnightsTour getClone()
Cloneable
Object.clone()
public Object getMaximum()
DiscreteFunction
getMaximum
in class DiscreteFunction
public Object getMinimum()
DiscreteFunction
getMinimum
in class DiscreteFunction
public double evaluate(Vector x)
DiscreteFunction
x
.
evaluate
in class DiscreteFunction
x
- The Vector representing the function input.
public int getBoardSize()
public void setBoardSize(int boardSize)
boardSize
- The boardSize to set.public boolean isCyclic()
public void setCyclic(boolean cyclic)
cyclic
- The cyclic to set.public String getStartingPos()
public void setStartingPos(String startingPos)
startingPos
- The startingPos to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |