Skip to content

Commit 9ec57bb

Browse files
ChristophBodensteinChristophBodenstein
authored andcommitted
added feedback for found targetvalues in cached sim
1 parent a910397 commit 9ec57bb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

TimeNETOptimizationEnvironment/src/toe/simulation/SimulatorCached.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.io.File;
99
import java.util.ArrayList;
1010
import java.util.Calendar;
11+
import toe.MeasurementForm;
1112
import toe.datamodel.parameter;
1213
import toe.datamodel.SimulationType;
1314
import toe.datamodel.MeasureType;
@@ -279,7 +280,7 @@ public void operationFeedback(String message, typedef.typeOfProcessFeedback feed
279280
ArrayList<SimulationType> simulationResults = this.getListOfCompletedSimulations();
280281
double oldDistance = 0.0;
281282
ArrayList<SimulationType> foundOptima = new ArrayList<>();
282-
283+
283284
MeasureType targetMeasure = support.getOptimizationMeasure();
284285
typeOfTarget selectedTypeOfTarget = targetMeasure.getTargetTypeOf();
285286
switch (selectedTypeOfTarget) {
@@ -297,7 +298,6 @@ public void operationFeedback(String message, typedef.typeOfProcessFeedback feed
297298
foundOptima.add(simulationResults.get(i));
298299
}
299300
}
300-
//TODO feedback --> set target value in measure-panel
301301
break;
302302
case max:
303303
oldDistance = simulationResults.get(0).getMeasureValueByMeasureName(targetMeasure.getMeasureName());
@@ -313,7 +313,6 @@ public void operationFeedback(String message, typedef.typeOfProcessFeedback feed
313313
foundOptima.add(simulationResults.get(i));
314314
}
315315
}
316-
//TODO feedback --> set target value in measure-panel
317316
break;
318317
case value:
319318
oldDistance = simulationResults.get(0).getDistanceToTargetValue();
@@ -344,7 +343,7 @@ public void operationFeedback(String message, typedef.typeOfProcessFeedback feed
344343
//Exactly one optimum with selected target value was found
345344
if (oldDistance > 0.0) {
346345
//distance not zero --> will adapt selected optimum!
347-
listener.operationFeedback("Target is unique, but distance is not 0.0.", typedef.typeOfProcessFeedback.TargetCheckSuccessful);
346+
listener.operationFeedback("Target is unique, but distance was not 0.0.", typedef.typeOfProcessFeedback.TargetCheckSuccessful);
348347
support.log("Distance to target is: " + oldDistance, typeOfLogLevel.INFO);
349348

350349
} else {
@@ -362,6 +361,9 @@ public void operationFeedback(String message, typedef.typeOfProcessFeedback feed
362361
}
363362
support.log("Targetvalue #0 will be used for optimization and statistics.", typeOfLogLevel.RESULT);
364363
calculatedOptimum = foundOptima.get(0);
364+
support.log("Will set targetvalue to: " + calculatedOptimum.getMeasureValueByMeasureName(targetMeasure.getMeasureName()), typeOfLogLevel.RESULT);
365+
MeasurementForm tmpMeasurementForm = (MeasurementForm) support.getMeasureFormPane().getComponent(0);
366+
tmpMeasurementForm.setTargetValue(calculatedOptimum.getMeasureValueByMeasureName(targetMeasure.getMeasureName()));
365367
break;
366368
case SimulationCanceled:
367369
support.log("Simulation aborted during targetcheck.", typeOfLogLevel.INFO);

0 commit comments

Comments
 (0)