diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-08 11:36:04 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-13 08:49:22 +0200 |
commit | da677dfd59c2b551f3335ee0a5d5dfb33f9869c5 (patch) | |
tree | 9aa09066c95935117bf405b119ed9f89f448a54d /nlpsolver/ThirdParty/EvolutionarySolver/src | |
parent | 14d1a11ec4a7ed0deeac522403248536e8d23f57 (diff) |
java: reduce scope, make fields private
found by UCDetector
Change-Id: I7f97e15667159cf8ee776e8f32fdcdec8ec00ed6
Diffstat (limited to 'nlpsolver/ThirdParty/EvolutionarySolver/src')
7 files changed, 25 insertions, 25 deletions
diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java index 3107fa8deff1..5482b180cd88 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/DEPSAgent.java @@ -41,28 +41,28 @@ import net.adaptivebox.space.*; public class DEPSAgent implements ILibEngine { //Describes the problem to be solved - protected ProblemEncoder problemEncoder; + private ProblemEncoder problemEncoder; //Forms the goodness landscape - protected IGoodnessCompareEngine qualityComparator; + private IGoodnessCompareEngine qualityComparator; //store the point that generated in current learning cycle - protected SearchPoint trailPoint; + private SearchPoint trailPoint; //temp variable private AbsGTBehavior selectGTBehavior; //The referred library - protected Library socialLib; + private Library socialLib; //the own memory: store the point that generated in old learning cycle - protected BasicPoint pold_t; + private BasicPoint pold_t; //the own memory: store the point that generated in last learning cycle - protected BasicPoint pcurrent_t; + private BasicPoint pcurrent_t; //the own memory: store the personal best point - protected SearchPoint pbest_t; + private SearchPoint pbest_t; //Generate-and-test Behaviors - protected DEGTBehavior deGTBehavior; - protected PSGTBehavior psGTBehavior; + private DEGTBehavior deGTBehavior; + private PSGTBehavior psGTBehavior; public double switchP = 0.5; public void setLibrary(Library lib) { 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 3c1a12a0be9b..b215c348e3f4 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java @@ -40,12 +40,12 @@ import net.adaptivebox.problem.*; import net.adaptivebox.space.*; public class DEGTBehavior extends AbsGTBehavior implements ILibEngine { - public int DVNum = 2; //Number of differential vectors, normally be 1 or 2 + private 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 - protected SearchPoint pbest_t; + private SearchPoint pbest_t; public void setPbest(SearchPoint pbest) { pbest_t = pbest; 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 68c3270adb79..19f1971f6c0c 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/PSGTBehavior.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/PSGTBehavior.java @@ -71,11 +71,11 @@ public class PSGTBehavior extends AbsGTBehavior { 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 - protected BasicPoint pold_t; + private BasicPoint pold_t; //the own memory: store the point that generated in last learning cycle - protected BasicPoint pcurrent_t; + private BasicPoint pcurrent_t; //the own memory: store the personal best point - protected SearchPoint pbest_t; + private SearchPoint pbest_t; public void setMemPoints(SearchPoint pbest, BasicPoint pcurrent, BasicPoint pold) { pcurrent_t = pcurrent; diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/EvalStruct.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/EvalStruct.java index ad44df1dc2d2..8fba6038e8b7 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/EvalStruct.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/EvalStruct.java @@ -27,7 +27,7 @@ package net.adaptivebox.encode; public class EvalStruct { // The information for evaluating all the responses - public EvalElement[] evalElems = null; + private EvalElement[] evalElems = null; public EvalStruct(int elemsNum) { evalElems = new EvalElement[elemsNum]; diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/Library.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/Library.java index eb2045765594..c94812edf5ce 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/Library.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/Library.java @@ -30,7 +30,7 @@ import net.adaptivebox.problem.*; public class Library { private SearchPoint[] libPoints = new SearchPoint[0]; - protected int gIndex = -1; + private int gIndex = -1; public Library(SearchPoint[] points){ this.libPoints = points; diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/problem/ProblemEncoder.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/problem/ProblemEncoder.java index 2e91e65cde51..5bbd88a26a45 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/problem/ProblemEncoder.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/problem/ProblemEncoder.java @@ -33,14 +33,14 @@ import net.adaptivebox.knowledge.*; public abstract class ProblemEncoder { //Store the calculated results for the responses - double[] tempResponseSet; //temp values - double[] tempLocation; //temp values + private double[] tempResponseSet; //temp values + private double[] tempLocation; //temp values //the search space (S) - protected DesignSpace designSpace = null; + private DesignSpace designSpace = null; // For evaluate the response vector into encoded vector double[2] - protected EvalStruct evalStruct = null; + private EvalStruct evalStruct = null; protected ProblemEncoder(int paramNum, int targetNum) throws Exception { designSpace = new DesignSpace(paramNum); diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/sco/SCAgent.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/sco/SCAgent.java index 910270e9e2da..80be5148c8f2 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/sco/SCAgent.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/sco/SCAgent.java @@ -48,16 +48,16 @@ public class SCAgent { private IGoodnessCompareEngine specComparator; //the coefficients of SCAgent - protected int TaoB = 2; + private int TaoB = 2; //The early version set TaoW as the size of external library (NL), but 4 is often enough - protected int TaoW = 4; + private int TaoW = 4; //The referred external library - protected Library externalLib; + private Library externalLib; //store the point that generated in current learning cycle - protected SearchPoint trailPoint; + private SearchPoint trailPoint; //the own memory: store the point that generated in last learning cycle - protected SearchPoint pcurrent_t; + private SearchPoint pcurrent_t; public void setExternalLib(Library lib) { externalLib = lib; |