Skip to content
Snippets Groups Projects
Commit c766ed2a authored by Guylaine Prat's avatar Guylaine Prat
Browse files

Checkstyle correction: variable set to private in abstract class

parent d188c073
No related branches found
No related tags found
No related merge requests found
......@@ -98,8 +98,8 @@ public class GroundOptimizationProblemBuilder extends OptimizationProblemBuilder
final String ruggedName = rugged.getName();
this.sensorToGroundMappings = new ArrayList<SensorToGroundMapping>();
for (final LineSensor lineSensor : sensors) {
final SensorToGroundMapping mapping = this.measurements.getGroundMapping(ruggedName, lineSensor.getName());
for (final LineSensor lineSensor : this.getSensors()) {
final SensorToGroundMapping mapping = this.getMeasurements().getGroundMapping(ruggedName, lineSensor.getName());
if (mapping != null) {
this.sensorToGroundMappings.add(mapping);
}
......@@ -163,7 +163,7 @@ public class GroundOptimizationProblemBuilder extends OptimizationProblemBuilder
// set the current parameters values
int i = 0;
for (final ParameterDriver driver : this.drivers) {
for (final ParameterDriver driver : this.getDrivers()) {
driver.setNormalizedValue(point.getEntry(i++));
}
......@@ -171,12 +171,12 @@ public class GroundOptimizationProblemBuilder extends OptimizationProblemBuilder
// compute inverse loc and its partial derivatives
final RealVector value = new ArrayRealVector(target.length);
final RealMatrix jacobian = new Array2DRowRealMatrix(target.length, this.nbParams);
final RealMatrix jacobian = new Array2DRowRealMatrix(target.length, this.getNbParams());
int l = 0;
for (final SensorToGroundMapping reference : this.sensorToGroundMappings) {
for (final Map.Entry<SensorPixel, GeodeticPoint> mapping : reference.getMapping()) {
final GeodeticPoint gp = mapping.getValue();
final DerivativeStructure[] ilResult = this.rugged.inverseLocationDerivatives(reference.getSensorName(), gp, minLine, maxLine, generator);
final DerivativeStructure[] ilResult = this.rugged.inverseLocationDerivatives(reference.getSensorName(), gp, minLine, maxLine, this.getGenerator());
if (ilResult == null) {
value.setEntry(l, minLine - 100.0); // arbitrary
......@@ -190,9 +190,9 @@ public class GroundOptimizationProblemBuilder extends OptimizationProblemBuilder
value.setEntry(l + 1, ilResult[1].getValue());
// extract the Jacobian
final int[] orders = new int[this.nbParams];
final int[] orders = new int[this.getNbParams()];
int m = 0;
for (final ParameterDriver driver : this.drivers) {
for (final ParameterDriver driver : this.getDrivers()) {
final double scale = driver.getScale();
orders[m] = 1;
jacobian.setEntry(l, m,
......
......@@ -100,12 +100,12 @@ public class InterSensorsOptimizationProblemBuilder extends OptimizationProblemB
for (final String ruggedNameA : this.ruggedMap.keySet()) {
for (final String ruggedNameB : this.ruggedMap.keySet()) {
for (final LineSensor sensorA : this.sensors) {
for (final LineSensor sensorB : this.sensors) {
for (final LineSensor sensorA : this.getSensors()) {
for (final LineSensor sensorB : this.getSensors()) {
final String sensorNameA = sensorA.getName();
final String sensorNameB = sensorB.getName();
final SensorToSensorMapping mapping = this.measurements.getInterMapping(ruggedNameA, sensorNameA, ruggedNameB, sensorNameB);
final SensorToSensorMapping mapping = this.getMeasurements().getInterMapping(ruggedNameA, sensorNameA, ruggedNameB, sensorNameB);
if (mapping != null) {
this.sensorToSensorMappings.add(mapping);
......@@ -181,7 +181,7 @@ public class InterSensorsOptimizationProblemBuilder extends OptimizationProblemB
try {
// set the current parameters values
int i = 0;
for (final ParameterDriver driver : this.drivers) {
for (final ParameterDriver driver : this.getDrivers()) {
driver.setNormalizedValue(point.getEntry(i++));
}
......@@ -189,7 +189,7 @@ public class InterSensorsOptimizationProblemBuilder extends OptimizationProblemB
// compute distance and its partial derivatives
final RealVector value = new ArrayRealVector(target.length);
final RealMatrix jacobian = new Array2DRowRealMatrix(target.length, this.nbParams);
final RealMatrix jacobian = new Array2DRowRealMatrix(target.length, this.getNbParams());
int l = 0;
for (final SensorToSensorMapping reference : this.sensorToSensorMappings) {
......@@ -224,7 +224,7 @@ public class InterSensorsOptimizationProblemBuilder extends OptimizationProblemB
final DerivativeStructure[] ilResult =
ruggedB.distanceBetweenLOSDerivatives(lineSensorA, dateA, pixelA, scToBodyA,
lineSensorB, dateB, pixelB, generator);
lineSensorB, dateB, pixelB, this.getGenerator());
if (ilResult == null) {
// TODO GP manque code
......@@ -234,10 +234,10 @@ public class InterSensorsOptimizationProblemBuilder extends OptimizationProblemB
value.setEntry(l + 1, ilResult[1].getValue());
// extract the Jacobian
final int[] orders = new int[this.nbParams];
final int[] orders = new int[this.getNbParams()];
int m = 0;
for (final ParameterDriver driver : this.drivers) {
for (final ParameterDriver driver : this.getDrivers()) {
final double scale = driver.getScale();
orders[m] = 1;
jacobian.setEntry(l, m, ilResult[0].getPartialDerivative(orders) * scale);
......
......@@ -55,19 +55,19 @@ abstract class OptimizationProblemBuilder {
protected static final int ESTIMATION_LINE_RANGE_MARGIN = 100;
/** Derivative structure generator.*/
protected final DSGenerator generator;
private final DSGenerator generator;
/** Parameter drivers list. */
protected final List<ParameterDriver> drivers;
private final List<ParameterDriver> drivers;
/** Number of parameters to refine. */
protected final int nbParams;
private final int nbParams;
/** Measurements. */
protected Observables measurements;
private Observables measurements;
/** Sensors list. */
protected final List<LineSensor> sensors;
private final List<LineSensor> sensors;
/** Constructor.
* @param sensors list of sensors to refine
......@@ -91,29 +91,6 @@ abstract class OptimizationProblemBuilder {
this.sensors = sensors;
}
/** Get the number of parameters to refine.
* @return the number of parameters to refine
*/
public final int getNbParams() {
return this.nbParams;
}
/**
* Get the parameters drivers list.
* @return the selected list of parameters driver
*/
public final List<ParameterDriver> getSelectedParametersDriver() {
return this.drivers;
}
/**
* Get the derivative structure generator.
* @return the derivative structure generator.
*/
public final DSGenerator getGenerator() {
return this.generator;
}
/** Least squares problem builder.
* @param maxEvaluations maximum number of evaluations
* @param convergenceThreshold convergence threshold
......@@ -259,4 +236,41 @@ abstract class OptimizationProblemBuilder {
}
};
}
/** Get the sensors list.
* @return the sensors list
*/
protected List<LineSensor> getSensors() {
return sensors;
}
/** Get the number of parameters to refine.
* @return the number of parameters to refine
*/
protected final int getNbParams() {
return this.nbParams;
}
/**
* Get the parameters drivers list.
* @return the selected list of parameters driver
*/
protected final List<ParameterDriver> getDrivers() {
return this.drivers;
}
/**
* Get the derivative structure generator.
* @return the derivative structure generator.
*/
protected final DSGenerator getGenerator() {
return this.generator;
}
/** Get the measurements.
* @return the measurements
*/
protected Observables getMeasurements() {
return measurements;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment