summaryrefslogtreecommitdiff
path: root/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space
diff options
context:
space:
mode:
authorTodor Balabanov <todor.balabanov@gmail.com>2019-05-12 10:35:45 +0300
committerJulien Nabet <serval2412@yahoo.fr>2019-05-12 22:50:34 +0200
commit51387dc280dadf7a29d215a72d2d0026451d2be6 (patch)
tree505567527c309db5be92fc50e6ae942f7cc12737 /nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space
parentc5338e3ad116dbde0aed801f459173231716efa3 (diff)
Formatting - Eclipse IDE Java Conventions with spaces for indentation.
Change-Id: I0c3e50ef25bda0bc4ae59665a07848fe75507121 Reviewed-on: https://gerrit.libreoffice.org/72185 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
Diffstat (limited to 'nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space')
-rw-r--r--nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/BasicPoint.java2
-rw-r--r--nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignDim.java13
-rw-r--r--nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignSpace.java29
-rw-r--r--nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/ILocationEngine.java2
4 files changed, 17 insertions, 29 deletions
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();
}