public abstract class Algorithm
extends java.lang.Object
implements java.io.Serializable
execute
, which defines
the behavior of the algorithm.Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
inputParameters_
Stores algorithm specific parameters.
|
protected java.util.Map<java.lang.String,Operator> |
operators_
Stores the operators used by the algorithm, such as selection, crossover,
etc.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
outPutParameters_
Stores output parameters, which are retrieved by Main object to obtain
information from an algorithm.
|
protected Problem |
problem_
Stores the problem to solve
|
Modifier and Type | Method and Description |
---|---|
void |
addOperator(java.lang.String name,
Operator operator)
Offers facilities for add new operators for the algorithm.
|
abstract SolutionSet |
execute()
Launches the execution of an specific algorithm.
|
java.lang.Object |
getInputParameter(java.lang.String name)
Gets an input parameter through its name.
|
Operator |
getOperator(java.lang.String name)
Gets an operator through his name.
|
java.lang.Object |
getOutputParameter(java.lang.String name)
Gets an output parameter through its name.
|
Problem |
getProblem()
Returns the problem to solve
|
void |
setInputParameter(java.lang.String name,
java.lang.Object object)
Sets an input parameter to an algorithm.
|
void |
setOutputParameter(java.lang.String name,
java.lang.Object object)
Sets an output parameter that can be obtained by invoking
getOutputParame . |
protected Problem problem_
protected java.util.Map<java.lang.String,Operator> operators_
protected java.util.Map<java.lang.String,java.lang.Object> inputParameters_
protected java.util.Map<java.lang.String,java.lang.Object> outPutParameters_
public Algorithm(Problem problem)
problem
- public abstract SolutionSet execute() throws JMException, java.lang.ClassNotFoundException
SolutionSet
that is a set of non dominated
solutions as a result of the algorithm executionjava.lang.Exception
JMException
java.lang.ClassNotFoundException
public void addOperator(java.lang.String name, Operator operator)
getOperator
method.name
- The operator nameoperator
- The operatorpublic Operator getOperator(java.lang.String name)
name
- The operator namepublic void setInputParameter(java.lang.String name, java.lang.Object object)
getInputParameter
method.name
- The parameter nameobject
- Object that represent a parameter for the algorithm.public java.lang.Object getInputParameter(java.lang.String name)
name
- The parameter namepublic void setOutputParameter(java.lang.String name, java.lang.Object object)
getOutputParame
. Typically this algorithm is invoked by an
algorithm at the end of the execute
to retrieve output
informationname
- The output parameter nameobject
- Object representing the output parameterpublic java.lang.Object getOutputParameter(java.lang.String name)
name
- The output parameter namepublic Problem getProblem()