Orbital library

orbital.algorithm.template
Class AlgorithmicTemplate.Configuration

java.lang.Object
  extended by orbital.algorithm.template.AlgorithmicTemplate.Configuration
All Implemented Interfaces:
java.io.Serializable, AlgorithmicConfiguration
Direct Known Subclasses:
GeneticAlgorithm.Configuration, HeuristicAlgorithm.Configuration
Enclosing interface:
AlgorithmicTemplate

public static class AlgorithmicTemplate.Configuration
extends java.lang.Object
implements AlgorithmicConfiguration, java.io.Serializable

Default implementation of algorithmic configuration objects. Does not yet provide any additional parameters which would really justify the use of algorithmic configurations because of their benefits. Instead, this class is used as the base class for such algorithmic configuration implementations.

Author:
André Platzer
See Also:
Serialized Form

Constructor Summary
  AlgorithmicTemplate.Configuration(AlgorithmicProblem problem, java.lang.Class algorithm)
          Create a new configuration.
protected AlgorithmicTemplate.Configuration(AlgorithmicProblem problem, java.lang.Class algorithm, java.lang.Class superClass)
          Create a new configuration limited to certain classes of algorithms.
 
Method Summary
static AlgorithmicTemplate.Configuration flexible(AlgorithmicProblem problem, java.util.Map properties, java.lang.Class algorithm)
          Create a new flexible configuration.
 AlgorithmicTemplate getAlgorithm()
          Gets the algorithm used for solving the problem.
 AlgorithmicProblem getProblem()
          Gets the specific problem to solve.
 java.lang.Object solve()
          Solves the problem with the algorithm with regard to the additional parameters managed by this algorithmic configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlgorithmicTemplate.Configuration

public AlgorithmicTemplate.Configuration(AlgorithmicProblem problem,
                                         java.lang.Class algorithm)
Create a new configuration.

Parameters:
problem - the problem to solve.
algorithm - the class of the AlgorithmicTemplate to instantiate for solving the problem.

AlgorithmicTemplate.Configuration

protected AlgorithmicTemplate.Configuration(AlgorithmicProblem problem,
                                            java.lang.Class algorithm,
                                            java.lang.Class superClass)
Create a new configuration limited to certain classes of algorithms.

Parameters:
problem - the problem to solve.
algorithm - the class of the AlgorithmicTemplate to instantiate for solving the problem.
superClass - the class which algorithm must be a subclass of.
Method Detail

getProblem

public AlgorithmicProblem getProblem()
Description copied from interface: AlgorithmicConfiguration
Gets the specific problem to solve.

Specified by:
getProblem in interface AlgorithmicConfiguration

getAlgorithm

public AlgorithmicTemplate getAlgorithm()
Description copied from interface: AlgorithmicConfiguration
Gets the algorithm used for solving the problem.

Specified by:
getAlgorithm in interface AlgorithmicConfiguration
Returns:
the algorithm, with our additional parameters already adjusted.

solve

public java.lang.Object solve()
Description copied from interface: AlgorithmicConfiguration
Solves the problem with the algorithm with regard to the additional parameters managed by this algorithmic configuration.

Specified by:
solve in interface AlgorithmicConfiguration
Returns:
the solution to the problem AlgorithmicConfiguration.getProblem() by using the algorithm AlgorithmicConfiguration.getAlgorithm() after adjusting our additional parameters.
See Also:
Convenience method

flexible

public static final AlgorithmicTemplate.Configuration flexible(AlgorithmicProblem problem,
                                                               java.util.Map properties,
                                                               java.lang.Class algorithm)
                                                        throws java.beans.IntrospectionException
Create a new flexible configuration. Flexible implementation of algorithmic configuration objects with properties at runtime. This implementation will dynamically set the given bean property values at runtime.

Parameters:
problem - the problem to solve.
properties - the property values used for configuring the algorithm. A Map<String,Object> mapping property names to their values.
algorithm - the class of the AlgorithmicTemplate to instantiate for solving the problem.
Throws:
java.beans.IntrospectionException - if algorithm could not be introspected.

Orbital library
1.3.0: 11 Apr 2009

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