jmetal.core
Class Operator

java.lang.Object
  extended by jmetal.core.Operator
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Crossover, LocalSearch, Mutation, Selection

public abstract class Operator
extends java.lang.Object
implements java.io.Serializable

Class representing an operator

See Also:
Serialized Form

Field Summary
protected  java.util.Map<java.lang.String,java.lang.Object> parameters_
          Stores the current operator parameters.
 
Constructor Summary
Operator(java.util.HashMap<java.lang.String,java.lang.Object> parameters)
          Constructor.
 
Method Summary
abstract  java.lang.Object execute(java.lang.Object object)
          Abstract method that must be defined by all the operators.
 java.lang.Object getParameter(java.lang.String name)
          Returns an object representing a parameter of the Operator
 void setParameter(java.lang.String name, java.lang.Object value)
          Sets a new Object parameter to the operator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parameters_

protected final java.util.Map<java.lang.String,java.lang.Object> parameters_
Stores the current operator parameters. It is defined as a Map of pairs <String, Object>, and it allow objects to be accessed by their names, which are specified by the string.

Constructor Detail

Operator

public Operator(java.util.HashMap<java.lang.String,java.lang.Object> parameters)
Constructor.

Method Detail

execute

public abstract java.lang.Object execute(java.lang.Object object)
                                  throws JMException
Abstract method that must be defined by all the operators. When invoked, this method executes the operator represented by the current object.

Parameters:
object - This param inherits from Object to allow different kinds of parameters for each operator. For example, a selection operator typically receives a SolutionSet as a parameter, while a mutation operator receives a Solution.
Returns:
An object reference. The returned value depends on the operator.
Throws:
JMException

setParameter

public void setParameter(java.lang.String name,
                         java.lang.Object value)
Sets a new Object parameter to the operator.

Parameters:
name - The parameter name.
value - Object representing the parameter.

getParameter

public java.lang.Object getParameter(java.lang.String name)
Returns an object representing a parameter of the Operator

Parameters:
name - The parameter name.
Returns:
the parameter.