/// <summary> /// Constructor /// </summary> public Solution () { problem_ = null; overallConstraintViolation_ = 0.0; numberOfViolatedConstraints_ = 0; type_ = null; variable_ = null; objective_ = null; }
public RealSolutionType (Problem problem) : base(problem) { // <pex> if (problem == (Problem)null) throw new ArgumentNullException("problem"); // </pex> problem.variableType_ = new Type[problem.numberOfVariables_]; problem.solutionType_ = this; // Initializing the types of the variables for (int i = 0; i < problem.numberOfVariables_; i++) { problem.variableType_[i] = System.Type.GetType ("jmetal.core.variable.Real"); //problem.variableType_[i] = this.GetType (); } // for }
// Solution /// <summary> /// Constructor /// </summary> /// <param name="problem"> Problem to solve /// A <see cref="Problem"/> /// </param> public Solution (Problem problem) { // <pex> if (problem == (Problem)null) throw new ArgumentNullException("problem"); if (problem.solutionType_ == (SolutionType)null) throw new ArgumentNullException("problem"); // </pex> problem_ = problem; type_ = problem.solutionType_; numberOfObjectives_ = problem_.numberOfObjectives_; objective_ = new double[numberOfObjectives_]; // Setting initial values crowdingDistance_ = 0.0; variable_ = problem.solutionType_.createVariables () ; }
/// <summary> /// Constructor /// </summary> /// <param name="problem"> /// A <see cref="Problem"/> /// </param> public Algorithm (Problem problem):this() { problem_ = problem; }
public NSGAII(Problem problem) : base(problem) { }
// Solution /// <summary> /// Copy constructor /// </summary> /// <param name="solution"> /// A <see cref="Solution"/> /// </param> public Solution (Solution solution) { // <pex> if (solution == (Solution)null) throw new ArgumentNullException("solution"); if (solution.type_ == (SolutionType)null) throw new ArgumentNullException("solution"); // </pex> problem_ = solution.problem_; type_ = solution.type_; numberOfObjectives_ = solution.numberOfObjectives_; objective_ = new double[numberOfObjectives_]; for (int i = 0; i < numberOfObjectives_; i++) { objective_[i] = solution.objective_[i]; } // for //<- variable_ = type_.copyVariables (solution.variable_); overallConstraintViolation_ = solution.overallConstraintViolation_; numberOfViolatedConstraints_ = solution.numberOfViolatedConstraints_; //distanceToSolutionSet_ = solution.getDistanceToSolutionSet(); crowdingDistance_ = solution.crowdingDistance_; //kDistance_ = solution.getKDistance(); //fitness_ = solution.getFitness(); //marked_ = solution.isMarked (); rank_ = solution.rank_; //location_ = solution.getLocation(); }
public SolutionType(Problem problem) { problem_ = problem; }