net.sourceforge.cilib.entity
Class CandidateSolutionMixin

java.lang.Object
  extended by net.sourceforge.cilib.entity.CandidateSolutionMixin
All Implemented Interfaces:
Serializable, CandidateSolution, Cloneable

public class CandidateSolutionMixin
extends Object
implements CandidateSolution

A CandidateSolution is a potential solution within an optimization.

CandidateSolution is a base class that all concrete Entity instances inherit from. All Entity objects have their respective contents represented and maintained within the Blackboard as defined by the CandidateSolution.

See Also:
Serialized Form

Constructor Summary
CandidateSolutionMixin()
          Create the Mixin class, providing the reference to the shared Blackboard data structure.
CandidateSolutionMixin(CandidateSolutionMixin copy)
          Instantiate a new instance, based on the provided CandidateSolutionMixin.
 
Method Summary
 boolean equals(Object obj)
          
 StructuredType getCandidateSolution()
          Get the associated candidate solution representation that the current Entity represents.
 CandidateSolutionMixin getClone()
          Get a clone of the current CandidateSolutionMixin.
 Fitness getFitness()
          Obtain the Fitness of the current CandidateSolution.
 Blackboard<Enum<?>,Type> getProperties()
          Get the properties associated with this CandidateSolution.
 int hashCode()
          
 void setCandidateSolution(StructuredType candidateSolution)
          Set the solution that the CandidateSolution represents.
 void setProperties(Blackboard<Enum<?>,Type> properties)
          Set the Blackboard defining the properties of the CandidateSolution.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CandidateSolutionMixin

public CandidateSolutionMixin()
Create the Mixin class, providing the reference to the shared Blackboard data structure.


CandidateSolutionMixin

public CandidateSolutionMixin(CandidateSolutionMixin copy)
Instantiate a new instance, based on the provided CandidateSolutionMixin. This is a shallow copy instantiation.

Parameters:
copy - The template object to copy.
Method Detail

getClone

public CandidateSolutionMixin getClone()
Get a clone of the current CandidateSolutionMixin.

Specified by:
getClone in interface Cloneable
Returns:
A shallow clone of the current object - The Blackboard is not cloned.
See Also:
Object.clone()

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

getCandidateSolution

public StructuredType getCandidateSolution()
Get the associated candidate solution representation that the current Entity represents.

Specified by:
getCandidateSolution in interface CandidateSolution
Returns:
A Type representing the solution of the Entity

setCandidateSolution

public void setCandidateSolution(StructuredType candidateSolution)
Set the solution that the CandidateSolution represents.

Specified by:
setCandidateSolution in interface CandidateSolution
Parameters:
candidateSolution - The potential solution to set.

getFitness

public Fitness getFitness()
Obtain the Fitness of the current CandidateSolution.

Specified by:
getFitness in interface CandidateSolution
Returns:
The current Fitness value.

getProperties

public Blackboard<Enum<?>,Type> getProperties()
Get the properties associated with this CandidateSolution.

Specified by:
getProperties in interface CandidateSolution
Returns:
The properties of the CandidateSolution.

setProperties

public void setProperties(Blackboard<Enum<?>,Type> properties)
Set the Blackboard defining the properties of the CandidateSolution.

Specified by:
setProperties in interface CandidateSolution
Parameters:
properties - The properties to set.


Copyright © 2009 CIRG. All Rights Reserved.