Ejemplo n.º 1
0
 /// <summary>
 /// Constructor
 /// </summary>
 public Solution ()
 {
   problem_ = null;
   overallConstraintViolation_ = 0.0;
   numberOfViolatedConstraints_ = 0;
   type_ = null;
   variable_ = null;
   objective_ = null;
 }
Ejemplo n.º 2
0
 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
 }
Ejemplo n.º 3
0
    // 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 () ;
    }
Ejemplo n.º 4
0
 /// <summary>
   /// Constructor
   /// </summary>
   /// <param name="problem">
   /// A <see cref="Problem"/>
   /// </param>
   public Algorithm (Problem problem):this()
   {
     problem_ = problem;
   }
Ejemplo n.º 5
0
 public NSGAII(Problem problem)
     : base(problem)
 {
 }
Ejemplo n.º 6
0
    // 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();
      
    }
Ejemplo n.º 7
0
 public NSGAII(Problem problem)
     : base(problem)
 {
 }
Ejemplo n.º 8
0
 public SolutionType(Problem problem)
 {
   problem_ = problem; 
 }