SlideShare une entreprise Scribd logo
1  sur  40
Télécharger pour lire hors ligne
OpenMI Developers Training




       Jan Gregersen
   http://www.LicTek.com

              Jan Gregersen   1
Simple River
         Runoff Model                                     Simple River

     OutputExchangeItem                                  InputExchangeItem
         Quantity ID : Runoff
                                                          Quantity ID : Inflow
         DataOperaiton : Distributed

     ElementSet : Polygons                                ElementSet : Polyline

Y (km)                                 5            10
                                                         Y (km)

10
                                               10         Node:0

                                                                  Branch:0



                                                                                        Node:1
5
                                               5
                                                                             Branch:1
                                                                                           Node:2

                                                                                        Branch:2
                                                                                                    Node:3
                                                    X (km)
                                                                                                             X (km)
                                           5             10
                                               Jan Gregersen                                                   2
How it works


Load components:




Query exchange items:




Add links:




                          Jan Gregersen   3
How it works


Prepare:




Run (GetValues):




Finish:




                     Jan Gregersen   4
The OpenMI standard


DHI - Water & Environment   Jan Gregersen
Jan Gregersen   6
Migration of models


DHI - Water & Environment   Jan Gregersen
Now What ???




   Jan Gregersen   8
Org.OpenMI.Utilities

  Org.OpenMI.Utilities.Buffer     Buffers results from the engine core

      SmartBuffer

                                  Mapping of values associated to one array of
                                  times /timespans to values represented on another
                                  array of times/timespans



                                                          t                t

Org.OpenMI.Utilities.Spatial
                                  Mapping of values associated to
    ElementMapper                 one ElementSet to be represented
                                  on another ElementSet

Org.OpenMI.Utilities.Wrapper
                                  Generic wrapper suited for time
    SmartWrapper                  stepping model engines


                                          Jan Gregersen                               9
LinkableEngine features

• Provides a default implementation of the
  ILinkableComponent interface
• Links bookkeeping
• Event handling
• Buffering
• Temporal interpolations, aggregations,
  extrapolations
• Spatial interpolations, aggregations,
   extrapolations




                         Jan Gregersen       10
Wrapper design pattern




       Jan Gregersen     11
IEngine Interface
// -- Execution control methods (Inherited from IRunEngine) --
void Initialize(Hashtable properties);
bool PerformTimeStep();
void Finish();
//-- Time methods (Inherited from IRunEngine) --
ITime   GetCurrentTime();
ITime   GetInputTime(string QuantityID, string ElementSetID);
ITimeStamp GetEarliestNeededTime();
//-- Data access methods (Inherited from IRunEngine) --
void   SetValues(string QuantityID, string ElementSetID, IValueSet values);
IValueSet GetValues(string QuantityID, string ElementSetID);
//-- Component description methods (Inherited from IRunEngine) --
double GetMissingValueDefinition();
string GetComponentID();
string GetComponentDescription();
// -- Model description methods --
string GetModelID();
string GetModelDescription();
double GetTimeHorizon();
// -- Exchange items --
int GetInputExchangeItemCount();
int GetOutputExchangeItemCount();
org.OpenMI.Backbone GetInputExchangeItem(int exchangeItemIndex);
org.OpenMI.Backbone GetOutputExchangeItem(int exchangeItemIndex);




                                                         Jan Gregersen        12
Inside the LinkableEngine
           has             SmartWrapper                  has


   SmartInputLinkSet                                 SmartOutputLinkSet
UpdateInput()                                      UpdateBuffer()
           1
                                                   GetValues()
                 access
          has               Link                     access         1
                                       Link                          has
           *                                                        *
    SmartInputLink                                     SmartOutputLink
UpdateInput()                    has               UpdateBuffer()
                                                   GetValues()

                                                                    has

                   SmartBuffer                         ElementMapper



                                   Jan Gregersen                           13
GetValues()

Model B                   Model A

     GetValues(time, LinkID)

   GetValues(time, LinkID)

                                     1. Update with input from linked models



                                     2. Perform time step and fill internal buffers


                                                 While (CurrentTime < time & State is “Not Busy”)



                                     3. Map values in time and space


          Return values


                                     Jan Gregersen                                                  14
GetValues()

Model B                   Model A

     GetValues(time, LinkID)

   GetValues(time, LinkID)

                                     1. Update with input from linked models



                                     2. Perform time step and fill internal buffers


                                                 While (CurrentTime < time & State is “Not Busy”)



                                     3. Map values in time and space


          Return values


                                     Jan Gregersen                                                  15
GetValues()
                                  Engine        Smart      A Smart                  A        Smart     A Smart
                                                                       A Smart
Model B       Model A              AIP         Output      Output                Element   InputLink    Input
                                                                        Buffer
                                  Access       LInkSet       LInk                Mapper       Set        Link

 GetValues(tl LinkID)
                   GetCurrentTime()




                        IsBusy = true              UpdateInput(ct)



                                                                                                UpdateInput(ct)
                                                GetValues(ct,LinkID)




                                        SetValues(Quantity,LocationID,Values)




                                                                                            For each Input Link



                                                    Jan Gregersen                                           16
GetValues()

Model B                   Model A

     GetValues(time, LinkID)

   GetValues(time, LinkID)

                                     1. Update with input from linked models



                                     2. Perform time step and fill internal buffers


                                                 While (CurrentTime < time & State is “Not Busy”)



                                     3. Map values in time and space


          Return values


                                     Jan Gregersen                                                  17
GetValues()
                                Engine            Smart     A Smart                   A           Smart     A Smart
                                                                       A Smart
Model B   Model A                AIP             Output     Output                 Element      InputLink    Input
                                                                        Buffer
                                Access           LInkSet      LInk                 Mapper          Set        Link


             PerformTimeStep()



                        UpdateBuffers()


                                                      UpdateBuffer()


                                     Getvalues(Quantity,LocationIDs)



                                                                 Addvalues(time, valueSet)




                                                                             For each output link

                    IsBusy = false


                                                      Jan Gregersen                                             18
GetValues()

Model B                   Model A

     GetValues(time, LinkID)

   GetValues(time, LinkID)

                                     1. Update with input from linked models



                                     2. Perform time step and fill internal buffers


                                                 While (CurrentTime < time & State is “Not Busy”)



                                     3. Map values in time and space


          Return values


                                     Jan Gregersen                                                  19
GetValues()

                             Engine            Smart       A Smart                   A        Smart     A Smart
                                                                        A Smart
Model B   Model A             AIP             Output       Output                 Element   InputLink    Input
                                                                         Buffer
                             Access           LInkSet        LInk                 Mapper       Set        Link




                    GetValues(time, LinkID)


                                                   GetValues(time)


                                                                GetValues(time)




                                                                 MapValues(inpuValues)




                                                        Jan Gregersen                                         20
IEngine Interface
// -- Execution control methods (Inherited from IRunEngine) --
void Initialize(Hashtable properties);
bool PerformTimeStep();
void Finish();
//-- Time methods (Inherited from IRunEngine) --
ITime   GetCurrentTime();
ITime   GetInputTime(string QuantityID, string ElementSetID);
ITimeStamp GetEarliestNeededTime();
//-- Data access methods (Inherited from IRunEngine) --
void   SetValues(string QuantityID, string ElementSetID, IValueSet values);
IValueSet GetValues(string QuantityID, string ElementSetID);
//-- Component description methods (Inherited from IRunEngine) --
double GetMissingValueDefinition();
string GetComponentID();
string GetComponentDescription();
// -- Model description methods --
string GetModelID();
string GetModelDescription();
double GetTimeHorizon();
// -- Exchange items --
int GetInputExchangeItemCount();
int GetOutputExchangeItemCount();
org.OpenMI.Backbone GetInputExchangeItem(int exchangeItemIndex);
org.OpenMI.Backbone GetOutputExchangeItem(int exchangeItemIndex);




                                                         Jan Gregersen        21
Wrapper design pattern




       Jan Gregersen     22
Migration steps

• Change your engine to a dll
• Implement Initialize, PerformTimeStep
  and Finish
• Create the EngineDllWrapper class




                  Jan Gregersen           23
Wrapper design pattern




       Jan Gregersen     24
Migration steps

• Create your MyEnigneWrapper
• Implement Initialize and Finish
• Implement remaining Ienigne methods




                 Jan Gregersen          25
Jan Gregersen   26
The ElementMapper

         Ground water            River Model
         Model
                GetValues(time, link)


                                               Calculate
                Return values


              Has         Link      Has



ElementSet
                                        Quantity


                                        “GW Recharge”



                 Jan Gregersen                             27
Spatial mapping




   Jan Gregersen   28
ElementMapper


                                                                     Org.OpenMI.Utilties.Spatial
                                    ElementMapper
Initialise(string methodDescription, IElementSet fromElements, IElementSet toElements)
IValueSet MapValues(IValueSet inputValues)



               r1   m11       m12      m13     .       m1n  x1 
                                                             
               r2   m21       m22      m23     .       m2 n  x2 
              r m            m32      m33     .       m3n  x3 
               3   31                                        
               .  .            .        .      .        .  . 
              r  m                                     mmn  xn 
               m   m1         mm 2     mm3     .             

                                          Jan Gregersen                                        29
Element Mapping

       RE1


                                       1 1/ 3 0 
                                                   
               RE1



                                       0 2 / 3 1/ 2
 GE1         GE2


                                    A
                                                 0 
                     RE3
                                        0 0
                                                   
                                       0 0 1/ 2
GE3          GE4
                                                   


      I  L A

                           Jan Gregersen                30
Element

• ID Based             “Node127”



• Point                (x1,y1)



• Line            (x1,y1)         (x2,y2)



• Polyline        (x1,y1)         (x2,y2)         (x3,y3)   (x4,y4)

             (x1,y1)                  (x5,y5)

• Polygon                                   (x4,y4)
             (x2,y2)
                            (x3,y3)
ElementSet example

H
 Q                                                             H
     H
         Q                                                 Q
             H
                 Q H                                   H
                       Q                           Q
                                               H
                           H               Q
                           Q           H
                                   Q
                               H
                               Q
                               H
                                   Q
                                   H
Quantity

• ID ( “Runoff” )
• Description ( “Rainfall runoff” )
• Dimension ( e.g. L3 T-1 )
  – GetPower ( <dimensionBase> )
• Unit:
  – ID ( “CFS” )
  – Descr ( “Cubic feet per second “ )
  – ConversionFactorToSI ( 0,0283168439 )
  – OffsetToSI ( 0 )
ExchangeItem

• InputExchangeItem
  – Quantity
  – ElementSet
• OutputExchangeItem
  – Quantity
  – ElementSet
  – [ DataOperations
    • ID
    • Arguments ]
Unidirectional link

                              « t rae
                              in f c»
                                e                               « t rae
                                                                 in f c»
                                                                   e
                                Re oe:
                                ivr dl
                                   M                              Rm e:
                                                                   Ro l
                                                                      d
     M Pg m
     a r r
      in o a                I in b C pnn
                            L k le o oet
                                a   m                         I in b C pnn
                                                              L k le o oet
                                                                  a   m

        GVlusim t ,lin D r gr in
        e a e t e 1 k = ige k
         t   (  =     I T   L )

[]
1

                       []
                       2            GVlusim R t e _t lin D RRe
                                    e a e t e M + d k = t ivr
                                     t   (  = im   ,    I Ro  )


                                                                    Pro T e t p
                                                                     e r im e
                                                                      f m  S
                                                         []
                                                         3


                                           r t r VluSt R o
                                           e n a ee u f
                                              u      : nf          { h Rt e Rt e _t
                                                                   w ile Rim< M + d
                                                                               im  }


                                   Pro T e t p
                                    e r im e
                                     f m  S


                                                                             { h Rt e t }
                                                                             w  ile M <1
                                                                                     im
           r t r VluSt Re lo
           e n a e e ivr w
              u      :   F
Bidirectional links
                                                     «interface»                                              «interface»
                                                     RiverModel :                                       GroundW  aterModel :
       MainProgram                               ILinkableComponent                                     ILinkableComponent


                     GetValues(t2,TriggerLink)
[1]
                                                                     GetValues(time=t1, linkID=QtoRiver)
                               [2]

                                                                     GetValues(time=t2, linkID=HtoGW)

                                     [3]                    Extrapolate (t2)
                                           [4]
                                                                   return extrapolated ValueSet: HtoGW (t2)

                                                                                                                    PerformTimeStep (t2)
                               [5]

                                                               return interpolated ValueSet QtoRiver (t1)


                                                            PerformTimeStep (t1)
                               [6]


                                                                     GetValues(time=t2, linkID=QtoRiver)
                               [7]
                                                                        return ValueSet QtoRiver (t2)


                                                            PerformTimeStep (t2)


                     return ValueSet Hriver (t2)




      RiverModel us time s
                   es     tep t1, GroundwaterModel us time s
                                                     es     tep t2
IterationController                     «interface»                        «interface»
                                              :                              RiverM odel :                 GroundWaterM odel :
                                    ILinkableCom ponent                  ILinkableCom ponent               ILinkableCom ponent
M ainProgram


      GetValues(tim e=t2, linkID=H_SW)

                                                       KeepCurrentState
               [1]                                    RiverState_t_begin
                                                                          KeepCurrentState
                                                                          GWState_t_begin


               [2]                             InitialGuess(QtoGW)




                                               RestoreState(RiverState_t_begin)
               [3]

                                                                  RestoreState(GWState_t_begin)


               [4]
                                                                 GetValues(tim e=t2, linkID=H_GW)

                                                                 GetValues(time=t2, linkID=QtoGW)
                                                                           QtoGW_guess

                                                                               H_GW



               [5]                             GetValues(tim e=t2, linkID=H_SW)

                                               GetValues(tim e=t2, linkID=QtoGW)

                                                           QtoGW_guess

                                                              H_SW


                                               Evaluate
               [6]

                                               NewGuess(QtoGW)



                                                                                                    {untill QtoGW is stabilized}
                     result: H_SW


               [7]
«interface»                         «interface»
                                                             RiverModel :                         RR model :
                 MainProgram                             ILinkableComponent                  ILinkableComponent
      User               :
                    IListener
              Start
                           GetValues(time=t1,TriggerLinkID)
[1]
                          OnEvent(SourceAfterGetValuesCall)

                                return computation thread
                                                                   GetValues(time=t1,linkID=QtoRiver)

[2]
                                             OnEvent(SourceAfterGetValuesCall)

                                                  return computation thread

                                                                                                        PerformTimeStep((_dt))

[3]                                                OnEvent(DataChanged)
                                                  return computation thread


                                           OnEvent(SourceBeforeGetValuesReturn)                                {until RRtime=t1}
             Pause
[4]


             Resume
[5]                                               return computation thread


                                                                      return ValueSet(QtoRiver, t1)

                         OnEvent(TargetAfterGetValuesReturn)
[6]                             return computation thread
                                                                    PerformTimeStep(RM_dt)


                                 OnEvent(DataChanged)

[7]
                        OnEvent(SourceBeforeGetValuesReturn)

                                return computation thead


[8]                                return ValueSet(t1)
Persistency

• OMI File
  – For identifying a linkable component
• Composition
  – In org.OpenMI.Utilities.Configuration
  – Holds administration of links and linkable
    components
  – Can be run
  – Can be written and read to / from xml
Exercise 9:
                         Unit Conversion
Step 1
   Open the DataCombinator
Step 2
   Adjust the code of GetValues so that it delivers data in the right
   unit
Step 3
   Adjust the test program to ask for a quantity which has a
   conversion factor not equal to one
Step 4
   Identify a value as missing value (e.g. -999) and adjust the
   input. Make sure this value is processed correctly.
Step 5
   Test the program using NUnit

Contenu connexe

Tendances

Other Approaches (Concurrency)
Other Approaches (Concurrency)Other Approaches (Concurrency)
Other Approaches (Concurrency)Sri Prasanna
 
Shop 2 presentation slide
Shop 2 presentation slideShop 2 presentation slide
Shop 2 presentation slideAndrea Tucci
 
Consistent Modeling Technique for Accurate Transaction Level Models
Consistent Modeling Technique for Accurate Transaction Level ModelsConsistent Modeling Technique for Accurate Transaction Level Models
Consistent Modeling Technique for Accurate Transaction Level Modelshuichenphd
 
System verilog assertions
System verilog assertionsSystem verilog assertions
System verilog assertionsHARINATH REDDY
 
Swift cooking course making a cake ... pattern
Swift cooking course  making a cake ... patternSwift cooking course  making a cake ... pattern
Swift cooking course making a cake ... patternDidier Plaindoux
 
Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475Max Kleiner
 
Verilog presentation final
Verilog presentation finalVerilog presentation final
Verilog presentation finalAnkur Gupta
 
Reactive Qt - Ivan Čukić (Qt World Summit 2015)
Reactive Qt - Ivan Čukić (Qt World Summit 2015)Reactive Qt - Ivan Čukić (Qt World Summit 2015)
Reactive Qt - Ivan Čukić (Qt World Summit 2015)Ivan Čukić
 
System Verilog Tutorial - VHDL
System Verilog Tutorial - VHDLSystem Verilog Tutorial - VHDL
System Verilog Tutorial - VHDLE2MATRIX
 
3150 Chapter 2 Part 1
3150 Chapter 2 Part 13150 Chapter 2 Part 1
3150 Chapter 2 Part 1Mole Wong
 
Resource to Performance Tradeoff Adjustment for Fine-Grained Architectures ─A...
Resource to Performance Tradeoff Adjustment for Fine-Grained Architectures ─A...Resource to Performance Tradeoff Adjustment for Fine-Grained Architectures ─A...
Resource to Performance Tradeoff Adjustment for Fine-Grained Architectures ─A...Fahad Cheema
 
OWF12/PAUG Conf Days Pro guard optimizer and obfuscator for android, eric l...
OWF12/PAUG Conf Days Pro guard   optimizer and obfuscator for android, eric l...OWF12/PAUG Conf Days Pro guard   optimizer and obfuscator for android, eric l...
OWF12/PAUG Conf Days Pro guard optimizer and obfuscator for android, eric l...Paris Open Source Summit
 
(Costless) Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel Architectures(Costless) Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel ArchitecturesJoel Falcou
 
Verilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with ExamplesVerilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with ExamplesE2MATRIX
 

Tendances (20)

Other Approaches (Concurrency)
Other Approaches (Concurrency)Other Approaches (Concurrency)
Other Approaches (Concurrency)
 
GCC RTL and Machine Description
GCC RTL and Machine DescriptionGCC RTL and Machine Description
GCC RTL and Machine Description
 
Shop 2 presentation slide
Shop 2 presentation slideShop 2 presentation slide
Shop 2 presentation slide
 
Consistent Modeling Technique for Accurate Transaction Level Models
Consistent Modeling Technique for Accurate Transaction Level ModelsConsistent Modeling Technique for Accurate Transaction Level Models
Consistent Modeling Technique for Accurate Transaction Level Models
 
Syntutic
SyntuticSyntutic
Syntutic
 
System verilog assertions
System verilog assertionsSystem verilog assertions
System verilog assertions
 
Arvindsujeeth scaladays12
Arvindsujeeth scaladays12Arvindsujeeth scaladays12
Arvindsujeeth scaladays12
 
Verilog HDL - 3
Verilog HDL - 3Verilog HDL - 3
Verilog HDL - 3
 
Animate
AnimateAnimate
Animate
 
Verilog HDL- 2
Verilog HDL- 2Verilog HDL- 2
Verilog HDL- 2
 
Swift cooking course making a cake ... pattern
Swift cooking course  making a cake ... patternSwift cooking course  making a cake ... pattern
Swift cooking course making a cake ... pattern
 
Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475
 
Verilog presentation final
Verilog presentation finalVerilog presentation final
Verilog presentation final
 
Reactive Qt - Ivan Čukić (Qt World Summit 2015)
Reactive Qt - Ivan Čukić (Qt World Summit 2015)Reactive Qt - Ivan Čukić (Qt World Summit 2015)
Reactive Qt - Ivan Čukić (Qt World Summit 2015)
 
System Verilog Tutorial - VHDL
System Verilog Tutorial - VHDLSystem Verilog Tutorial - VHDL
System Verilog Tutorial - VHDL
 
3150 Chapter 2 Part 1
3150 Chapter 2 Part 13150 Chapter 2 Part 1
3150 Chapter 2 Part 1
 
Resource to Performance Tradeoff Adjustment for Fine-Grained Architectures ─A...
Resource to Performance Tradeoff Adjustment for Fine-Grained Architectures ─A...Resource to Performance Tradeoff Adjustment for Fine-Grained Architectures ─A...
Resource to Performance Tradeoff Adjustment for Fine-Grained Architectures ─A...
 
OWF12/PAUG Conf Days Pro guard optimizer and obfuscator for android, eric l...
OWF12/PAUG Conf Days Pro guard   optimizer and obfuscator for android, eric l...OWF12/PAUG Conf Days Pro guard   optimizer and obfuscator for android, eric l...
OWF12/PAUG Conf Days Pro guard optimizer and obfuscator for android, eric l...
 
(Costless) Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel Architectures(Costless) Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel Architectures
 
Verilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with ExamplesVerilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with Examples
 

En vedette

Surtsey
SurtseySurtsey
Surtseyjanusg
 
Presentatie gelukskoffer
Presentatie gelukskofferPresentatie gelukskoffer
Presentatie gelukskofferkikkerbeet
 
Open Source per Donne / Girl Geek
Open Source per Donne / Girl GeekOpen Source per Donne / Girl Geek
Open Source per Donne / Girl GeekSara Rosso
 
Seven Principles For Systems Security
Seven Principles For Systems SecuritySeven Principles For Systems Security
Seven Principles For Systems Securityinvestoralist
 
Using WordPress as a website (not a blog)
Using WordPress as a website (not a blog)Using WordPress as a website (not a blog)
Using WordPress as a website (not a blog)Sara Rosso
 
Edf Ht 42 01 016 A Programme Mecazir RéSultats Des Essais D
Edf Ht 42 01 016 A  Programme Mecazir RéSultats Des Essais DEdf Ht 42 01 016 A  Programme Mecazir RéSultats Des Essais D
Edf Ht 42 01 016 A Programme Mecazir RéSultats Des Essais Dguestc31bf2d
 
The Restart Project at REconomy Day
The Restart Project at REconomy DayThe Restart Project at REconomy Day
The Restart Project at REconomy DayUgo Vallauri
 
Informatie, Middel Voor Gezonde Sturing
Informatie, Middel Voor Gezonde SturingInformatie, Middel Voor Gezonde Sturing
Informatie, Middel Voor Gezonde SturingDaan Blinde
 
RSIS Commentary 117/2009
RSIS Commentary 117/2009RSIS Commentary 117/2009
RSIS Commentary 117/2009investoralist
 
Share On Presentation
Share On PresentationShare On Presentation
Share On Presentationjstringer
 
The Red Queen Race
The Red Queen RaceThe Red Queen Race
The Red Queen RaceRoan Lavery
 
Kerdoivvalaszokosszesitese
KerdoivvalaszokosszesiteseKerdoivvalaszokosszesitese
Kerdoivvalaszokosszesitesebara1
 
Central Asian countries
Central Asian countriesCentral Asian countries
Central Asian countriesinvestoralist
 

En vedette (20)

Surtsey
SurtseySurtsey
Surtsey
 
Presentatie gelukskoffer
Presentatie gelukskofferPresentatie gelukskoffer
Presentatie gelukskoffer
 
2009.05 CRM Quidgest - Jose Torres
2009.05 CRM Quidgest - Jose Torres2009.05 CRM Quidgest - Jose Torres
2009.05 CRM Quidgest - Jose Torres
 
Caims 2009
Caims 2009Caims 2009
Caims 2009
 
Science Cafe 2012
Science Cafe 2012Science Cafe 2012
Science Cafe 2012
 
Formación sociocultural ii intro
Formación sociocultural ii introFormación sociocultural ii intro
Formación sociocultural ii intro
 
Open Source per Donne / Girl Geek
Open Source per Donne / Girl GeekOpen Source per Donne / Girl Geek
Open Source per Donne / Girl Geek
 
Seven Principles For Systems Security
Seven Principles For Systems SecuritySeven Principles For Systems Security
Seven Principles For Systems Security
 
Using WordPress as a website (not a blog)
Using WordPress as a website (not a blog)Using WordPress as a website (not a blog)
Using WordPress as a website (not a blog)
 
Edf Ht 42 01 016 A Programme Mecazir RéSultats Des Essais D
Edf Ht 42 01 016 A  Programme Mecazir RéSultats Des Essais DEdf Ht 42 01 016 A  Programme Mecazir RéSultats Des Essais D
Edf Ht 42 01 016 A Programme Mecazir RéSultats Des Essais D
 
The Restart Project at REconomy Day
The Restart Project at REconomy DayThe Restart Project at REconomy Day
The Restart Project at REconomy Day
 
Safin
SafinSafin
Safin
 
20160418_JTS Overview
20160418_JTS Overview20160418_JTS Overview
20160418_JTS Overview
 
Informatie, Middel Voor Gezonde Sturing
Informatie, Middel Voor Gezonde SturingInformatie, Middel Voor Gezonde Sturing
Informatie, Middel Voor Gezonde Sturing
 
Md2010 jl-wp7-sl-game-dev
Md2010 jl-wp7-sl-game-devMd2010 jl-wp7-sl-game-dev
Md2010 jl-wp7-sl-game-dev
 
RSIS Commentary 117/2009
RSIS Commentary 117/2009RSIS Commentary 117/2009
RSIS Commentary 117/2009
 
Share On Presentation
Share On PresentationShare On Presentation
Share On Presentation
 
The Red Queen Race
The Red Queen RaceThe Red Queen Race
The Red Queen Race
 
Kerdoivvalaszokosszesitese
KerdoivvalaszokosszesiteseKerdoivvalaszokosszesitese
Kerdoivvalaszokosszesitese
 
Central Asian countries
Central Asian countriesCentral Asian countries
Central Asian countries
 

Similaire à OpenMI Developers Training

Generating Predicate Callback Summaries for the Android Framework
Generating Predicate Callback Summaries for the Android FrameworkGenerating Predicate Callback Summaries for the Android Framework
Generating Predicate Callback Summaries for the Android FrameworkMobileSoft
 
Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...
Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...
Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...ICSM 2011
 
1 Vampir Overview
1 Vampir Overview1 Vampir Overview
1 Vampir OverviewPTIHPA
 
Shipping Code like a keptn: Continuous Delivery & Automated Operations on k8s
Shipping Code like a keptn: Continuous Delivery & Automated Operations on k8sShipping Code like a keptn: Continuous Delivery & Automated Operations on k8s
Shipping Code like a keptn: Continuous Delivery & Automated Operations on k8sAndreas Grabner
 
Observability and Orchestration of your GitOps Deployments with Keptn
Observability and Orchestration of your GitOps Deployments with KeptnObservability and Orchestration of your GitOps Deployments with Keptn
Observability and Orchestration of your GitOps Deployments with KeptnAndreas Grabner
 
Attention mechanisms with tensorflow
Attention mechanisms with tensorflowAttention mechanisms with tensorflow
Attention mechanisms with tensorflowKeon Kim
 
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?Pin-Ying Tu
 
掀起 Swift 的面紗
掀起 Swift 的面紗掀起 Swift 的面紗
掀起 Swift 的面紗Pofat Tseng
 
Cling the llvm based interpreter
Cling the llvm based interpreterCling the llvm based interpreter
Cling the llvm based interpreterRoberto Nogueira
 
2011.10.14 Apache Giraph - Hortonworks
2011.10.14 Apache Giraph - Hortonworks2011.10.14 Apache Giraph - Hortonworks
2011.10.14 Apache Giraph - HortonworksAvery Ching
 
Google io bootcamp_2010
Google io bootcamp_2010Google io bootcamp_2010
Google io bootcamp_2010Chris Ramsdale
 
XebiCon'16 : Server-Side Swift. Par Simone Civetta, Développeur iOS chez Xebia
XebiCon'16 : Server-Side Swift. Par Simone Civetta, Développeur iOS chez XebiaXebiCon'16 : Server-Side Swift. Par Simone Civetta, Développeur iOS chez Xebia
XebiCon'16 : Server-Side Swift. Par Simone Civetta, Développeur iOS chez XebiaPublicis Sapient Engineering
 
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...Flink Forward
 
JCConf 2020 Observing in Microservices
JCConf 2020 Observing in MicroservicesJCConf 2020 Observing in Microservices
JCConf 2020 Observing in MicroservicesMatt Ho
 
Python Streaming Pipelines with Beam on Flink
Python Streaming Pipelines with Beam on FlinkPython Streaming Pipelines with Beam on Flink
Python Streaming Pipelines with Beam on FlinkAljoscha Krettek
 
Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010Chris Ramsdale
 

Similaire à OpenMI Developers Training (20)

Generating Predicate Callback Summaries for the Android Framework
Generating Predicate Callback Summaries for the Android FrameworkGenerating Predicate Callback Summaries for the Android Framework
Generating Predicate Callback Summaries for the Android Framework
 
Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...
Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...
Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...
 
1 Vampir Overview
1 Vampir Overview1 Vampir Overview
1 Vampir Overview
 
Shipping Code like a keptn: Continuous Delivery & Automated Operations on k8s
Shipping Code like a keptn: Continuous Delivery & Automated Operations on k8sShipping Code like a keptn: Continuous Delivery & Automated Operations on k8s
Shipping Code like a keptn: Continuous Delivery & Automated Operations on k8s
 
Observability and Orchestration of your GitOps Deployments with Keptn
Observability and Orchestration of your GitOps Deployments with KeptnObservability and Orchestration of your GitOps Deployments with Keptn
Observability and Orchestration of your GitOps Deployments with Keptn
 
Extending and scripting PDT
Extending and scripting PDTExtending and scripting PDT
Extending and scripting PDT
 
ESL report
ESL reportESL report
ESL report
 
Attention mechanisms with tensorflow
Attention mechanisms with tensorflowAttention mechanisms with tensorflow
Attention mechanisms with tensorflow
 
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
 
掀起 Swift 的面紗
掀起 Swift 的面紗掀起 Swift 的面紗
掀起 Swift 的面紗
 
Cling the llvm based interpreter
Cling the llvm based interpreterCling the llvm based interpreter
Cling the llvm based interpreter
 
GCF
GCFGCF
GCF
 
2011.10.14 Apache Giraph - Hortonworks
2011.10.14 Apache Giraph - Hortonworks2011.10.14 Apache Giraph - Hortonworks
2011.10.14 Apache Giraph - Hortonworks
 
Google io bootcamp_2010
Google io bootcamp_2010Google io bootcamp_2010
Google io bootcamp_2010
 
XebiCon'16 : Server-Side Swift. Par Simone Civetta, Développeur iOS chez Xebia
XebiCon'16 : Server-Side Swift. Par Simone Civetta, Développeur iOS chez XebiaXebiCon'16 : Server-Side Swift. Par Simone Civetta, Développeur iOS chez Xebia
XebiCon'16 : Server-Side Swift. Par Simone Civetta, Développeur iOS chez Xebia
 
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
 
Open MPI
Open MPIOpen MPI
Open MPI
 
JCConf 2020 Observing in Microservices
JCConf 2020 Observing in MicroservicesJCConf 2020 Observing in Microservices
JCConf 2020 Observing in Microservices
 
Python Streaming Pipelines with Beam on Flink
Python Streaming Pipelines with Beam on FlinkPython Streaming Pipelines with Beam on Flink
Python Streaming Pipelines with Beam on Flink
 
Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010
 

Plus de Jan Gregersen

Ground Water Surface Water Interaction
Ground Water Surface Water InteractionGround Water Surface Water Interaction
Ground Water Surface Water InteractionJan Gregersen
 
Demonstration Of The Open Mi
Demonstration Of The Open MiDemonstration Of The Open Mi
Demonstration Of The Open MiJan Gregersen
 
Introduction To OpenMI
Introduction To OpenMIIntroduction To OpenMI
Introduction To OpenMIJan Gregersen
 
Introduction To OpenMI
Introduction To OpenMIIntroduction To OpenMI
Introduction To OpenMIJan Gregersen
 
OpenMI Developers Training
OpenMI Developers TrainingOpenMI Developers Training
OpenMI Developers TrainingJan Gregersen
 
How To Make Your Component Compliant
How To Make Your Component CompliantHow To Make Your Component Compliant
How To Make Your Component CompliantJan Gregersen
 

Plus de Jan Gregersen (6)

Ground Water Surface Water Interaction
Ground Water Surface Water InteractionGround Water Surface Water Interaction
Ground Water Surface Water Interaction
 
Demonstration Of The Open Mi
Demonstration Of The Open MiDemonstration Of The Open Mi
Demonstration Of The Open Mi
 
Introduction To OpenMI
Introduction To OpenMIIntroduction To OpenMI
Introduction To OpenMI
 
Introduction To OpenMI
Introduction To OpenMIIntroduction To OpenMI
Introduction To OpenMI
 
OpenMI Developers Training
OpenMI Developers TrainingOpenMI Developers Training
OpenMI Developers Training
 
How To Make Your Component Compliant
How To Make Your Component CompliantHow To Make Your Component Compliant
How To Make Your Component Compliant
 

Dernier

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Dernier (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

OpenMI Developers Training

  • 1. OpenMI Developers Training Jan Gregersen http://www.LicTek.com Jan Gregersen 1
  • 2. Simple River Runoff Model Simple River OutputExchangeItem InputExchangeItem Quantity ID : Runoff Quantity ID : Inflow DataOperaiton : Distributed ElementSet : Polygons ElementSet : Polyline Y (km) 5 10 Y (km) 10 10 Node:0 Branch:0 Node:1 5 5 Branch:1 Node:2 Branch:2 Node:3 X (km) X (km) 5 10 Jan Gregersen 2
  • 3. How it works Load components: Query exchange items: Add links: Jan Gregersen 3
  • 4. How it works Prepare: Run (GetValues): Finish: Jan Gregersen 4
  • 5. The OpenMI standard DHI - Water & Environment Jan Gregersen
  • 7. Migration of models DHI - Water & Environment Jan Gregersen
  • 8. Now What ??? Jan Gregersen 8
  • 9. Org.OpenMI.Utilities Org.OpenMI.Utilities.Buffer Buffers results from the engine core SmartBuffer Mapping of values associated to one array of times /timespans to values represented on another array of times/timespans t t Org.OpenMI.Utilities.Spatial Mapping of values associated to ElementMapper one ElementSet to be represented on another ElementSet Org.OpenMI.Utilities.Wrapper Generic wrapper suited for time SmartWrapper stepping model engines Jan Gregersen 9
  • 10. LinkableEngine features • Provides a default implementation of the ILinkableComponent interface • Links bookkeeping • Event handling • Buffering • Temporal interpolations, aggregations, extrapolations • Spatial interpolations, aggregations, extrapolations Jan Gregersen 10
  • 11. Wrapper design pattern Jan Gregersen 11
  • 12. IEngine Interface // -- Execution control methods (Inherited from IRunEngine) -- void Initialize(Hashtable properties); bool PerformTimeStep(); void Finish(); //-- Time methods (Inherited from IRunEngine) -- ITime GetCurrentTime(); ITime GetInputTime(string QuantityID, string ElementSetID); ITimeStamp GetEarliestNeededTime(); //-- Data access methods (Inherited from IRunEngine) -- void SetValues(string QuantityID, string ElementSetID, IValueSet values); IValueSet GetValues(string QuantityID, string ElementSetID); //-- Component description methods (Inherited from IRunEngine) -- double GetMissingValueDefinition(); string GetComponentID(); string GetComponentDescription(); // -- Model description methods -- string GetModelID(); string GetModelDescription(); double GetTimeHorizon(); // -- Exchange items -- int GetInputExchangeItemCount(); int GetOutputExchangeItemCount(); org.OpenMI.Backbone GetInputExchangeItem(int exchangeItemIndex); org.OpenMI.Backbone GetOutputExchangeItem(int exchangeItemIndex); Jan Gregersen 12
  • 13. Inside the LinkableEngine has SmartWrapper has SmartInputLinkSet SmartOutputLinkSet UpdateInput() UpdateBuffer() 1 GetValues() access has Link access 1 Link has * * SmartInputLink SmartOutputLink UpdateInput() has UpdateBuffer() GetValues() has SmartBuffer ElementMapper Jan Gregersen 13
  • 14. GetValues() Model B Model A GetValues(time, LinkID) GetValues(time, LinkID) 1. Update with input from linked models 2. Perform time step and fill internal buffers While (CurrentTime < time & State is “Not Busy”) 3. Map values in time and space Return values Jan Gregersen 14
  • 15. GetValues() Model B Model A GetValues(time, LinkID) GetValues(time, LinkID) 1. Update with input from linked models 2. Perform time step and fill internal buffers While (CurrentTime < time & State is “Not Busy”) 3. Map values in time and space Return values Jan Gregersen 15
  • 16. GetValues() Engine Smart A Smart A Smart A Smart A Smart Model B Model A AIP Output Output Element InputLink Input Buffer Access LInkSet LInk Mapper Set Link GetValues(tl LinkID) GetCurrentTime() IsBusy = true UpdateInput(ct) UpdateInput(ct) GetValues(ct,LinkID) SetValues(Quantity,LocationID,Values) For each Input Link Jan Gregersen 16
  • 17. GetValues() Model B Model A GetValues(time, LinkID) GetValues(time, LinkID) 1. Update with input from linked models 2. Perform time step and fill internal buffers While (CurrentTime < time & State is “Not Busy”) 3. Map values in time and space Return values Jan Gregersen 17
  • 18. GetValues() Engine Smart A Smart A Smart A Smart A Smart Model B Model A AIP Output Output Element InputLink Input Buffer Access LInkSet LInk Mapper Set Link PerformTimeStep() UpdateBuffers() UpdateBuffer() Getvalues(Quantity,LocationIDs) Addvalues(time, valueSet) For each output link IsBusy = false Jan Gregersen 18
  • 19. GetValues() Model B Model A GetValues(time, LinkID) GetValues(time, LinkID) 1. Update with input from linked models 2. Perform time step and fill internal buffers While (CurrentTime < time & State is “Not Busy”) 3. Map values in time and space Return values Jan Gregersen 19
  • 20. GetValues() Engine Smart A Smart A Smart A Smart A Smart Model B Model A AIP Output Output Element InputLink Input Buffer Access LInkSet LInk Mapper Set Link GetValues(time, LinkID) GetValues(time) GetValues(time) MapValues(inpuValues) Jan Gregersen 20
  • 21. IEngine Interface // -- Execution control methods (Inherited from IRunEngine) -- void Initialize(Hashtable properties); bool PerformTimeStep(); void Finish(); //-- Time methods (Inherited from IRunEngine) -- ITime GetCurrentTime(); ITime GetInputTime(string QuantityID, string ElementSetID); ITimeStamp GetEarliestNeededTime(); //-- Data access methods (Inherited from IRunEngine) -- void SetValues(string QuantityID, string ElementSetID, IValueSet values); IValueSet GetValues(string QuantityID, string ElementSetID); //-- Component description methods (Inherited from IRunEngine) -- double GetMissingValueDefinition(); string GetComponentID(); string GetComponentDescription(); // -- Model description methods -- string GetModelID(); string GetModelDescription(); double GetTimeHorizon(); // -- Exchange items -- int GetInputExchangeItemCount(); int GetOutputExchangeItemCount(); org.OpenMI.Backbone GetInputExchangeItem(int exchangeItemIndex); org.OpenMI.Backbone GetOutputExchangeItem(int exchangeItemIndex); Jan Gregersen 21
  • 22. Wrapper design pattern Jan Gregersen 22
  • 23. Migration steps • Change your engine to a dll • Implement Initialize, PerformTimeStep and Finish • Create the EngineDllWrapper class Jan Gregersen 23
  • 24. Wrapper design pattern Jan Gregersen 24
  • 25. Migration steps • Create your MyEnigneWrapper • Implement Initialize and Finish • Implement remaining Ienigne methods Jan Gregersen 25
  • 27. The ElementMapper Ground water River Model Model GetValues(time, link) Calculate Return values Has Link Has ElementSet Quantity “GW Recharge” Jan Gregersen 27
  • 28. Spatial mapping Jan Gregersen 28
  • 29. ElementMapper Org.OpenMI.Utilties.Spatial ElementMapper Initialise(string methodDescription, IElementSet fromElements, IElementSet toElements) IValueSet MapValues(IValueSet inputValues)  r1   m11 m12 m13 . m1n  x1        r2   m21 m22 m23 . m2 n  x2  r m m32 m33 . m3n  x3   3   31    .  . . . . .  .  r  m mmn  xn   m   m1 mm 2 mm3 .   Jan Gregersen 29
  • 30. Element Mapping RE1  1 1/ 3 0    RE1  0 2 / 3 1/ 2 GE1 GE2 A 0  RE3 0 0    0 0 1/ 2 GE3 GE4   I  L A Jan Gregersen 30
  • 31. Element • ID Based “Node127” • Point (x1,y1) • Line (x1,y1) (x2,y2) • Polyline (x1,y1) (x2,y2) (x3,y3) (x4,y4) (x1,y1) (x5,y5) • Polygon (x4,y4) (x2,y2) (x3,y3)
  • 32. ElementSet example H Q H H Q Q H Q H H Q Q H H Q Q H Q H Q H Q H
  • 33. Quantity • ID ( “Runoff” ) • Description ( “Rainfall runoff” ) • Dimension ( e.g. L3 T-1 ) – GetPower ( <dimensionBase> ) • Unit: – ID ( “CFS” ) – Descr ( “Cubic feet per second “ ) – ConversionFactorToSI ( 0,0283168439 ) – OffsetToSI ( 0 )
  • 34. ExchangeItem • InputExchangeItem – Quantity – ElementSet • OutputExchangeItem – Quantity – ElementSet – [ DataOperations • ID • Arguments ]
  • 35. Unidirectional link « t rae in f c» e « t rae in f c» e Re oe: ivr dl M Rm e: Ro l d M Pg m a r r in o a I in b C pnn L k le o oet a m I in b C pnn L k le o oet a m GVlusim t ,lin D r gr in e a e t e 1 k = ige k t ( = I T L ) [] 1 [] 2 GVlusim R t e _t lin D RRe e a e t e M + d k = t ivr t ( = im , I Ro ) Pro T e t p e r im e f m S [] 3 r t r VluSt R o e n a ee u f u : nf { h Rt e Rt e _t w ile Rim< M + d im } Pro T e t p e r im e f m S { h Rt e t } w ile M <1 im r t r VluSt Re lo e n a e e ivr w u : F
  • 36. Bidirectional links «interface» «interface» RiverModel : GroundW aterModel : MainProgram ILinkableComponent ILinkableComponent GetValues(t2,TriggerLink) [1] GetValues(time=t1, linkID=QtoRiver) [2] GetValues(time=t2, linkID=HtoGW) [3] Extrapolate (t2) [4] return extrapolated ValueSet: HtoGW (t2) PerformTimeStep (t2) [5] return interpolated ValueSet QtoRiver (t1) PerformTimeStep (t1) [6] GetValues(time=t2, linkID=QtoRiver) [7] return ValueSet QtoRiver (t2) PerformTimeStep (t2) return ValueSet Hriver (t2) RiverModel us time s es tep t1, GroundwaterModel us time s es tep t2
  • 37. IterationController «interface» «interface» : RiverM odel : GroundWaterM odel : ILinkableCom ponent ILinkableCom ponent ILinkableCom ponent M ainProgram GetValues(tim e=t2, linkID=H_SW) KeepCurrentState [1] RiverState_t_begin KeepCurrentState GWState_t_begin [2] InitialGuess(QtoGW) RestoreState(RiverState_t_begin) [3] RestoreState(GWState_t_begin) [4] GetValues(tim e=t2, linkID=H_GW) GetValues(time=t2, linkID=QtoGW) QtoGW_guess H_GW [5] GetValues(tim e=t2, linkID=H_SW) GetValues(tim e=t2, linkID=QtoGW) QtoGW_guess H_SW Evaluate [6] NewGuess(QtoGW) {untill QtoGW is stabilized} result: H_SW [7]
  • 38. «interface» «interface» RiverModel : RR model : MainProgram ILinkableComponent ILinkableComponent User : IListener Start GetValues(time=t1,TriggerLinkID) [1] OnEvent(SourceAfterGetValuesCall) return computation thread GetValues(time=t1,linkID=QtoRiver) [2] OnEvent(SourceAfterGetValuesCall) return computation thread PerformTimeStep((_dt)) [3] OnEvent(DataChanged) return computation thread OnEvent(SourceBeforeGetValuesReturn) {until RRtime=t1} Pause [4] Resume [5] return computation thread return ValueSet(QtoRiver, t1) OnEvent(TargetAfterGetValuesReturn) [6] return computation thread PerformTimeStep(RM_dt) OnEvent(DataChanged) [7] OnEvent(SourceBeforeGetValuesReturn) return computation thead [8] return ValueSet(t1)
  • 39. Persistency • OMI File – For identifying a linkable component • Composition – In org.OpenMI.Utilities.Configuration – Holds administration of links and linkable components – Can be run – Can be written and read to / from xml
  • 40. Exercise 9: Unit Conversion Step 1 Open the DataCombinator Step 2 Adjust the code of GetValues so that it delivers data in the right unit Step 3 Adjust the test program to ask for a quantity which has a conversion factor not equal to one Step 4 Identify a value as missing value (e.g. -999) and adjust the input. Make sure this value is processed correctly. Step 5 Test the program using NUnit