290 likes | 444 Views
Beforehands. OMOptim. C++ code Stored on subversion solver Using Qt libraries (GUI, Model/ View , Containers, Threads, XML…). Subversion repository. Main classes. Class Project. The Core of the program One project at a time Contains main items
E N D
OMOptim • C++ code • Stored on subversion solver • UsingQtlibraries (GUI, Model/View, Containers, Threads, XML…)
Subversion repository Plateforme CERES
Class Project • The Core of the program • One projectat a time • Contains main items • Modelicatree of models, package… (ModClassTree) • List of problems and results • List of ModModelPlus • Misc. Informations : save files, files loaded • Main functions • Problemsshouldbelaunchedfrom Project • Threads management
ModClass • Basic class, corresponding to an item in modelica • Each instance stores name and children Inheritancediagram
ModClassTree • Containsmodelicamodels, packages, classes names
ModModelPlus • ModModelPlusallows to store information about a modelica model (ModModel*). • Especially : • Input variables • Connections between components • It alsoprovidescompiling and readingfunctions. Still, thosefunctionsrequireModPlusCtrl.
ModPlusCtrl • Simulation software controler : • Specific for each simulation software • Provide interface functions : • Set simulation parameters • Writing / Reading variables • Compiling model • Simulating model • Set Parameters : • Simulation time • Solver • Tolerances • …
ModReader& MOOmc • Offeringmodelicareadingfunctions • MOOmc : linkbetweenOpenModelica & OMOptim (use Corbaprotocol) • QStringgetFlattenedModel (const QString &modelName) • booladdConnection (QString org, QStringdest) • voidgetInheritedComponents (QStringparentClass, QStringList &names, QStringList &classes) • …
Model management MOOMC Reading model Corba communication withOpenModelica MyFile.mo ModClassTree OMOptim Model A Model B • Compiling • Simulating • Reading/Writing variables
Launching a problem User Separate thread
Problem An abstract class defining basic functions. InheritsOMCasewhichcontains more basic virtualfunctions.
One Simulation Project ModModelPlus ModModelPlus
One Simulation OneSimResult
Problems’ plugin Plugin loading : dynamic or static • SharedOMOptim : • OneSimulation • Optimization • EnergyIntegration • PluginEI.dll MySensitivityanalysis Method: implement new inheritances of following abstract classes - ProblemInterface - Problem - Result
Energyintegration • EI is a plugin offering new problems • EIMER : Minimum energyrequirement • EITarget : Utilities targetting • EIHEN1 : HeatExchanger Network
Energyintegration ModPlusCtrl Modelica model MOOmc EIProblem -MER -Target -HEN MILP optimizationproblem
GUI – Core links • Often use Qt model-viewprogramming • Data / GUI more independent
Conventions used in code • Class namealwaysstartwith an uppercase : MyClass • Membersalwaysstartwith _ + lowercase _myInstance • Local variables startwithlowercase myLocalVariable • Documentation generatedthroughDoxygen
PluginEI OMOptim PluginEI OMOptim Modelica OMOptimBasis Variables, Problems, Settings, GUI