All Downloads are FREE. Search and download functionalities are using the official Maven repository.

MOEAFramework-2.10.auxiliary.jmetal.JMetal43.patch Maven / Gradle / Ivy

There is a newer version: 4.4
Show newest version
Index: src/jmetal/metaheuristics/moead/MOEAD.java
===================================================================
--- src/jmetal/metaheuristics/moead/MOEAD.java	(revision 3)
+++ src/jmetal/metaheuristics/moead/MOEAD.java	(working copy)
@@ -93,7 +93,6 @@
     maxEvaluations = ((Integer) this.getInputParameter("maxEvaluations")).intValue();
     populationSize_ = ((Integer) this.getInputParameter("populationSize")).intValue();
     dataDirectory_ = this.getInputParameter("dataDirectory").toString();
-    System.out.println("POPSIZE: "+ populationSize_) ;
 
     population_ = new SolutionSet(populationSize_);
     indArray_ = new Solution[problem_.getNumberOfObjectives()];
@@ -135,8 +134,8 @@
       Utils.randomPermutation(permutation, populationSize_);
 
       for (int i = 0; i < populationSize_; i++) {
-        int n = permutation[i]; // or int n = i;
-        //int n = i ; // or int n = i;
+        //int n = permutation[i]; // or int n = i;
+        int n = i ; // or int n = i;
         int type;
         double rnd = PseudoRandom.randDouble();
 
Index: src/jmetal/metaheuristics/omopso/OMOPSO.java
===================================================================
--- src/jmetal/metaheuristics/omopso/OMOPSO.java	(revision 3)
+++ src/jmetal/metaheuristics/omopso/OMOPSO.java	(working copy)
@@ -112,7 +112,7 @@
   /**
   * eta_ value
   */
-  private double eta_ = 0.0075;
+  private double[] eta_ = new double[] { 0.0075 };
 
   /** 
   * Constructor
@@ -129,8 +129,8 @@
     particlesSize_ = ((Integer)getInputParameter("swarmSize")).intValue();
     archiveSize_   = ((Integer)getInputParameter("archiveSize")).intValue();
     maxIterations_ = ((Integer)getInputParameter("maxIterations")).intValue();
-
-    
+    eta_           = (double[])getInputParameter("epsilon");
+    		
     particles_     = new SolutionSet(particlesSize_);        
     best_          = new Solution[particlesSize_];
     leaders_       = new CrowdingArchive(archiveSize_,problem_.getNumberOfObjectives());
Index: src/jmetal/util/comparators/EpsilonDominanceComparator.java
===================================================================
--- src/jmetal/util/comparators/EpsilonDominanceComparator.java	(revision 3)
+++ src/jmetal/util/comparators/EpsilonDominanceComparator.java	(working copy)
@@ -34,7 +34,7 @@
   /**
    * Stores the value of eta, needed for epsilon-dominance.
    */
-  private double eta_;
+  private double[] eta_;
   
   /** 
    * stores a comparator for check the OverallConstraintComparator
@@ -47,9 +47,13 @@
   *  @param eta Value for epsilon-dominance.
   */
   public EpsilonDominanceComparator(double eta) {
-    eta_ = eta;
+    eta_ = new double[] { eta };
   }
   
+  public EpsilonDominanceComparator(double[] eta) {
+	  eta_ = eta;
+  }
+  
  /** 
   * Compares two solutions.
   * @param solution1 Object representing the first Solution.
@@ -88,9 +92,9 @@
       value2 = solution2.getObjective(i);
 
       //Objetive implements comparable!!! 
-      if (value1/(1 + eta_) < value2) {
+      if (value1/(1 + eta_[i >= eta_.length ? eta_.length-1 : i]) < value2) {
         flag = -1;
-      } else if (value1/(1 + eta_) > value2) {
+      } else if (value1/(1 + eta_[i >= eta_.length ? eta_.length-1 : i]) > value2) {
         flag = 1;
       } else {
         flag =  0;
Index: src/jmetal/operators/selection/BinaryTournament.java
===================================================================
--- src/jmetal/operators/selection/BinaryTournament.java	(revision 3)
+++ src/jmetal/operators/selection/BinaryTournament.java	(working copy)
@@ -64,10 +64,6 @@
     Solution solution1, solution2;
     solution1 = solutionSet.get(PseudoRandom.randInt(0,solutionSet.size()-1));
     solution2 = solutionSet.get(PseudoRandom.randInt(0,solutionSet.size()-1));
-
-    if (solutionSet.size() >= 2)
-    	while (solution1 == solution2)
-        solution2 = solutionSet.get(PseudoRandom.randInt(0,solutionSet.size()-1));
     
     int flag = comparator_.compare(solution1,solution2);
     if (flag == -1)
Index: src/jmetal/operators/selection/DifferentialEvolutionSelection.java
===================================================================
--- src/jmetal/operators/selection/DifferentialEvolutionSelection.java	(revision 3)
+++ src/jmetal/operators/selection/DifferentialEvolutionSelection.java	(working copy)
@@ -39,7 +39,7 @@
   /**
    * Constructor
    */
-  DifferentialEvolutionSelection(HashMap parameters) {
+  public DifferentialEvolutionSelection(HashMap parameters) {
   	super(parameters) ;
   } // Constructor
 
Index: build.xml
===================================================================
--- build.xml	(revision 2)
+++ build.xml	(working copy)
@@ -1,5 +1,5 @@
 
-
+
 
 	
 		
@@ -10,9 +10,9 @@
 		
 
 		
+				jarfile="JMetal-4.3.jar" />
 		
-		
 	
 	
@@ -24,7 +24,7 @@
 				destdir="javadoc" notree="true"
 				packagenames="jmetal.*"
 				maxmemory="256m" noindex="true" nohelp="true"
-				windowtitle="JMetal 4.2 API">
+				windowtitle="JMetal 4.3 API">
 		
 	
 




© 2015 - 2024 Weber Informatics LLC | Privacy Policy