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 | |
parent | 14d1a11ec4a7ed0deeac522403248536e8d23f57 (diff) |
java: reduce scope, make fields private
found by UCDetector
Change-Id: I7f97e15667159cf8ee776e8f32fdcdec8ec00ed6
Diffstat (limited to 'nlpsolver')
11 files changed, 54 insertions, 54 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; diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java index a10a82eecb7b..a1a9cf29faea 100644 --- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java +++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java @@ -61,11 +61,11 @@ public abstract class BaseEvolutionarySolver extends BaseNLPSolver { } protected class Variable { - protected CellMap CellMap; - protected int OriginalVariable; - protected double MinValue; - protected double MaxValue; - protected double Granularity; + private CellMap CellMap; + private int OriginalVariable; + private double MinValue; + private double MaxValue; + private double Granularity; private Variable(CellMap cellMap, int originalVariable) { this.CellMap = cellMap; @@ -152,19 +152,19 @@ public abstract class BaseEvolutionarySolver extends BaseNLPSolver { protected double m_toleratedMin; protected double m_toleratedMax; - protected ArrayList<Variable> m_variables = new ArrayList<Variable>(); + private ArrayList<Variable> m_variables = new ArrayList<Variable>(); //properties protected PropertyInfo<Integer> m_swarmSize = new PropertyInfo<Integer>("SwarmSize", 70, "Size of Swam"); protected PropertyInfo<Integer> m_librarySize = new PropertyInfo<Integer>("LibrarySize", 210, "Size of Library"); protected PropertyInfo<Integer> m_learningCycles = new PropertyInfo<Integer>("LearningCycles", 2000, "Learning Cycles"); - protected PropertyInfo<Boolean> m_guessVariableRange = new PropertyInfo<Boolean>("GuessVariableRange", true, "Variable Bounds Guessing"); - protected PropertyInfo<Double> m_variableRangeThreshold = new PropertyInfo<Double>("VariableRangeThreshold", 3.0, "Variable Bounds Threshold (when guessing)"); //to approximate the variable bounds - protected PropertyInfo<Boolean> m_useACRComperator = new PropertyInfo<Boolean>("UseACRComparator", false, "Use ACR Comparator (instead of BCH)"); - protected PropertyInfo<Boolean> m_useRandomStartingPoint = new PropertyInfo<Boolean>("UseRandomStartingPoint", false, "Use Random starting point"); + private PropertyInfo<Boolean> m_guessVariableRange = new PropertyInfo<Boolean>("GuessVariableRange", true, "Variable Bounds Guessing"); + private PropertyInfo<Double> m_variableRangeThreshold = new PropertyInfo<Double>("VariableRangeThreshold", 3.0, "Variable Bounds Threshold (when guessing)"); //to approximate the variable bounds + private PropertyInfo<Boolean> m_useACRComperator = new PropertyInfo<Boolean>("UseACRComparator", false, "Use ACR Comparator (instead of BCH)"); + private PropertyInfo<Boolean> m_useRandomStartingPoint = new PropertyInfo<Boolean>("UseRandomStartingPoint", false, "Use Random starting point"); protected PropertyInfo<Integer> m_required = new PropertyInfo<Integer>("StagnationLimit", 70, "Stagnation Limit"); protected PropertyInfo<Double> m_tolerance = new PropertyInfo<Double>("Tolerance", 1e-6, "Stagnation Tolerance"); - protected PropertyInfo<Boolean> m_enhancedSolverStatus = new PropertyInfo<Boolean>("EnhancedSolverStatus", true, "Show enhanced solver status"); + private PropertyInfo<Boolean> m_enhancedSolverStatus = new PropertyInfo<Boolean>("EnhancedSolverStatus", true, "Show enhanced solver status"); protected IEvolutionarySolverStatusDialog m_solverStatusDialog; diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java index 3709ecb9c12a..34338123c2dd 100644 --- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java +++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java @@ -71,13 +71,13 @@ public abstract class BaseNLPSolver extends WeakBase { protected final XComponentContext m_xContext; - protected final String m_name; + private final String m_name; - protected final ArrayList<PropertyInfo> m_properties = new ArrayList<PropertyInfo>(); - protected final HashMap<String, PropertyInfo> m_propertyMap = new HashMap<String, PropertyInfo>(); + private final ArrayList<PropertyInfo> m_properties = new ArrayList<PropertyInfo>(); + private final HashMap<String, PropertyInfo> m_propertyMap = new HashMap<String, PropertyInfo>(); - protected com.sun.star.lang.Locale m_locale = new com.sun.star.lang.Locale(); - protected final ResourceManager resourceManager; + private com.sun.star.lang.Locale m_locale = new com.sun.star.lang.Locale(); + private final ResourceManager resourceManager; public BaseNLPSolver(XComponentContext xContext, String name) { m_xContext = xContext; @@ -115,11 +115,11 @@ public abstract class BaseNLPSolver extends WeakBase // com.sun.star.sheet.XSolver: - protected XSpreadsheetDocument m_document; - protected XMultiComponentFactory m_componentFactory; - protected XModel m_xModel; + private XSpreadsheetDocument m_document; + private XMultiComponentFactory m_componentFactory; + private XModel m_xModel; protected XReschedule m_xReschedule; - protected CellAddress m_objective; + private CellAddress m_objective; protected CellAddress[] m_variables; protected SolverConstraint[] m_constraints; protected ExtSolverConstraint[] m_extConstraints; @@ -130,7 +130,7 @@ public abstract class BaseNLPSolver extends WeakBase protected int m_cellRangeCount; protected XCell m_objectiveCell; protected XCell[] m_variableCells; - protected CellRangeAddress[] m_cellRanges; + private CellRangeAddress[] m_cellRanges; protected XChartDataArray[] m_cellRangeData; protected CellMap[] m_variableMap; protected double[][][] m_variableData; @@ -165,10 +165,10 @@ public abstract class BaseNLPSolver extends WeakBase } protected class RowInfo { - protected short Sheet; - protected int Row; - protected int StartCol; - protected int EndCol; + private short Sheet; + private int Row; + private int StartCol; + private int EndCol; private RowInfo(short sheet, int row) { Sheet = sheet; diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/BaseDialog.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/BaseDialog.java index fec55c92a833..2aaa534ddff2 100644 --- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/BaseDialog.java +++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/BaseDialog.java @@ -61,8 +61,8 @@ public abstract class BaseDialog extends BaseControl { private XMultiServiceFactory xMSF; protected XWindow xWindow; protected XDialog xDialog; - protected XWindowPeer xWindowPeer; - protected ModalState modalState; + private XWindowPeer xWindowPeer; + private ModalState modalState; @Override public String getName() { diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/BaseControl.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/BaseControl.java index 01d724c351d0..a1de9d28ff29 100644 --- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/BaseControl.java +++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/BaseControl.java @@ -46,8 +46,8 @@ public abstract class BaseControl { protected XComponentContext context; private Object unoModel; protected Object unoControl; - protected XPropertySet properties; - protected BaseControl parentControl; + private XPropertySet properties; + private BaseControl parentControl; public abstract String getName(); |