package org.uma.jmetal.solution.integersolution.impl;

import org.apache.commons.lang3.tuple.Pair;
import org.uma.jmetal.solution.AbstractSolution;
import org.uma.jmetal.solution.integersolution.IntegerSolution;
import org.uma.jmetal.util.pseudorandom.JMetalRandom;

import java.util.HashMap;
import java.util.List;

/**
 * Defines an implementation of an integer solution
 *
 * @author Antonio J. Nebro <antonio@lcc.uma.es>
 */
@SuppressWarnings("serial")
public class DefaultIntegerSolution extends AbstractSolution<Integer> implements IntegerSolution {
  protected List<Pair<Integer, Integer>> bounds;

  /** Constructor */
  public DefaultIntegerSolution(List<Pair<Integer, Integer>> bounds, int numberOfObjectives) {
    super(bounds.size(), numberOfObjectives);

    this.bounds = bounds ;

    for (int i = 0; i < bounds.size(); i++) {
      setVariable(
          i, JMetalRandom.getInstance().nextInt(bounds.get(i).getLeft(), bounds.get(i).getRight()));
    }
  }

  /** Copy constructor */
  public DefaultIntegerSolution(DefaultIntegerSolution solution) {
    super(solution.getNumberOfVariables(), solution.getNumberOfObjectives());

    for (int i = 0; i < solution.getNumberOfVariables(); i++) {
      setVariable(i, solution.getVariable(i));
    }

    for (int i = 0; i < solution.getNumberOfObjectives(); i++) {
      setObjective(i, solution.getObjective(i));
    }

    bounds = solution.bounds;

    attributes = new HashMap<>(solution.attributes);
  }

  @Override
  public Integer getLowerBound(int index) {
    return this.bounds.get(index).getLeft();
  }

  @Override
  public Integer getUpperBound(int index) {
    return this.bounds.get(index).getRight();
  }

  @Override
  public DefaultIntegerSolution copy() {
    return new DefaultIntegerSolution(this);
  }
  }

@@ -711,16 +711,41 @@
 jectives
+, int numberOfConstraints
 ) %7B%0A    
@@ -783,16 +783,37 @@
 jectives
+, numberOfConstraints
 );%0A%0A    
@@ -1013,16 +1013,193 @@
  %7D%0A  %7D%0A%0A
+  /** Constructor */%0A  public DefaultIntegerSolution(%0A      List%3CPair%3CInteger, Integer%3E%3E bounds,%0A      int numberOfObjectives) %7B%0A    this(bounds, numberOfObjectives, 0) ;%0A  %7D%0A%0A%0A
   /** Co
@@ -1358,16 +1358,51 @@
 ctives()
+, solution.getNumberOfConstraints()
 );%0A%0A    
@@ -1632,24 +1632,148 @@
 i));%0A    %7D%0A%0A
+    for (int i = 0; i %3C solution.getNumberOfConstraints(); i++) %7B%0A      setConstraint(i, solution.getConstraint(i));%0A    %7D%0A%0A
     bounds =

Add missing constructor to class DefaultIntegerSolution