org.coinor.opents
Interface Solution

All Superinterfaces:
java.lang.Cloneable, java.io.Serializable
All Known Implementing Classes:
SolutionAdapter

public interface Solution
extends java.lang.Cloneable, java.io.Serializable

This is the interface to implement when creating your own solution definitions. It is usually easier to extend the SolutionAdapter class instead which will handle these three required methods, including properly cloning the array of objective values.

It is essential that you still implement your own clone() method and clone whatever custom properties you have in your solution definition.

For an excellent discussion of cloning techniques, see the Java Developer Connection Tech Tip http://developer.java.sun.com/developer/JDCTechTips/2001/tt0306.html.

This code is licensed for public use under the Common Public License version 0.5.
The Common Public License, developed by IBM and modeled after their industry-friendly IBM Public License, differs from other common open source licenses in several important ways:

Copyright © 2001 Robert Harder

Since:
1.0b

Method Summary
 java.lang.Object clone()
          An essential Java method that returns of copy of the object.
 double[] getObjectiveValue()
          If the value has been set for this solution, then the value will be returned.
 void setObjectiveValue(double[] objValue)
          Generally used by the TabuSearch to set the value of the objective function and set objectiveValid to true.
 

Method Detail

getObjectiveValue

public double[] getObjectiveValue()
If the value has been set for this solution, then the value will be returned. Be careful if this returns null since this may indicate that the TabuSearch has not yet set the solution's value.

Returns:
The value of the solution
Since:
1.0

setObjectiveValue

public void setObjectiveValue(double[] objValue)
Generally used by the TabuSearch to set the value of the objective function and set objectiveValid to true.

Parameters:
objValue - The objective function value
Since:
1.0

clone

public java.lang.Object clone()
An essential Java method that returns of copy of the object. This should do whatever is necessary to ensure that the returned Solution is identical to this For an excellent discussion of cloning techniques, see the Java Developer Connection Tech Tip http://developer.java.sun.com/developer/JDCTechTips/2001/tt0306.html.

Returns:
A copy of this.
Since:
1.0
See Also:
Cloneable