net.sourceforge.cilib.functions.discrete
Class BinaryAdapter

java.lang.Object
  extended by net.sourceforge.cilib.functions.Function
      extended by net.sourceforge.cilib.functions.DiscreteFunction
          extended by net.sourceforge.cilib.functions.discrete.BinaryAdapter
All Implemented Interfaces:
Serializable, Cloneable

public class BinaryAdapter
extends DiscreteFunction

Class to convert a binary vector into a continuous vector for optimisation of continous problems by a binary optimiser. This still needs some experimental work though, to verify that it is working

Author:
Gary Pampara
See Also:
Serialized Form

Constructor Summary
BinaryAdapter()
          Constructor.
 
Method Summary
 Vector decodeBitString(Vector bits)
           
 double evaluate(Vector vector)
          Evaluate the net.sourceforge.cilib.type.types.Vector by decoding the binary vector into a continuous vector and evaluate the results by feeding the result into the wrapped funtion.
 int getBitsPerDimension()
           
 BinaryAdapter getClone()
          Create a cloned copy of the current object and return it.
 Function getFunction()
           
 Object getMaximum()
          Accessor for the function maximum.
 Object getMinimum()
          Accessor for the function minimum.
 int getPrecision()
           
 void setBitsPerDimension(int bitsPerDimension)
           
 void setDomain(String representation)
          Sets the domain of the function.
 void setFunction(Function function)
           
 void setPrecision(int precision)
           
 double valueOf(Vector vector, int i, int j)
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryAdapter

public BinaryAdapter()
Constructor.

Method Detail

getClone

public BinaryAdapter 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 vector)
Evaluate the net.sourceforge.cilib.type.types.Vector by decoding the binary vector into a continuous vector and evaluate the results by feeding the result into the wrapped funtion.

Specified by:
evaluate in class DiscreteFunction
Parameters:
vector - The Bit vector to evaluate
Returns:
The result of the evaluation.

getMinimum

public Object getMinimum()
Description copied from class: DiscreteFunction
Accessor for the function minimum. This is the minimum value of the function in the given domain.

Overrides:
getMinimum in class DiscreteFunction
Returns:
The minimum function value.

getMaximum

public Object getMaximum()
Description copied from class: DiscreteFunction
Accessor for the function maximum. This is the maximum value of the function in the given domain.

Overrides:
getMaximum in class DiscreteFunction
Returns:
The maximum of the function.

getBitsPerDimension

public int getBitsPerDimension()
Returns:
Returns the bitsPerDimension.

setBitsPerDimension

public void setBitsPerDimension(int bitsPerDimension)
Parameters:
bitsPerDimension - The bitsPerDimension to set.

getPrecision

public int getPrecision()
Returns:
Returns the precision.

setPrecision

public void setPrecision(int precision)
Parameters:
precision - The precision to set.

getFunction

public Function getFunction()
Returns:
Returns the function.

setFunction

public void setFunction(Function function)
Parameters:
function - The function to set.

decodeBitString

public Vector decodeBitString(Vector bits)
Parameters:
bits -
Returns:

valueOf

public double valueOf(Vector vector,
                      int i,
                      int j)
Parameters:
str -
i -
j -
Returns:

setDomain

public void setDomain(String representation)
Description copied from class: Function
Sets the domain of the function.

Overrides:
setDomain in class Function
Parameters:
representation - the string representation for the function domain.


Copyright © 2009 CIRG. All Rights Reserved.