// Path: src/jmetal/util/JMException.java
// public class JMException extends Exception implements Serializable {
//   
//   /**
//    * Constructor
//    * @param Error message
//    */
//   public JMException (String message){
//      super(message);      
//   } // JmetalException
// }


import jmetal.util.JMException;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
//  Algorithm.java
//
//  Authors:
//       Antonio J. Nebro <antonio@lcc.uma.es>
//       Juan J. Durillo <durillo@lcc.uma.es>
//// 
//  Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo
//
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU Lesser General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU Lesser General Public License for more details.
// 
//  You should have received a copy of the GNU Lesser General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.

package jmetal.core;




/**
 * This class implements a generic template for the algorithms developed in
 * jMetal. Every algorithm must have a mapping between the parameters and and
 * their names, and another mapping between the operators and their names. The
 * class declares an abstract method called <code>execute</code>, which defines
 * the behavior of the algorithm.
 */
public abstract class Algorithm implements Serializable {


	/**
	 * Stores the problem to solve
	 */
	protected Problem problem_;

	/**
	 * Stores the operators used by the algorithm, such as selection, crossover,
	 * etc.
	 */
	protected Map<String, Operator> operators_ = null;

	/**
	 * Stores algorithm specific parameters. For example, in NSGA-II these
	 * parameters include the population size and the maximum number of function
	 * evaluations.
	 */
	protected Map<String, Object> inputParameters_ = null;

	/**
	 * Stores output parameters, which are retrieved by Main object to obtain
	 * information from an algorithm.
	 */
	private Map<String, Object> outPutParameters_ = null;

	/**
	 * Constructor
	 * 
	 * @param problem
	 *            The problem to be solved
	 */
	public Algorithm(Problem problem) {
		problem_ = problem;
	}

	/**
	 * Launches the execution of an specific algorithm.
	 * 
	 * @return a <code>SolutionSet</code> that is a set of non dominated
	 *         solutions as a result of the algorithm execution
	 */
// Path: src/jmetal/util/JMException.java
// public class JMException extends Exception implements Serializable {
//   
//   /**
//    * Constructor
//    * @param Error message
//    */
//   public JMException (String message){
//      super(message);      
//   } // JmetalException
// }


// Path: src/jmetal/core/Algorithm.java
import jmetal.util.JMException;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

//  Algorithm.java
//
//  Authors:
//       Antonio J. Nebro <antonio@lcc.uma.es>
//       Juan J. Durillo <durillo@lcc.uma.es>
//// 
//  Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo
//
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU Lesser General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU Lesser General Public License for more details.
// 
//  You should have received a copy of the GNU Lesser General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.

package jmetal.core;




/**
 * This class implements a generic template for the algorithms developed in
 * jMetal. Every algorithm must have a mapping between the parameters and and
 * their names, and another mapping between the operators and their names. The
 * class declares an abstract method called <code>execute</code>, which defines
 * the behavior of the algorithm.
 */
public abstract class Algorithm implements Serializable {


	/**
	 * Stores the problem to solve
	 */
	protected Problem problem_;

	/**
	 * Stores the operators used by the algorithm, such as selection, crossover,
	 * etc.
	 */
	protected Map<String, Operator> operators_ = null;

	/**
	 * Stores algorithm specific parameters. For example, in NSGA-II these
	 * parameters include the population size and the maximum number of function
	 * evaluations.
	 */
	protected Map<String, Object> inputParameters_ = null;

	/**
	 * Stores output parameters, which are retrieved by Main object to obtain
	 * information from an algorithm.
	 */
	private Map<String, Object> outPutParameters_ = null;

	/**
	 * Constructor
	 * 
	 * @param problem
	 *            The problem to be solved
	 */
	public Algorithm(Problem problem) {
		problem_ = problem;
	}

	/**
	 * Launches the execution of an specific algorithm.
	 * 
	 * @return a <code>SolutionSet</code> that is a set of non dominated
	 *         solutions as a result of the algorithm execution
	 */
	public abstract SolutionSet execute() throws JMException,