Example #1
0
    def __init__(self, modelName, simulator, outputDirectory='.'):
        import buildingspy.io.reporter as reporter
        import os

        ## Check arguments and make output directory if needed
        if simulator != "dymola":
            raise ValueError(
                "Argument 'simulator' needs to be set to 'dymola'.")
        # Set log file name for python script
        logFilNam = os.path.join(outputDirectory, "BuildingsPy.log")

        self.modelName = modelName
        self.__outputDir__ = outputDirectory
        ## This call is needed so that the reporter can write to the working directory
        self.__createDirectory(outputDirectory)
        self.__preProcessing__ = list()
        self.__postProcessing__ = list()
        self.__parameters__ = {}
        self.__modelModifiers__ = list()
        self.__simulator__ = {}
        self.setStartTime(0)
        self.setStopTime(1)
        self.setTolerance(1E-6)
        self.setSolver("radau")
        self.setResultFile(modelName)
        self.setTimeOut(-1)
        self.__MODELICA_EXE = 'dymola'
        self.__reporter = reporter.Reporter(fileName=logFilNam)
        self.__showProgressBar = True
        self.__showGUI = False
        self.__exitSimulator = True
Example #2
0
    def __init__(self, modelName, outputDirectory, packagePath,
                 outputFileList):
        import buildingspy.io.reporter as reporter
        import os

        # Set log file name for python script
        logFilNam = os.path.join(outputDirectory, "BuildingsPy.log")

        # Check if the packagePath parameter is correct
        self._packagePath = None
        if packagePath is None:
            self.setPackagePath(os.path.abspath('.'))
        else:
            self.setPackagePath(packagePath)

        self.modelName = modelName
        self._parameters_ = {}
        self._modelModifiers_ = list()

        self._simulator_ = {}

        self._outputDir_ = outputDirectory

        self._outputFileList = outputFileList

        # This call is needed so that the reporter can write to the working directory
        self._createDirectory(outputDirectory)

        #        # This call is needed so that the reporter can write to the working directory
        #        self._createDirectory(outputDirectory)
        #        self._preProcessing_ = list()
        #        self._postProcessing_ = list()
        #        self._parameters_ = {}
        #        self._modelModifiers_ = list()
        self.setStartTime(None)
        self.setStopTime(None)
        self.setTolerance(1E-6)
        self.setNumberOfIntervals()
        #        self.setSolver("radau")
        self.setTimeOut(-1)
        self._MODELICA_EXE = None
        self._reporter = reporter.Reporter(fileName=logFilNam)
        self._showProgressBar = False
        self._showGUI = False
        self._exitSimulator = True