def _init(self, factory): options = ScenarioTreeManagerClientSerial.register_options() sp = ScenarioTreeManagerClientSerial( options, factory=factory) sp.initialize() return sp
def _init(self, factory): options = ScenarioTreeManagerClientSerial.register_options() sp = ScenarioTreeManagerClientSerial( options, factory=factory) sp.initialize() return sp
def generate_sample_sp(self, size, **kwds): assert size > 0 def model_callback(scenario_name, node_list): m = self.sample(return_copy=True) return m scenario_tree_model = self._create_scenario_tree_model(size) factory = ScenarioTreeInstanceFactory( model=model_callback, scenario_tree=scenario_tree_model) options = \ ScenarioTreeManagerClientSerial.register_options() for key in kwds: options[key] = kwds[key] manager = ScenarioTreeManagerClientSerial(options, factory=factory) manager.initialize() manager.reference_model = self.reference_model.clone() return manager
def generate_sample_sp(self, size, **kwds): assert size > 0 def model_callback(scenario_name, node_list): m = self.sample(return_copy=True) return m scenario_tree_model = self._create_scenario_tree_model(size) factory = ScenarioTreeInstanceFactory( model=model_callback, scenario_tree=scenario_tree_model) options = \ ScenarioTreeManagerClientSerial.register_options() for key in kwds: options[key] = kwds[key] manager = ScenarioTreeManagerClientSerial(options, factory=factory) manager.initialize() manager.reference_model = self.reference_model.clone() return manager