Import of each class is better practice than import of entire library.
Change-Id: I13c4916b951d36ea5e83e52c9c6e36df552bdfeb Reviewed-on: https://gerrit.libreoffice.org/71961 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
This commit is contained in:
committed by
Julien Nabet
parent
8a26e4b26f
commit
7aeef2e88b
+8
-4
@@ -32,11 +32,15 @@ package net.adaptivebox.deps;
|
||||
* -> an agent perspective
|
||||
*/
|
||||
|
||||
import net.adaptivebox.deps.behavior.*;
|
||||
import net.adaptivebox.deps.behavior.AbsGTBehavior;
|
||||
import net.adaptivebox.deps.behavior.DEGTBehavior;
|
||||
import net.adaptivebox.deps.behavior.PSGTBehavior;
|
||||
import net.adaptivebox.goodness.IGoodnessCompareEngine;
|
||||
import net.adaptivebox.knowledge.*;
|
||||
import net.adaptivebox.problem.*;
|
||||
import net.adaptivebox.space.*;
|
||||
import net.adaptivebox.knowledge.ILibEngine;
|
||||
import net.adaptivebox.knowledge.Library;
|
||||
import net.adaptivebox.knowledge.SearchPoint;
|
||||
import net.adaptivebox.problem.ProblemEncoder;
|
||||
import net.adaptivebox.space.BasicPoint;
|
||||
|
||||
public class DEPSAgent implements ILibEngine {
|
||||
|
||||
|
||||
Vendored
+4
-3
@@ -17,9 +17,10 @@
|
||||
*/
|
||||
package net.adaptivebox.deps.behavior;
|
||||
|
||||
import net.adaptivebox.goodness.*;
|
||||
import net.adaptivebox.knowledge.*;
|
||||
import net.adaptivebox.problem.*;
|
||||
import net.adaptivebox.goodness.IGoodnessCompareEngine;
|
||||
import net.adaptivebox.knowledge.Library;
|
||||
import net.adaptivebox.knowledge.SearchPoint;
|
||||
import net.adaptivebox.problem.ProblemEncoder;
|
||||
|
||||
abstract public class AbsGTBehavior {
|
||||
//The referred social library
|
||||
|
||||
Vendored
+7
-5
@@ -28,11 +28,13 @@
|
||||
|
||||
package net.adaptivebox.deps.behavior;
|
||||
|
||||
import net.adaptivebox.goodness.*;
|
||||
import net.adaptivebox.global.*;
|
||||
import net.adaptivebox.knowledge.*;
|
||||
import net.adaptivebox.problem.*;
|
||||
import net.adaptivebox.space.*;
|
||||
import net.adaptivebox.global.RandomGenerator;
|
||||
import net.adaptivebox.goodness.IGoodnessCompareEngine;
|
||||
import net.adaptivebox.knowledge.ILibEngine;
|
||||
import net.adaptivebox.knowledge.Library;
|
||||
import net.adaptivebox.knowledge.SearchPoint;
|
||||
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
|
||||
|
||||
Vendored
+6
-4
@@ -55,10 +55,12 @@
|
||||
|
||||
package net.adaptivebox.deps.behavior;
|
||||
|
||||
import net.adaptivebox.goodness.*;
|
||||
import net.adaptivebox.knowledge.*;
|
||||
import net.adaptivebox.problem.*;
|
||||
import net.adaptivebox.space.*;
|
||||
import net.adaptivebox.goodness.IGoodnessCompareEngine;
|
||||
import net.adaptivebox.knowledge.Library;
|
||||
import net.adaptivebox.knowledge.SearchPoint;
|
||||
import net.adaptivebox.problem.ProblemEncoder;
|
||||
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)
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
|
||||
package net.adaptivebox.encode;
|
||||
|
||||
import net.adaptivebox.global.*;
|
||||
import net.adaptivebox.global.BasicBound;
|
||||
|
||||
public class EvalElement {
|
||||
|
||||
|
||||
+2
-3
@@ -31,9 +31,8 @@
|
||||
|
||||
package net.adaptivebox.goodness;
|
||||
|
||||
import net.adaptivebox.knowledge.*;
|
||||
import net.adaptivebox.global.*;
|
||||
|
||||
import net.adaptivebox.global.IUpdateCycleEngine;
|
||||
import net.adaptivebox.knowledge.Library;
|
||||
|
||||
public class ACRComparator implements IGoodnessCompareEngine, IUpdateCycleEngine {
|
||||
private final Library socialPool;
|
||||
|
||||
+4
-3
@@ -24,9 +24,10 @@
|
||||
*/
|
||||
package net.adaptivebox.knowledge;
|
||||
|
||||
import net.adaptivebox.global.*;
|
||||
import net.adaptivebox.goodness.*;
|
||||
import net.adaptivebox.problem.*;
|
||||
import net.adaptivebox.global.BasicBound;
|
||||
import net.adaptivebox.global.RandomGenerator;
|
||||
import net.adaptivebox.goodness.IGoodnessCompareEngine;
|
||||
import net.adaptivebox.problem.ProblemEncoder;
|
||||
|
||||
public class Library {
|
||||
private final SearchPoint[] libPoints;
|
||||
|
||||
+3
-4
@@ -19,9 +19,9 @@
|
||||
*/
|
||||
package net.adaptivebox.knowledge;
|
||||
|
||||
import net.adaptivebox.global.*;
|
||||
import net.adaptivebox.space.*;
|
||||
import net.adaptivebox.encode.*;
|
||||
import net.adaptivebox.encode.IEncodeEngine;
|
||||
import net.adaptivebox.global.BasicBound;
|
||||
import net.adaptivebox.space.BasicPoint;
|
||||
|
||||
public class SearchPoint extends BasicPoint implements IEncodeEngine {
|
||||
//store the encode information for goodness evaluation
|
||||
@@ -68,5 +68,4 @@ public class SearchPoint extends BasicPoint implements IEncodeEngine {
|
||||
return encodeInfo[0] == 0; //no constraint violations
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+6
-8
@@ -26,10 +26,12 @@
|
||||
|
||||
package net.adaptivebox.problem;
|
||||
|
||||
import net.adaptivebox.global.*;
|
||||
import net.adaptivebox.space.*;
|
||||
import net.adaptivebox.encode.*;
|
||||
import net.adaptivebox.knowledge.*;
|
||||
import net.adaptivebox.encode.EvalElement;
|
||||
import net.adaptivebox.encode.EvalStruct;
|
||||
import net.adaptivebox.global.BasicBound;
|
||||
import net.adaptivebox.knowledge.SearchPoint;
|
||||
import net.adaptivebox.space.DesignDim;
|
||||
import net.adaptivebox.space.DesignSpace;
|
||||
|
||||
public abstract class ProblemEncoder {
|
||||
//Store the calculated results for the responses
|
||||
@@ -61,8 +63,6 @@ public abstract class ProblemEncoder {
|
||||
designSpace.setElemAt(dd, i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//set the default information for evaluation each response
|
||||
protected void setDefaultYAt(int i, double min, double max) {
|
||||
EvalElement ee = new EvalElement();
|
||||
@@ -70,8 +70,6 @@ public abstract class ProblemEncoder {
|
||||
evalStruct.setElemAt(ee, i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//get a fresh point
|
||||
public SearchPoint getFreshSearchPoint() {
|
||||
return new SearchPoint(designSpace.getDimension());
|
||||
|
||||
+7
-6
@@ -33,12 +33,13 @@ package net.adaptivebox.sco;
|
||||
* optimization. Genetic and Evolutionary Computation Conference, 2004: 261-262
|
||||
*/
|
||||
|
||||
|
||||
import net.adaptivebox.global.*;
|
||||
import net.adaptivebox.space.*;
|
||||
import net.adaptivebox.goodness.*;
|
||||
import net.adaptivebox.problem.*;
|
||||
import net.adaptivebox.knowledge.*;
|
||||
import net.adaptivebox.problem.ProblemEncoder;
|
||||
import net.adaptivebox.space.DesignSpace;
|
||||
import net.adaptivebox.space.ILocationEngine;
|
||||
import net.adaptivebox.global.RandomGenerator;
|
||||
import net.adaptivebox.goodness.IGoodnessCompareEngine;
|
||||
import net.adaptivebox.knowledge.Library;
|
||||
import net.adaptivebox.knowledge.SearchPoint;
|
||||
|
||||
public class SCAgent {
|
||||
|
||||
|
||||
+2
-4
@@ -20,7 +20,8 @@
|
||||
*/
|
||||
|
||||
package net.adaptivebox.space;
|
||||
import net.adaptivebox.global.*;
|
||||
|
||||
import net.adaptivebox.global.BasicBound;
|
||||
|
||||
public class DesignDim {
|
||||
// To discrete space with the given step. For example, for an integer variable,
|
||||
@@ -28,9 +29,6 @@ public class DesignDim {
|
||||
public double grain = 0;
|
||||
public BasicBound paramBound = new BasicBound(); //the range of a parameter
|
||||
|
||||
|
||||
|
||||
|
||||
public boolean isDiscrete() {
|
||||
return grain!=0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user