[Libreoffice-commits] core.git: nlpsolver/ThirdParty

Todor Balabanov (via logerrit) logerrit at kemper.freedesktop.org
Sun May 12 20:51:56 UTC 2019


 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java                  |   29 +-
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/AbsGTBehavior.java     |    3 
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java      |   31 +--
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/PSGTBehavior.java      |   43 ++--
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/EvalElement.java              |   23 +-
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/EvalStruct.java               |   15 -
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/IEncodeEngine.java            |    2 
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/BasicBound.java               |   27 +-
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/RandomGenerator.java          |   99 ++++------
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/ACRComparator.java          |   21 +-
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/BCHComparator.java          |   17 -
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/IGoodnessCompareEngine.java |    7 
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/ILibEngine.java            |    3 
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/Library.java               |   34 +--
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/SearchPoint.java           |   17 -
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/problem/ProblemEncoder.java          |   33 +--
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/sco/SCAgent.java                     |   79 ++++---
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/BasicPoint.java                |    2 
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignDim.java                 |   13 -
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignSpace.java               |   29 --
 nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/ILocationEngine.java           |    2 
 21 files changed, 254 insertions(+), 275 deletions(-)

New commits:
commit 51387dc280dadf7a29d215a72d2d0026451d2be6
Author:     Todor Balabanov <todor.balabanov at gmail.com>
AuthorDate: Sun May 12 10:35:45 2019 +0300
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Sun May 12 22:50:34 2019 +0200

    Formatting - Eclipse IDE Java Conventions with spaces for indentation.
    
    Change-Id: I0c3e50ef25bda0bc4ae59665a07848fe75507121
    Reviewed-on: https://gerrit.libreoffice.org/72185
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    Tested-by: Jenkins

diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java
index 50ab8fd8c8f0..0f1240df9a1b 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java
@@ -44,25 +44,25 @@ import net.adaptivebox.space.BasicPoint;
 
 public class DEPSAgent implements ILibEngine {
 
-  //Describes the problem to be solved
+  // Describes the problem to be solved
   private ProblemEncoder problemEncoder;
-  //Forms the goodness landscape
+  // Forms the goodness landscape
   private IGoodnessCompareEngine qualityComparator;
 
-  //store the point that generated in current learning cycle
+  // store the point that generated in current learning cycle
   private SearchPoint trailPoint;
 
-  //temp variable
+  // temp variable
   private AbsGTBehavior selectGTBehavior;
 
-  //the own memory: store the point that generated in old learning cycle
+  // the own memory: store the point that generated in old learning cycle
   private BasicPoint pold_t;
-  //the own memory: store the point that generated in last learning cycle
+  // the own memory: store the point that generated in last learning cycle
   private BasicPoint pcurrent_t;
-  //the own memory: store the personal best point
+  // the own memory: store the personal best point
   private SearchPoint pbest_t;
 
-  //Generate-and-test Behaviors
+  // Generate-and-test Behaviors
   private DEGTBehavior deGTBehavior;
   private PSGTBehavior psGTBehavior;
   public double switchP = 0.5;
@@ -88,7 +88,7 @@ public class DEPSAgent implements ILibEngine {
   }
 
   private AbsGTBehavior getGTBehavior() {
-    if (Math.random()<switchP) {
+    if (Math.random() < switchP) {
       return deGTBehavior;
     } else {
       return psGTBehavior;
@@ -97,23 +97,23 @@ public class DEPSAgent implements ILibEngine {
 
   public void setGTBehavior(AbsGTBehavior gtBehavior) {
     if (gtBehavior instanceof DEGTBehavior) {
-      deGTBehavior = ((DEGTBehavior)gtBehavior);
+      deGTBehavior = ((DEGTBehavior) gtBehavior);
       deGTBehavior.setPbest(pbest_t);
       return;
     }
     if (gtBehavior instanceof PSGTBehavior) {
-      psGTBehavior = ((PSGTBehavior)gtBehavior);
+      psGTBehavior = ((PSGTBehavior) gtBehavior);
       psGTBehavior.setMemPoints(pbest_t, pcurrent_t, pold_t);
       return;
     }
   }
 
   public void generatePoint() {
-    // generates a new point in the search space (S) based on
-    // its memory and the library
+// generates a new point in the search space (S) based on
+// its memory and the library
     selectGTBehavior = this.getGTBehavior();
     selectGTBehavior.generateBehavior(trailPoint, problemEncoder);
-    //evaluate into goodness information
+// evaluate into goodness information
     problemEncoder.evaluate(trailPoint);
   }
 
@@ -125,4 +125,3 @@ public class DEPSAgent implements ILibEngine {
     return trailPoint;
   }
 }
-
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/AbsGTBehavior.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/AbsGTBehavior.java
index 3e556719bfdb..b811572ada82 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/AbsGTBehavior.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/AbsGTBehavior.java
@@ -23,7 +23,7 @@ import net.adaptivebox.knowledge.SearchPoint;
 import net.adaptivebox.problem.ProblemEncoder;
 
 abstract public class AbsGTBehavior {
-  //The referred social library
+  // The referred social library
   protected Library socialLib;
 
   public void setLibrary(Library lib) {
@@ -34,4 +34,3 @@ abstract public class AbsGTBehavior {
 
   abstract public void testBehavior(SearchPoint trailPoint, IGoodnessCompareEngine qualityComparator);
 }
-
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java
index dc7f7400cd58..40e570a77559 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java
@@ -37,11 +37,11 @@ import net.adaptivebox.problem.ProblemEncoder;
 import net.adaptivebox.space.BasicPoint;
 
 public class DEGTBehavior extends AbsGTBehavior implements ILibEngine {
-  private static final int DVNum = 2;  //Number of differential vectors, normally be 1 or 2
-  public double FACTOR = 0.5; //scale constant: (0, 1.2], normally be 0.5
-  public double CR = 0.9;     //crossover constant: [0, 1], normally be 0.1 or 0.9
+  private static final int DVNum = 2; // Number of differential vectors, normally be 1 or 2
+  public double FACTOR = 0.5; // scale constant: (0, 1.2], normally be 0.5
+  public double CR = 0.9; // crossover constant: [0, 1], normally be 0.1 or 0.9
 
-  //the own memory: store the point that generated in last learning cycle
+  // the own memory: store the point that generated in last learning cycle
   private SearchPoint pbest_t;
 
   public void setPbest(SearchPoint pbest) {
@@ -51,16 +51,14 @@ public class DEGTBehavior extends AbsGTBehavior implements ILibEngine {
   /**
    * Crossover and mutation for a single vector element done in a single step.
    *
-   * @param index
-   *            Index of the trial vector element to be changed.
-   * @param trialVector
-   *            Trial vector reference.
-   * @param globalVector
-   *            Global best found vector reference.
-   * @param differenceVectors
-   *            List of vectors used for difference delta calculation.
+   * @param index             Index of the trial vector element to be changed.
+   * @param trialVector       Trial vector reference.
+   * @param globalVector      Global best found vector reference.
+   * @param differenceVectors List of vectors used for difference delta
+   *                          calculation.
    */
-  private void crossoverAndMutation(int index, double trialVector[], double globalVector[], BasicPoint differenceVectors[]) {
+  private void crossoverAndMutation(int index, double trialVector[], double globalVector[],
+      BasicPoint differenceVectors[]) {
     double delta = 0D;
 
     for (int i = 0; i < differenceVectors.length; i++) {
@@ -110,11 +108,10 @@ public class DEGTBehavior extends AbsGTBehavior implements ILibEngine {
   }
 
   private SearchPoint[] getReferPoints() {
-    SearchPoint[] referPoints = new SearchPoint[DVNum*2];
-    for(int i=0; i<referPoints.length; i++) {
-      referPoints[i] = socialLib.getSelectedPoint(RandomGenerator.intRangeRandom(0, socialLib.getPopSize()-1));
+    SearchPoint[] referPoints = new SearchPoint[DVNum * 2];
+    for (int i = 0; i < referPoints.length; i++) {
+      referPoints[i] = socialLib.getSelectedPoint(RandomGenerator.intRangeRandom(0, socialLib.getPopSize() - 1));
     }
     return referPoints;
   }
 }
-
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/PSGTBehavior.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/PSGTBehavior.java
index a946b2301f9e..afd18390e630 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/PSGTBehavior.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/PSGTBehavior.java
@@ -63,20 +63,22 @@ import net.adaptivebox.space.BasicPoint;
 import net.adaptivebox.space.DesignSpace;
 
 public class PSGTBehavior extends AbsGTBehavior {
-  // Two normally choices for (c1, c2, weight), i.e., (2, 2, 0.4), or (1.494, 1.494, 0.729)
-  // The first is used in dissipative PSO (cf. [4]) as CL>0, and the second is achieved by using
+  // Two normally choices for (c1, c2, weight), i.e., (2, 2, 0.4), or (1.494,
+  // 1.494, 0.729)
+  // The first is used in dissipative PSO (cf. [4]) as CL>0, and the second is
+  // achieved by using
   // constriction factors (cf. [3])
-  public double c1=2;
-  public double c2=2;
-  public double weight = 0.4; //inertia weight
+  public double c1 = 2;
+  public double c2 = 2;
+  public double weight = 0.4; // inertia weight
 
-  public double CL=0;  //See ref[4], normally be 0.001~0.005
+  public double CL = 0; // See ref[4], normally be 0.001~0.005
 
-  //the own memory: store the point that generated in old learning cycle
+  // the own memory: store the point that generated in old learning cycle
   private BasicPoint pold_t;
-  //the own memory: store the point that generated in last learning cycle
+  // the own memory: store the point that generated in last learning cycle
   private BasicPoint pcurrent_t;
-  //the own memory: store the personal best point
+  // the own memory: store the personal best point
   private SearchPoint pbest_t;
 
   public void setMemPoints(SearchPoint pbest, BasicPoint pcurrent, BasicPoint pold) {
@@ -91,21 +93,21 @@ public class PSGTBehavior extends AbsGTBehavior {
     DesignSpace designSpace = problemEncoder.getDesignSpace();
     int DIMENSION = designSpace.getDimension();
     double deltaxb, deltaxbm;
-    for (int b=0;b<DIMENSION;b++) {
-      if (Math.random()<CL) {
+    for (int b = 0; b < DIMENSION; b++) {
+      if (Math.random() < CL) {
         designSpace.mutationAt(trailPoint.getLocation(), b);
       } else {
-        deltaxb = weight*(pcurrent_t.getLocation()[b]-pold_t.getLocation()[b])
-             + c1*Math.random()*(pbest_t.getLocation()[b]-pcurrent_t.getLocation()[b])
-             + c2*Math.random()*(gbest_t.getLocation()[b]-pcurrent_t.getLocation()[b]);
-        //limitation for delta_x
-        deltaxbm = 0.5*designSpace.getMagnitudeIn(b);
-        if(deltaxb<-deltaxbm) {
+        deltaxb = weight * (pcurrent_t.getLocation()[b] - pold_t.getLocation()[b])
+            + c1 * Math.random() * (pbest_t.getLocation()[b] - pcurrent_t.getLocation()[b])
+            + c2 * Math.random() * (gbest_t.getLocation()[b] - pcurrent_t.getLocation()[b]);
+// limitation for delta_x
+        deltaxbm = 0.5 * designSpace.getMagnitudeIn(b);
+        if (deltaxb < -deltaxbm) {
           deltaxb = -deltaxbm;
-        } else if (deltaxb>deltaxbm) {
+        } else if (deltaxb > deltaxbm) {
           deltaxb = deltaxbm;
         }
-        trailPoint.getLocation()[b] = pcurrent_t.getLocation()[b]+deltaxb;
+        trailPoint.getLocation()[b] = pcurrent_t.getLocation()[b] + deltaxb;
       }
     }
   }
@@ -115,7 +117,6 @@ public class PSGTBehavior extends AbsGTBehavior {
     Library.replace(qualityComparator, trailPoint, pbest_t);
     pold_t.importLocation(pcurrent_t);
     pcurrent_t.importLocation(trailPoint);
-   }
+  }
 
 }
-
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/EvalElement.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/EvalElement.java
index d3ffc25d323d..85e50c9f97f8 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/EvalElement.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/EvalElement.java
@@ -24,7 +24,7 @@ import net.adaptivebox.global.BasicBound;
 
 public class EvalElement {
 
-  //The weight for each response (target)
+  // The weight for each response (target)
   private static final double weight = 1;
   /**
    * The expected range of the response value, forms the following objective:
@@ -44,26 +44,25 @@ public class EvalElement {
   public BasicBound targetBound = new BasicBound();
 
   public boolean isOptType() {
-    return ((targetBound.minValue==BasicBound.MINDOUBLE&&targetBound.maxValue==BasicBound.MINDOUBLE)||
-            (targetBound.minValue==BasicBound.MAXDOUBLE&&targetBound.maxValue==BasicBound.MAXDOUBLE));
+    return ((targetBound.minValue == BasicBound.MINDOUBLE && targetBound.maxValue == BasicBound.MINDOUBLE)
+        || (targetBound.minValue == BasicBound.MAXDOUBLE && targetBound.maxValue == BasicBound.MAXDOUBLE));
   }
 
   public double evaluateCONS(double targetValue) {
-    if(targetValue<targetBound.minValue) {
-      return weight*(targetBound.minValue-targetValue);
+    if (targetValue < targetBound.minValue) {
+      return weight * (targetBound.minValue - targetValue);
     }
-    if(targetValue>targetBound.maxValue) {
-      return weight*(targetValue-targetBound.maxValue);
+    if (targetValue > targetBound.maxValue) {
+      return weight * (targetValue - targetBound.maxValue);
     }
     return 0;
   }
 
   public double evaluateOPTIM(double targetValue) {
-    if(targetBound.maxValue==BasicBound.MINDOUBLE) { //min mode
-      return weight*targetValue;
-    } else { //max
-      return -weight*targetValue;
+    if (targetBound.maxValue == BasicBound.MINDOUBLE) { // min mode
+      return weight * targetValue;
+    } else { // max
+      return -weight * targetValue;
     }
   }
 }
-
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/EvalStruct.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/EvalStruct.java
index 15760e23a39e..526257544091 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/EvalStruct.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/EvalStruct.java
@@ -37,21 +37,20 @@ public class EvalStruct {
     evalElems[index] = dim;
   }
 
-  //convert response values into encoded information double[2]
+  // convert response values into encoded information double[2]
   public void evaluate(double[] evalRes, double[] targetValues) {
     evalRes[0] = evalRes[1] = 0;
-    for(int i=0; i<evalElems.length; i++) {
+    for (int i = 0; i < evalElems.length; i++) {
       if (evalElems[i].isOptType()) {
-        //The objectives (OPTIM type)
-        //The multi-objective will be translated into single-objective
+// The objectives (OPTIM type)
+// The multi-objective will be translated into single-objective
         evalRes[1] += evalElems[i].evaluateOPTIM(targetValues[i]);
       } else {
-        //The constraints (CONS type)
-        //If evalRes[0] equals to 0, then be a feasible point, i.e. satisfies
-        // all the constraints
+// The constraints (CONS type)
+// If evalRes[0] equals to 0, then be a feasible point, i.e. satisfies
+// all the constraints
         evalRes[0] += evalElems[i].evaluateCONS(targetValues[i]);
       }
     }
   }
 }
-
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/IEncodeEngine.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/IEncodeEngine.java
index dd8884b1e1c1..56f791c41ab8 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/IEncodeEngine.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/IEncodeEngine.java
@@ -19,6 +19,6 @@
 
 package net.adaptivebox.encode;
 
-public interface IEncodeEngine{
+public interface IEncodeEngine {
   double[] getEncodeInfo();
 }
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/BasicBound.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/BasicBound.java
index 31ab19f800e4..26e7b5ecbefb 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/BasicBound.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/BasicBound.java
@@ -20,11 +20,12 @@
 package net.adaptivebox.global;
 
 public class BasicBound {
-  public static final double MINDOUBLE= -1e308;
-  public static final double MAXDOUBLE= 1e308;
+  public static final double MINDOUBLE = -1e308;
+  public static final double MAXDOUBLE = 1e308;
 
   public double minValue = MINDOUBLE;
   public double maxValue = MAXDOUBLE;
+
   public BasicBound() {
   }
 
@@ -34,11 +35,11 @@ public class BasicBound {
   }
 
   public double getLength() {
-    return Math.abs(maxValue-minValue);
+    return Math.abs(maxValue - minValue);
   }
 
-  public double boundAdjust(double value){
-    if(value > maxValue) {
+  public double boundAdjust(double value) {
+    if (value > maxValue) {
       value = maxValue;
     } else if (value < minValue) {
       value = minValue;
@@ -46,20 +47,18 @@ public class BasicBound {
     return value;
   }
 
-  public double annulusAdjust (double value) {
-    if(value > maxValue) {
-      double extendsLen = (value-maxValue)%getLength();
-      value = minValue+extendsLen;
+  public double annulusAdjust(double value) {
+    if (value > maxValue) {
+      double extendsLen = (value - maxValue) % getLength();
+      value = minValue + extendsLen;
     } else if (value < minValue) {
-      double extendsLen = (minValue-value)%getLength();
-      value = maxValue-extendsLen;
+      double extendsLen = (minValue - value) % getLength();
+      value = maxValue - extendsLen;
     }
     return value;
   }
 
-
-
-  public double getRandomValue(){
+  public double getRandomValue() {
     return RandomGenerator.doubleRangeRandom(minValue, maxValue);
   }
 }
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/RandomGenerator.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/RandomGenerator.java
index 18ced86335dc..4910de990091 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/RandomGenerator.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/RandomGenerator.java
@@ -25,63 +25,60 @@ package net.adaptivebox.global;
 import java.util.Random;
 
 public class RandomGenerator {
-    /**
-     * Pseudo-random number generator instance.
-     */
-    private static Random PRNG = new Random();
+  /**
+   * Pseudo-random number generator instance.
+   */
+  private static Random PRNG = new Random();
 
-    /**
-     * This function returns a random integer number between the lowLimit and
-     * upLimit.
-     *
-     * @param lowLimit
-     *            lower limits upLimit The upper limits (between which the
-     *            random number is to be generated)
-     * @return int return value Example: for find [0,1,2]
-     */
-    public static int intRangeRandom(int lowLimit, int upLimit) {
-        int num = lowLimit + PRNG.nextInt(upLimit - lowLimit + 1);
-        return num;
-    }
-
-    /**
-     * This function returns a random float number between the lowLimit and
-     * upLimit.
-     *
-     * @param lowLimit
-     *            lower limits upLimit The upper limits (between which the
-     *            random number is to be generated)
-     * @return double return value
-     */
-    public static double doubleRangeRandom(double lowLimit, double upLimit) {
-        double num = lowLimit + PRNG.nextDouble() * (upLimit - lowLimit);
-        return num;
-    }
+  /**
+   * This function returns a random integer number between the lowLimit and
+   * upLimit.
+   *
+   * @param lowLimit lower limits upLimit The upper limits (between which the
+   *                 random number is to be generated)
+   * @return int return value Example: for find [0,1,2]
+   */
+  public static int intRangeRandom(int lowLimit, int upLimit) {
+    int num = lowLimit + PRNG.nextInt(upLimit - lowLimit + 1);
+    return num;
+  }
 
-    public static int[] randomSelection(int maxNum, int times) {
-        if (maxNum < 0) {
-            maxNum = 0;
-        }
+  /**
+   * This function returns a random float number between the lowLimit and upLimit.
+   *
+   * @param lowLimit lower limits upLimit The upper limits (between which the
+   *                 random number is to be generated)
+   * @return double return value
+   */
+  public static double doubleRangeRandom(double lowLimit, double upLimit) {
+    double num = lowLimit + PRNG.nextDouble() * (upLimit - lowLimit);
+    return num;
+  }
 
-        if (times < 0) {
-            times = 0;
-        }
+  public static int[] randomSelection(int maxNum, int times) {
+    if (maxNum < 0) {
+      maxNum = 0;
+    }
 
-        int[] all = new int[maxNum];
-        for (int i = 0; i < all.length; i++) {
-            all[i] = i;
-        }
+    if (times < 0) {
+      times = 0;
+    }
 
-        /* https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle */
-        int[] indices = new int[Math.min(maxNum, times)];
-        for (int i = 0, j, value; i < indices.length; i++) {
-            j = intRangeRandom(i, all.length - 1);
+    int[] all = new int[maxNum];
+    for (int i = 0; i < all.length; i++) {
+      all[i] = i;
+    }
 
-            value = all[j];
-            all[j] = all[i];
-            indices[i] = all[i] = value;
-        }
+    /* https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle */
+    int[] indices = new int[Math.min(maxNum, times)];
+    for (int i = 0, j, value; i < indices.length; i++) {
+      j = intRangeRandom(i, all.length - 1);
 
-        return indices;
+      value = all[j];
+      all[j] = all[i];
+      indices[i] = all[i] = value;
     }
+
+    return indices;
+  }
 }
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/ACRComparator.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/ACRComparator.java
index 8e319d5dfa6a..22f4d4a32ba2 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/ACRComparator.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/ACRComparator.java
@@ -51,7 +51,8 @@ public class ACRComparator implements IGoodnessCompareEngine, IUpdateCycleEngine
   public ACRComparator(Library lib, int T) {
     socialPool = lib;
     this.T = T;
-    //set the (epsilon_t|t=0) as the maximum CONS value among the SearchPoints in the library
+// set the (epsilon_t|t=0) as the maximum CONS value among the SearchPoints in
+// the library
     epsilon_t = lib.getExtremalVcon(true);
   }
 
@@ -65,7 +66,7 @@ public class ACRComparator implements IGoodnessCompareEngine, IUpdateCycleEngine
   }
 
   public int compare(double[] fit1, double[] fit2) {
-    if(Math.max(fit1[0], fit2[0])<=Math.max(0, epsilon_t)) { //epsilon>0
+    if (Math.max(fit1[0], fit2[0]) <= Math.max(0, epsilon_t)) { // epsilon>0
       return compare(fit1[1], fit2[1]);
     } else {
       return compare(fit1[0], fit2[0]);
@@ -73,16 +74,16 @@ public class ACRComparator implements IGoodnessCompareEngine, IUpdateCycleEngine
   }
 
   public void updateCycle(int t) {
-    //calculates the ratio
-    double rn = (double)socialPool.getVconThanNum(epsilon_t)/(double)socialPool.getPopSize();
-    if(t>TthR*T &&T!=-1) { //Forcing sub-rule
+// calculates the ratio
+    double rn = (double) socialPool.getVconThanNum(epsilon_t) / (double) socialPool.getPopSize();
+    if (t > TthR * T && T != -1) { // Forcing sub-rule
       epsilon_t *= BETAF;
-    } else {  	          //Ratio-keeping sub-rules
-      if(rn>RU) {
-        epsilon_t *= BETAL;  //Shrink
+    } else { // Ratio-keeping sub-rules
+      if (rn > RU) {
+        epsilon_t *= BETAL; // Shrink
       }
-      if(rn<RL) {
-        epsilon_t *= BETAU;  //Relax
+      if (rn < RL) {
+        epsilon_t *= BETAU; // Relax
       }
     }
   }
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/BCHComparator.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/BCHComparator.java
index 66c25ed0b73d..74fd1b8481fe 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/BCHComparator.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/BCHComparator.java
@@ -28,17 +28,18 @@ package net.adaptivebox.goodness;
 
 public class BCHComparator implements IGoodnessCompareEngine {
 
-/* check the magnitude of two array, the frontal is more important
- **/
+  /*
+   * check the magnitude of two array, the frontal is more important
+   **/
   private static int compareArray(double[] fit1, double[] fit2) {
-    for (int i=0; i<fit1.length; i++) {
-      if (fit1[i]>fit2[i]) {
-        return LARGER_THAN; //Large than
-      } else if (fit1[i]<fit2[i]){
-        return LESS_THAN; //Less than
+    for (int i = 0; i < fit1.length; i++) {
+      if (fit1[i] > fit2[i]) {
+        return LARGER_THAN; // Large than
+      } else if (fit1[i] < fit2[i]) {
+        return LESS_THAN; // Less than
       }
     }
-    return IGoodnessCompareEngine.EQUAL_TO; //same
+    return IGoodnessCompareEngine.EQUAL_TO; // same
   }
 
   public int compare(double[] fit1, double[] fit2) {
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/IGoodnessCompareEngine.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/IGoodnessCompareEngine.java
index b345c1fafc46..70e227b5f610 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/IGoodnessCompareEngine.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/IGoodnessCompareEngine.java
@@ -29,10 +29,9 @@ public abstract interface IGoodnessCompareEngine {
   int LESS_THAN = 0;
 
   /**
-   * check the magnitude of two IEncodeEngine
-   * LARGER_THAN: goodness1 is worse than goodness2
-   * LESS_THAN:   goodness1 is better than goodness2
-   * EQUAL_TO :   goodness1 is equal to goodness2
+   * check the magnitude of two IEncodeEngine LARGER_THAN: goodness1 is worse than
+   * goodness2 LESS_THAN: goodness1 is better than goodness2 EQUAL_TO : goodness1
+   * is equal to goodness2
    **/
   int compare(double[] goodness1, double[] goodness2);
 }
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/ILibEngine.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/ILibEngine.java
index af5a8b2a1323..b4787c30c66e 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/ILibEngine.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/ILibEngine.java
@@ -25,6 +25,3 @@ package net.adaptivebox.knowledge;
 public interface ILibEngine {
   void setLibrary(Library lib);
 }
-
-
-
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/Library.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/Library.java
index 3a0f82659295..841e9102a1c0 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/Library.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/Library.java
@@ -33,9 +33,9 @@ public class Library {
   private final SearchPoint[] libPoints;
   private int gIndex = -1;
 
-  public Library(int number, ProblemEncoder problemEncoder){
+  public Library(int number, ProblemEncoder problemEncoder) {
     libPoints = new SearchPoint[number];
-    for (int i=0; i<number; i++) {
+    for (int i = 0; i < number; i++) {
       libPoints[i] = problemEncoder.getEncodedSearchPoint();
     }
   }
@@ -45,7 +45,7 @@ public class Library {
   }
 
   public void refreshGbest(IGoodnessCompareEngine qualityComparator) {
-    gIndex = tournamentSelection(qualityComparator, getPopSize()-1, true);
+    gIndex = tournamentSelection(qualityComparator, getPopSize() - 1, true);
   }
 
   public int getPopSize() {
@@ -56,9 +56,11 @@ public class Library {
     return libPoints[index];
   }
 
-  public static boolean replace(IGoodnessCompareEngine comparator, SearchPoint outPoint, SearchPoint tobeReplacedPoint) {
+  public static boolean replace(IGoodnessCompareEngine comparator, SearchPoint outPoint,
+      SearchPoint tobeReplacedPoint) {
     boolean isBetter = false;
-    if(comparator.compare(outPoint.getEncodeInfo(), tobeReplacedPoint.getEncodeInfo())<IGoodnessCompareEngine.LARGER_THAN) {
+    if (comparator.compare(outPoint.getEncodeInfo(),
+        tobeReplacedPoint.getEncodeInfo()) < IGoodnessCompareEngine.LARGER_THAN) {
       tobeReplacedPoint.importPoint(outPoint);
       isBetter = true;
     }
@@ -68,9 +70,10 @@ public class Library {
   public int tournamentSelection(IGoodnessCompareEngine comparator, int times, boolean isBetter) {
     int[] indices = RandomGenerator.randomSelection(getPopSize(), times);
     int currentIndex = indices[0];
-    for (int i=1; i<indices.length; i++) {
-      int compareValue = comparator.compare(libPoints[indices[i]].getEncodeInfo(), libPoints[currentIndex].getEncodeInfo());
-      if (isBetter == (compareValue<IGoodnessCompareEngine.LARGER_THAN)) {
+    for (int i = 1; i < indices.length; i++) {
+      int compareValue = comparator.compare(libPoints[indices[i]].getEncodeInfo(),
+          libPoints[currentIndex].getEncodeInfo());
+      if (isBetter == (compareValue < IGoodnessCompareEngine.LARGER_THAN)) {
         currentIndex = indices[i];
       }
     }
@@ -78,9 +81,9 @@ public class Library {
   }
 
   public double getExtremalVcon(boolean isMAX) {
-    double val=BasicBound.MINDOUBLE;
-    for(int i=0; i<libPoints.length; i++) {
-      if(libPoints[i].getEncodeInfo()[0]>val==isMAX) {
+    double val = BasicBound.MINDOUBLE;
+    for (int i = 0; i < libPoints.length; i++) {
+      if (libPoints[i].getEncodeInfo()[0] > val == isMAX) {
         val = libPoints[i].getEncodeInfo()[0];
       }
     }
@@ -88,9 +91,9 @@ public class Library {
   }
 
   public int getVconThanNum(double allowedCons) {
-    int num=0;
-    for(int i=0; i<libPoints.length; i++) {
-      if(libPoints[i].getEncodeInfo()[0]<=allowedCons) {
+    int num = 0;
+    for (int i = 0; i < libPoints.length; i++) {
+      if (libPoints[i].getEncodeInfo()[0] <= allowedCons) {
         num++;
       }
     }
@@ -98,6 +101,3 @@ public class Library {
   }
 
 }
-
-
-
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/SearchPoint.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/SearchPoint.java
index b1b96163465f..eb0441648781 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/SearchPoint.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/SearchPoint.java
@@ -24,15 +24,16 @@ import net.adaptivebox.global.BasicBound;
 import net.adaptivebox.space.BasicPoint;
 
 public class SearchPoint extends BasicPoint implements IEncodeEngine {
-  //store the encode information for goodness evaluation
-  //encodeInfo[0]: the sum of constraints (if it equals to 0, then be a feasible point)
-  //encodeInfo[1]: the value of objective function
+  // store the encode information for goodness evaluation
+  // encodeInfo[0]: the sum of constraints (if it equals to 0, then be a feasible
+  // point)
+  // encodeInfo[1]: the value of objective function
   private final double[] encodeInfo = new double[2];
   private double objectiveValue;
 
   public SearchPoint(int dim) {
     super(dim);
-    for(int i=0; i<encodeInfo.length; i++) {
+    for (int i = 0; i < encodeInfo.length; i++) {
       encodeInfo[i] = BasicBound.MAXDOUBLE;
     }
   }
@@ -49,7 +50,7 @@ public class SearchPoint extends BasicPoint implements IEncodeEngine {
     importEncodeInfo(point.getEncodeInfo());
   }
 
-  //Replace self by given point
+  // Replace self by given point
   public void importPoint(SearchPoint point) {
     importLocation(point);
     importEncodeInfo(point);
@@ -57,15 +58,15 @@ public class SearchPoint extends BasicPoint implements IEncodeEngine {
   }
 
   public double getObjectiveValue() {
-      return objectiveValue;
+    return objectiveValue;
   }
 
   public void setObjectiveValue(double objectiveValue) {
-      this.objectiveValue = objectiveValue;
+    this.objectiveValue = objectiveValue;
   }
 
   public boolean isFeasible() {
-      return encodeInfo[0] == 0; //no constraint violations
+    return encodeInfo[0] == 0; // no constraint violations
   }
 
 }
\ No newline at end of file
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/problem/ProblemEncoder.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/problem/ProblemEncoder.java
index 58b7ab4c907d..c6a25e93c8f1 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/problem/ProblemEncoder.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/problem/ProblemEncoder.java
@@ -34,11 +34,11 @@ import net.adaptivebox.space.DesignDim;
 import net.adaptivebox.space.DesignSpace;
 
 public abstract class ProblemEncoder {
-  //Store the calculated results for the responses
-  private final double[] tempResponseSet;  //temp values
-  private final double[] tempLocation;  //temp values
+  // Store the calculated results for the responses
+  private final double[] tempResponseSet; // temp values
+  private final double[] tempLocation; // temp values
 
-  //the search space (S)
+  // the search space (S)
   private final DesignSpace designSpace;
 
   // For evaluate the response vector into encoded vector double[2]
@@ -55,27 +55,27 @@ public abstract class ProblemEncoder {
     return designSpace;
   }
 
-  //set the default information for each dimension of search space (S)
-  protected void setDefaultXAt(int i,  double min, double max, double grain) {
+  // set the default information for each dimension of search space (S)
+  protected void setDefaultXAt(int i, double min, double max, double grain) {
     DesignDim dd = new DesignDim();
     dd.grain = grain;
     dd.paramBound = new BasicBound(min, max);
     designSpace.setElemAt(dd, i);
   }
 
-  //set the default information for evaluation each response
-  protected void setDefaultYAt(int i,  double min, double max) {
+  // set the default information for evaluation each response
+  protected void setDefaultYAt(int i, double min, double max) {
     EvalElement ee = new EvalElement();
     ee.targetBound = new BasicBound(min, max);
     evalStruct.setElemAt(ee, i);
   }
 
-  //get a fresh point
+  // get a fresh point
   public SearchPoint getFreshSearchPoint() {
     return new SearchPoint(designSpace.getDimension());
   }
 
-  //get an encoded point
+  // get an encoded point
   public SearchPoint getEncodedSearchPoint() {
     SearchPoint point = getFreshSearchPoint();
     designSpace.initializeGene(point.getLocation());
@@ -83,26 +83,25 @@ public abstract class ProblemEncoder {
     return point;
   }
 
-  //evaluate the point into encoded information
+  // evaluate the point into encoded information
   public void evaluate(SearchPoint point) {
-    //copy to temp point
+// copy to temp point
     System.arraycopy(point.getLocation(), 0, this.tempLocation, 0, tempLocation.length);
-    //mapping the temp point to original search space S
+// mapping the temp point to original search space S
     designSpace.getMappingPoint(tempLocation);
-    //calculate based on the temp point
+// calculate based on the temp point
     calcTargets(tempResponseSet, tempLocation);
     evalStruct.evaluate(point.getEncodeInfo(), tempResponseSet);
     point.setObjectiveValue(tempResponseSet[0]);
   }
 
-  //calculate each response, must be implemented
+  // calculate each response, must be implemented
   abstract protected double calcTargetAt(int index, double[] VX);
 
   // calculate all the responses VY[] based on given point VX[]
   private void calcTargets(double[] VY, double[] VX) {
-    for(int i=0; i<VY.length; i++) {
+    for (int i = 0; i < VY.length; i++) {
       VY[i] = calcTargetAt(i, VX);
     }
   }
 }
-
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/sco/SCAgent.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/sco/SCAgent.java
index 3de78939cb10..7785069e86bc 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/sco/SCAgent.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/sco/SCAgent.java
@@ -43,21 +43,23 @@ import net.adaptivebox.knowledge.SearchPoint;
 
 public class SCAgent {
 
-  //Describes the problem to be solved (encode the point into intermediate information)
+  // Describes the problem to be solved (encode the point into intermediate
+  // information)
   private ProblemEncoder problemEncoder;
-  //Forms the goodness landscape
+  // Forms the goodness landscape
   private IGoodnessCompareEngine specComparator;
 
-  //the coefficients of SCAgent
+  // the coefficients of SCAgent
   private static final int TaoB = 2;
-  //The early version set TaoW as the size of external library (NL), but 4 is often enough
+  // The early version set TaoW as the size of external library (NL), but 4 is
+  // often enough
   private static final int TaoW = 4;
 
-  //The referred external library
+  // The referred external library
   private Library externalLib;
-  //store the point that generated in current learning cycle
+  // store the point that generated in current learning cycle
   private SearchPoint trailPoint;
-  //the own memory: store the point that generated in last learning cycle
+  // the own memory: store the point that generated in last learning cycle
   private SearchPoint pcurrent_t;
 
   public void setExternalLib(Library lib) {
@@ -75,9 +77,9 @@ public class SCAgent {
   }
 
   public SearchPoint generatePoint() {
-    //generate a new point
+// generate a new point
     generatePoint(trailPoint);
-    //evaluate the generated point
+// evaluate the generated point
     problemEncoder.evaluate(trailPoint);
     return trailPoint;
   }
@@ -85,49 +87,50 @@ public class SCAgent {
   private void generatePoint(ILocationEngine tempPoint) {
     SearchPoint Xmodel, Xrefer, libBPoint;
 
-    // choose Selects a better point (libBPoint) from externalLib (L) based
-    // on tournament selection
+// choose Selects a better point (libBPoint) from externalLib (L) based
+// on tournament selection
     int xb = externalLib.tournamentSelection(specComparator, TaoB, true);
     libBPoint = externalLib.getSelectedPoint(xb);
-    // Compares pcurrent_t with libBPoint
-    // The better one becomes model point (Xmodel)
-    // The worse one becomes refer point (Xrefer)
-    if(specComparator.compare(pcurrent_t.getEncodeInfo(), libBPoint.getEncodeInfo())==IGoodnessCompareEngine.LARGER_THAN) {
+// Compares pcurrent_t with libBPoint
+// The better one becomes model point (Xmodel)
+// The worse one becomes refer point (Xrefer)
+    if (specComparator.compare(pcurrent_t.getEncodeInfo(),
+        libBPoint.getEncodeInfo()) == IGoodnessCompareEngine.LARGER_THAN) {
       Xmodel = libBPoint;
       Xrefer = pcurrent_t;
     } else {
       Xmodel = pcurrent_t;
       Xrefer = libBPoint;
     }
-    // observational learning: generates a new point near the model point, which
-    // the variation range is decided by the difference of Xmodel and Xrefer
+// observational learning: generates a new point near the model point, which
+// the variation range is decided by the difference of Xmodel and Xrefer
     inferPoint(tempPoint, Xmodel, Xrefer, problemEncoder.getDesignSpace());
   }
 
-  //1. Update the current point into the external library
-  //2. Replace the current point by the generated point
+  // 1. Update the current point into the external library
+  // 2. Replace the current point by the generated point
   public void updateInfo() {
-    //Selects a bad point kw from TaoW points in Library
+// Selects a bad point kw from TaoW points in Library
     int xw = externalLib.tournamentSelection(specComparator, TaoW, false);
-    //Replaces kw with pcurrent_t
+// Replaces kw with pcurrent_t
     externalLib.getSelectedPoint(xw).importPoint(pcurrent_t);
-    //Replaces pcurrent_t (x(t)) with trailPoint (x(t+1))
+// Replaces pcurrent_t (x(t)) with trailPoint (x(t+1))
     pcurrent_t.importPoint(trailPoint);
-   }
-
-  //  1---model point, 2---refer point
-   private boolean inferPoint(ILocationEngine newPoint, ILocationEngine point1,ILocationEngine point2, DesignSpace space){
-     double[] newLoc = newPoint.getLocation();
-     double[] real1 = point1.getLocation();
-     double[] real2 = point2.getLocation();
+  }
 
-     for (int i=0; i<newLoc.length; i++) {
-       newLoc[i] = real1[i]*2-real2[i];
-       //boundary handling
-       newLoc[i] = space.boundAdjustAt(newLoc[i], i);
-       newLoc[i] = RandomGenerator.doubleRangeRandom(newLoc[i], real2[i]);
-     }
-     return true;
-   }
+  // 1---model point, 2---refer point
+  private boolean inferPoint(ILocationEngine newPoint, ILocationEngine point1, ILocationEngine point2,
+      DesignSpace space) {
+    double[] newLoc = newPoint.getLocation();
+    double[] real1 = point1.getLocation();
+    double[] real2 = point2.getLocation();
+
+    for (int i = 0; i < newLoc.length; i++) {
+      newLoc[i] = real1[i] * 2 - real2[i];
+      // boundary handling
+      newLoc[i] = space.boundAdjustAt(newLoc[i], i);
+      newLoc[i] = RandomGenerator.doubleRangeRandom(newLoc[i], real2[i]);
+    }
+    return true;
+  }
 }
-
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/BasicPoint.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/BasicPoint.java
index 35f5f79ce23d..9f6c2ec01de9 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/BasicPoint.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/BasicPoint.java
@@ -21,7 +21,7 @@
 package net.adaptivebox.space;
 
 public class BasicPoint implements ILocationEngine {
-  //store the location information in the search space (S)
+  // store the location information in the search space (S)
   private final double[] location;
 
   public BasicPoint(int dim) {
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignDim.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignDim.java
index ce6790402a4e..9fbe937e1dff 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignDim.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignDim.java
@@ -27,21 +27,20 @@ public class DesignDim {
   // To discrete space with the given step. For example, for an integer variable,
   // The grain value can be set as 1.
   public double grain = 0;
-  public BasicBound paramBound = new BasicBound(); //the range of a parameter
+  public BasicBound paramBound = new BasicBound(); // the range of a parameter
 
   public boolean isDiscrete() {
-    return grain!=0;
+    return grain != 0;
   }
 
   public double getGrainedValue(double value) {
-    if(grain==0) {
+    if (grain == 0) {
       return value;
-    } else if(grain>0) {
-      return paramBound.minValue+Math.rint((value-paramBound.minValue)/grain)*grain;
+    } else if (grain > 0) {
+      return paramBound.minValue + Math.rint((value - paramBound.minValue) / grain) * grain;
     } else {
-      return paramBound.maxValue-Math.rint((paramBound.maxValue-value)/grain)*grain;
+      return paramBound.maxValue - Math.rint((paramBound.maxValue - value) / grain) * grain;
     }
   }
 
 }
-
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignSpace.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignSpace.java
index 7e7629af8e10..0c28e0006e1b 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignSpace.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignSpace.java
@@ -27,59 +27,48 @@
 package net.adaptivebox.space;
 
 public class DesignSpace {
-  //The information of all the dimension
+  // The information of all the dimension
   private DesignDim[] dimProps;
 
   public DesignSpace(int dim) {
     dimProps = new DesignDim[dim];
   }
 
-
-
   public void setElemAt(DesignDim elem, int index) {
     dimProps[index] = elem;
   }
 
   public int getDimension() {
-    if (dimProps==null) {
+    if (dimProps == null) {
       return -1;
     }
     return dimProps.length;
   }
 
-  public double boundAdjustAt(double val, int dim){
+  public double boundAdjustAt(double val, int dim) {
     return dimProps[dim].paramBound.boundAdjust(val);
   }
 
-  public void mutationAt(double[] location, int i){
+  public void mutationAt(double[] location, int i) {
     location[i] = dimProps[i].paramBound.getRandomValue();
   }
 
-
-
-
-
-
-
   public double getMagnitudeIn(int dimensionIndex) {
     return dimProps[dimensionIndex].paramBound.getLength();
   }
 
-
-
-
-  public void initializeGene(double[] tempX){
-    for(int i=0;i<tempX.length;i++) tempX[i] =  dimProps[i].paramBound.getRandomValue(); //Global.RandomGenerator.doubleRangeRandom(9.8, 10);
+  public void initializeGene(double[] tempX) {
+    for (int i = 0; i < tempX.length; i++)
+      tempX[i] = dimProps[i].paramBound.getRandomValue(); // Global.RandomGenerator.doubleRangeRandom(9.8, 10);
   }
 
   public void getMappingPoint(double[] point) {
-    for(int i=0; i<getDimension(); i++) {
+    for (int i = 0; i < getDimension(); i++) {
       point[i] = dimProps[i].paramBound.annulusAdjust(point[i]);
-      if(dimProps[i].isDiscrete()) {
+      if (dimProps[i].isDiscrete()) {
         point[i] = dimProps[i].getGrainedValue(point[i]);
       }
     }
   }
 
 }
-
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/ILocationEngine.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/ILocationEngine.java
index 66ab92a67ecf..6b839df6e43d 100644
--- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/ILocationEngine.java
+++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/ILocationEngine.java
@@ -20,6 +20,6 @@
 
 package net.adaptivebox.space;
 
-public interface ILocationEngine{
+public interface ILocationEngine {
   double[] getLocation();
 }


More information about the Libreoffice-commits mailing list