예제 #1
0
    def InitializeIO(self, solvers, io_echo_level):
        if self.__IOIsInitialized():
            raise Exception('IO for "' + self.name +
                            '" is already initialized!')

        io_settings = self.settings["io_settings"]

        if not io_settings.Has("echo_level"):
            io_settings.AddEmptyValue("echo_level").SetInt(self.echo_level)

        self.io = io_factory.CreateIO(self.settings["io_settings"], self.model,
                                      self._GetIOName())
예제 #2
0
    def CreateIO(self, io_echo_level):
        if self.__HasIO():
            raise Exception('IO for solver "{}" is already created!'.format(
                self.name))

        io_settings = self.settings["io_settings"]

        if not io_settings.Has("echo_level"):
            io_settings.AddEmptyValue("echo_level").SetInt(self.echo_level)

        self.__io = io_factory.CreateIO(self.settings["io_settings"],
                                        self.model, self.name,
                                        self._GetIOType())