net.sourceforge.cilib.functions.discrete
Class Queens

java.lang.Object
  extended by net.sourceforge.cilib.functions.Function
      extended by net.sourceforge.cilib.functions.DiscreteFunction
          extended by 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

Constructor Summary
Queens()
           
 
Method Summary
 double evaluate(Vector x)
          Get the matrix and determine if there are any conflicts.
 int getBoardSize()
           
 Queens getClone()
          Create a cloned copy of the current object and return it.
 void setBoardSize(int boardSize)
           
 
Methods inherited from class net.sourceforge.cilib.functions.DiscreteFunction
evaluate, getMaximum, getMinimum
 
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

Queens

public Queens()
Method Detail

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.