net.sourceforge.cilib.functions.discrete
Class Queens
java.lang.Object
net.sourceforge.cilib.functions.Function
net.sourceforge.cilib.functions.DiscreteFunction
net.sourceforge.cilib.functions.discrete.Queens
- All Implemented Interfaces:
- Serializable, Cloneable
public class Queens
- extends DiscreteFunction
Implementation of the a function to return the fitness of the Queens problem.
The function class only determines the fitness of the solution by determining
the number of conflicts and penalises the fitness if there are.
- Author:
- Gary Pampara
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Queens
public Queens()
getClone
public Queens getClone()
- Description copied from interface:
Cloneable
- Create a cloned copy of the current object and return it. In general
the created copy will be a deep copy of the provided instance. As
a result this operation an be quite expensive if used incorrectly.
- Returns:
- An exact clone of the current object instance.
- See Also:
Object.clone()
evaluate
public double evaluate(Vector x)
- Get the matrix and determine if there are any conflicts. If there are no
conflicts...
For every direction, there should be no conflicts. Move queen until
you run off board
- Specified by:
evaluate
in class DiscreteFunction
- Parameters:
x
-
- Returns:
- The result of the evaluation.
getBoardSize
public int getBoardSize()
- Returns:
- Returns the boardSize.
setBoardSize
public void setBoardSize(int boardSize)
- Parameters:
boardSize
- The boardSize to set.
Copyright © 2009 CIRG. All Rights Reserved.