Ensemble: Run: Log variation.

scenario-dev-pa
Pierre-Antoine 2026-08-27 10:10:08 +02:00
parent 7d8e414fe2
commit e7b9bc92a2
2 changed files with 17 additions and 6 deletions

View File

@ -1050,10 +1050,15 @@ class Mage8(Mage):
if ens.target_data is None: if ens.target_data is None:
continue continue
x = next(samples[ens])
qlog.put(f"*** Variation " +
f"'{ens.target_data}' - {ens.data_type} x {x}")
if ens.data_type == "strickler_minor": if ens.data_type == "strickler_minor":
ens.target_data.minor = next(samples[ens]) ens.target_data.minor = x
elif ens.data_type == "strickler_medium": elif ens.data_type == "strickler_medium":
ens.target_data.medium = next(samples[ens]) ens.target_data.medium = x
if qlog is not None: if qlog is not None:
qlog.put("Export variation of RUG file") qlog.put("Export variation of RUG file")

View File

@ -533,7 +533,7 @@ class SolverLogEnsWindow(SolverLogWindow):
samples=self._samples, samples=self._samples,
) )
else: else:
self.ensemble_variation_strickler() self.ensemble_variation()
self._solver.export( self._solver.export(
self._study, self._workdir, qlog=self._output self._study, self._workdir, qlog=self._output
) )
@ -546,15 +546,21 @@ class SolverLogEnsWindow(SolverLogWindow):
self._last_run += 1 self._last_run += 1
self._progress_bar.setValue(self._last_run - 1) self._progress_bar.setValue(self._last_run - 1)
def ensemble_variation_strickler(self): def ensemble_variation(self):
for ens in self._samples: for ens in self._samples:
if ens.target_data is None: if ens.target_data is None:
continue continue
x = next(self._samples[ens])
self._log(f"*** Variation #{self._last_run} " +
f"'{ens.target_data}' - {ens.data_type} x {x}",
color="blue")
if ens.data_type == "strickler_minor": if ens.data_type == "strickler_minor":
ens.target_data.minor = next(self._samples[ens]) ens.target_data.minor = x
elif ens.data_type == "strickler_medium": elif ens.data_type == "strickler_medium":
ens.target_data.medium = next(self._samples[ens]) ens.target_data.medium = x
def run(self): def run(self):
self._log(f" *** Run solver {self._solver.name}", color="blue") self._log(f" *** Run solver {self._solver.name}", color="blue")