Orbital library

orbital.algorithm.template
Class DynamicProgrammingOptimizingProblem

java.lang.Object
  extended by orbital.algorithm.template.DynamicProgrammingOptimizingProblem
All Implemented Interfaces:
java.io.Serializable, AlgorithmicProblem, DynamicProgrammingProblem

public abstract class DynamicProgrammingOptimizingProblem
extends java.lang.Object
implements DynamicProgrammingProblem, java.io.Serializable

Base hook class for problems solved by DynamicProgramming for optimization.

Author:
André Platzer
See Also:
Serialized Form

Constructor Summary
DynamicProgrammingOptimizingProblem()
           
 
Method Summary
abstract  java.util.Collection getOptionsFor(int[] part)
          Get the options available to optimize for the given part.
 double getPartialWeight(int[] part)
          Get the partial weight corresponding to the part specification.
 java.lang.Object[] getPartialWeights()
          Get the partial weights memorized analogue to partialSolutions.
abstract  Function getWeightingFor(int[] part)
          Get an objective function.
 void init(java.lang.Object[] weights)
          Initialize weights as the specified (possibly multidimensional) array of number-objects.
 java.lang.Object solve(int[] part, java.lang.Object[] partialSolutions)
          Solve the problem part using the partial solutions we already now.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface orbital.algorithm.template.DynamicProgrammingProblem
getInitialPartialSolutions, isSolution, merge, nextPart
 

Constructor Detail

DynamicProgrammingOptimizingProblem

public DynamicProgrammingOptimizingProblem()
Method Detail

init

public void init(java.lang.Object[] weights)
Initialize weights as the specified (possibly multidimensional) array of number-objects. This should be called in the implementation of DynamicProgrammingProblem.getInitialPartialSolutions().


getPartialWeight

public double getPartialWeight(int[] part)
Get the partial weight corresponding to the part specification.


getPartialWeights

public java.lang.Object[] getPartialWeights()
Get the partial weights memorized analogue to partialSolutions.


getOptionsFor

public abstract java.util.Collection getOptionsFor(int[] part)
Get the options available to optimize for the given part.


getWeightingFor

public abstract Function getWeightingFor(int[] part)
Get an objective function.

If the weighting never changes for this problem, consider using a single weighting instance instead of creating a new one on each call. This will increase efficiency.

The parameter passed to the function is the current situation of choices.

Returns:
the objective weighting function. It will only be used upto the next call of this function.
Preconditions:
choices is a valid partial solution.
Postconditions:
RES the objective weighting function for the current situation of choices which will only be used upto the next call of this function.

solve

public java.lang.Object solve(int[] part,
                              java.lang.Object[] partialSolutions)
Description copied from interface: DynamicProgrammingProblem
Solve the problem part using the partial solutions we already now.

Specified by:
solve in interface DynamicProgrammingProblem
Returns:
the solution for this case.
See Also:
DynamicProgrammingProblem.nextPart()

Orbital library
1.3.0: 11 Apr 2009

Copyright © 1996-2009 André Platzer
All Rights Reserved.