mirror of https://gitlab.com/pamhyr/pamhyr2
Ensemble: Made it compatible with other solver than mage8.
parent
ae006f52f4
commit
476bcc9c55
|
|
@ -526,10 +526,17 @@ class SolverLogEnsWindow(SolverLogWindow):
|
|||
self._process = self.new_process(self._parent)
|
||||
|
||||
self._log(f" *** Run #{self._last_run}", color="blue")
|
||||
|
||||
if self._solver._type in ["mage8"]:
|
||||
self._solver.export_ensemble_variation(
|
||||
self._study, self._workdir, qlog=self._output,
|
||||
samples=self._samples,
|
||||
)
|
||||
else:
|
||||
self.ensemble_variation_strickler()
|
||||
self._solver.export(
|
||||
self._study, self._workdir, qlog=self._output
|
||||
)
|
||||
|
||||
self._solver.run(
|
||||
self._study,
|
||||
|
|
@ -539,6 +546,16 @@ class SolverLogEnsWindow(SolverLogWindow):
|
|||
self._last_run += 1
|
||||
self._progress_bar.setValue(self._last_run - 1)
|
||||
|
||||
def ensemble_variation_strickler(self):
|
||||
for ens in self._samples:
|
||||
if ens.target_data is None:
|
||||
continue
|
||||
|
||||
if ens.data_type == "strickler_minor":
|
||||
ens.target_data.minor = next(self._samples[ens])
|
||||
elif ens.data_type == "strickler_medium":
|
||||
ens.target_data.medium = next(self._samples[ens])
|
||||
|
||||
def run(self):
|
||||
self._log(f" *** Run solver {self._solver.name}", color="blue")
|
||||
self.next()
|
||||
|
|
|
|||
Loading…
Reference in New Issue