SlideShare une entreprise Scribd logo
1  sur  40
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        m 11    m 12    m 13    .       m1n    x1
                r2        m 21    m 22    m 23    .       m2n    x2
                r3        m 31    m 32    m 33    .       m 3n   x3
                 .         .        .       .     .        .     .
                rm       m m1    mm2      mm3     .       m mn   xn


                                          Jan Gregersen                                         29
Element Mapping

          RE1

                   RE1                         1   1/ 3    0
 GE1             GE2
                                               0   2/3    1/ 2
                         RE3            A
                                               0    0      0
GE3              GE4                           0    0     1/ 2



      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 ra e
                                       inef c »                                « t ra e
                                                                                inef c »
                                     R eMd l :
                                      iv r o e                                 R md l :
                                                                                R oe
      Min r ga
       a P rm
          o                       I ina le o p n n
                                   L k b Cmo e t                            I ina le o p n n
                                                                             L k b Cmo e t


          Gt a e(im=1 linI = r g r in)
           eV lu st et , k Tig eL k
                          D

[ ]
 1


                            [ ]
                             2               Gt a e(im= M e+ d, linI = R R e)
                                              eV lu st eR tim _ t  k R t iv r
                                                                    D   o



                                                                                     P rom imS p
                                                                                      ef r T e te
                                                                      [ ]
                                                                       3



                                                     r t r V lu S t Rn f
                                                     eun a e e: u of               { h R t e< M e+ d}
                                                                                   wile R im R tim _ t



                                           P rom imS p
                                            ef r T e te



                                                                                               { h R t e< 1
                                                                                               wile M im t }
              r t r V lu S t R eF w
              eun a e e: iv r lo
Bidirectional links
                                                       «interface»                                               «interface»
                                                      Ri verModel :                                        GroundWaterModel :
       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)

                                                                                                                        PerformT imeStep (t2)
                                 [5]

                                                                 return interpolated ValueSet QtoRiver (t1)



                                                              PerformTimeStep (t1)

                                 [6]


                                                                        GetValues(time=t2, linkID=QtoRiver)

                                [7]
                                                                           return ValueSet QtoRiver (t2)


                                                              PerformT imeStep (t2)



                      return ValueSet Hriver (t2)




      RiverModel uses time step t1, GroundwaterModel uses time step t2
Ite ra ti o n C o n tro l l e r                                       « i n te rfa c e »                                      « i n te rfa c e »
                                                                   :                                                     R i v e rM o d e l :                             G ro u n d W a te rM o d e l :
                                                   IL i n ka b l e C o m p o n e n t                              IL i n ka b l e C o m p o n e n t                       IL i n ka b l e C o m p o n e n t
M a i n P ro g ra m


          G e tV a l u e s(ti m e = t2 , l i n kID = H _ S W )

                                                                                       K e e p C u rre n tS ta te

                       [1 ]                                                           R i v e rS ta te _ t_ b e g i n

                                                                                                                    K e e p C u rre n tS ta te

                                                                                                                    G W S ta te _ t_ b e g i n


                                                                       In i ti a l G u e ss(Q to G W )
                       [2 ]




                                                                       R e sto re S ta te (R i v e rS ta te _ t_ b e g i n )
                      [3 ]

                                                                                                         R e sto re S ta te (G W S ta te _ t_ b e g i n )



                      [4 ]
                                                                                                       G e tV a l u e s(ti m e = t2 , l i n kID = H _ G W )

                                                                                                       G e tV a l u e s(ti m e = t2 , l i n kID = Q to G W )

                                                                                                                        Q to G W _ g u e ss

                                                                                                                             H_ G W




                      [5 ]                                             G e tV a l u e s(ti m e = t2 , l i n kID = H _ S W )


                                                                       G e tV a l u e s(ti m e = t2 , l i n kID = Q to G W )

                                                                                          Q to G W _ g u e ss

                                                                                                H_SW



                                                                       E v a l u a te
                      [6 ]


                                                                       N e w G u e ss(Q to G W )




                                                                                                                                                               {u n ti l l Q to G W i s sta b i l i z e d }
                              re su l t: H _ S W



                      [7 ]
« i n te rfa ce »                                         « i n te rfa ce »
                                                                                                R i ve rM o d e l :                                         RR m o d e l :
                       M a i n P ro g ra m                                                IL i n ka b l e C o m p o n e n t                          IL i n ka b l e C o m p o n e n t
        Use r                      :
                             IL i ste n e r
                  S ta rt

                                              G e tV a l u e s(ti m e = t1 ,T ri g g e rL i n kID )
 [1 ]
                                          O n E ve n t(S o u rce A fte rG e tV a l u e sC a l l )

                                                    re tu rn co m p u ta ti o n th re a d
                                                                                                            G e tV a l u e s(ti m e = t1 ,l i n kID= Q to R i ve r)


[2 ]
                                                                          O n E ve n t(S o u rce A fte rG e tV a l u e sC a l l )

                                                                                  re tu rn co m p u ta ti o n th re a d

                                                                                                                                                                        P e rfo rm T i m e S te p ((_ d t))

 [3 ]                                                                              O n E ve n t(D a ta Ch a n g e d )

                                                                                  re tu rn co m p u ta ti o n th re a d



                                                                      O n E ve n t(S o u rce B e fo re G e tV a l u e sR e tu rn )                                                   {u n ti l RR ti m e = t1 }
                 P a u se
[4 ]


                R e su m e
[5 ]                                                                              re tu rn co m p u ta ti o n th re a d


                                                                                                                 re tu rn V a l u e S e t(Q to R i ve r, t1 )

                                        O n E ve n t(T a rg e tA fte rG e tV a l u e sR e tu rn )

[6 ]                                               re tu rn co m p u ta ti o n th re a d

                                                                                                             P e rfo rm T i m e S te p (R M _ d t)



                                                     O n E ve n t(Da ta C h a n g e d )

[7 ]

                                       O n E ve n t(S o u rce B e fo re G e tV a l u e sR e tu rn )

                                                    re tu rn co m p u ta ti o n th e a d



[8 ]                                                     re tu rn V a l u e S e t(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

Диаграммы планов счетов
Диаграммы планов счетовДиаграммы планов счетов
Диаграммы планов счетовGrigoriy Pechenkin
 
OpenMI Developers Training
OpenMI Developers TrainingOpenMI Developers Training
OpenMI Developers TrainingJan Gregersen
 
мултимедија видео
мултимедија видеомултимедија видео
мултимедија видеоguesta0d07d
 
a kérdőívre
a kérdőívre a kérdőívre
a kérdőívre bara1
 
Úkrania
ÚkraniaÚkrania
Úkraniajanusg
 
Colongate E
Colongate EColongate E
Colongate Ellarboix
 
The Red Queen Race
The Red Queen RaceThe Red Queen Race
The Red Queen RaceRoan Lavery
 
Central Asian countries
Central Asian countriesCentral Asian countries
Central Asian countriesinvestoralist
 
Innovation 1.07 03042010
Innovation 1.07 03042010Innovation 1.07 03042010
Innovation 1.07 03042010Pozzolini
 
Innovachron Offering
Innovachron OfferingInnovachron Offering
Innovachron Offeringremicote
 
How to succeed as VP Public Relations
How to succeed as VP Public RelationsHow to succeed as VP Public Relations
How to succeed as VP Public RelationsFrances Kazan
 
RSIS Commentary 117/2009
RSIS Commentary 117/2009RSIS Commentary 117/2009
RSIS Commentary 117/2009investoralist
 
Mainul Husain Presentation
Mainul Husain PresentationMainul Husain Presentation
Mainul Husain Presentationguest6a8907
 
Presentatie gelukskoffer
Presentatie gelukskofferPresentatie gelukskoffer
Presentatie gelukskofferkikkerbeet
 
Бесконтактное обследование
Бесконтактное обследованиеБесконтактное обследование
Бесконтактное обследованиеGrigoriy Pechenkin
 
01. Negotiating Presentation For The Seminar Generic 2009 September Beta Rele...
01. Negotiating Presentation For The Seminar Generic 2009 September Beta Rele...01. Negotiating Presentation For The Seminar Generic 2009 September Beta Rele...
01. Negotiating Presentation For The Seminar Generic 2009 September Beta Rele...Pozzolini
 
Lawyers
LawyersLawyers
Lawyersmtoto
 
How to suceed as Club Secretary
How to suceed as Club SecretaryHow to suceed as Club Secretary
How to suceed as Club SecretaryFrances Kazan
 

En vedette (20)

Диаграммы планов счетов
Диаграммы планов счетовДиаграммы планов счетов
Диаграммы планов счетов
 
OpenMI Developers Training
OpenMI Developers TrainingOpenMI Developers Training
OpenMI Developers Training
 
imagenes
imagenesimagenes
imagenes
 
мултимедија видео
мултимедија видеомултимедија видео
мултимедија видео
 
a kérdőívre
a kérdőívre a kérdőívre
a kérdőívre
 
Úkrania
ÚkraniaÚkrania
Úkrania
 
Colongate E
Colongate EColongate E
Colongate E
 
The Red Queen Race
The Red Queen RaceThe Red Queen Race
The Red Queen Race
 
Central Asian countries
Central Asian countriesCentral Asian countries
Central Asian countries
 
Innovation 1.07 03042010
Innovation 1.07 03042010Innovation 1.07 03042010
Innovation 1.07 03042010
 
Zhelnova
ZhelnovaZhelnova
Zhelnova
 
Innovachron Offering
Innovachron OfferingInnovachron Offering
Innovachron Offering
 
How to succeed as VP Public Relations
How to succeed as VP Public RelationsHow to succeed as VP Public Relations
How to succeed as VP Public Relations
 
RSIS Commentary 117/2009
RSIS Commentary 117/2009RSIS Commentary 117/2009
RSIS Commentary 117/2009
 
Mainul Husain Presentation
Mainul Husain PresentationMainul Husain Presentation
Mainul Husain Presentation
 
Presentatie gelukskoffer
Presentatie gelukskofferPresentatie gelukskoffer
Presentatie gelukskoffer
 
Бесконтактное обследование
Бесконтактное обследованиеБесконтактное обследование
Бесконтактное обследование
 
01. Negotiating Presentation For The Seminar Generic 2009 September Beta Rele...
01. Negotiating Presentation For The Seminar Generic 2009 September Beta Rele...01. Negotiating Presentation For The Seminar Generic 2009 September Beta Rele...
01. Negotiating Presentation For The Seminar Generic 2009 September Beta Rele...
 
Lawyers
LawyersLawyers
Lawyers
 
How to suceed as Club Secretary
How to suceed as Club SecretaryHow to suceed as Club Secretary
How to suceed as Club Secretary
 

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
 

Dernier

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
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
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
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
 
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
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
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
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
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
 
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
 

Dernier (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
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
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
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
 
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
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
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
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
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
 
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)
 

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 m 11 m 12 m 13 . m1n x1 r2 m 21 m 22 m 23 . m2n x2 r3 m 31 m 32 m 33 . m 3n x3 . . . . . . . rm m m1 mm2 mm3 . m mn xn Jan Gregersen 29
  • 30. Element Mapping RE1 RE1 1 1/ 3 0 GE1 GE2 0 2/3 1/ 2 RE3 A 0 0 0 GE3 GE4 0 0 1/ 2 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 ra e inef c » « t ra e inef c » R eMd l : iv r o e R md l : R oe Min r ga a P rm o I ina le o p n n L k b Cmo e t I ina le o p n n L k b Cmo e t Gt a e(im=1 linI = r g r in) eV lu st et , k Tig eL k D [ ] 1 [ ] 2 Gt a e(im= M e+ d, linI = R R e) eV lu st eR tim _ t k R t iv r D o P rom imS p ef r T e te [ ] 3 r t r V lu S t Rn f eun a e e: u of { h R t e< M e+ d} wile R im R tim _ t P rom imS p ef r T e te { h R t e< 1 wile M im t } r t r V lu S t R eF w eun a e e: iv r lo
  • 36. Bidirectional links «interface» «interface» Ri verModel : GroundWaterModel : 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) PerformT imeStep (t2) [5] return interpolated ValueSet QtoRiver (t1) PerformTimeStep (t1) [6] GetValues(time=t2, linkID=QtoRiver) [7] return ValueSet QtoRiver (t2) PerformT imeStep (t2) return ValueSet Hriver (t2) RiverModel uses time step t1, GroundwaterModel uses time step t2
  • 37. Ite ra ti o n C o n tro l l e r « i n te rfa c e » « i n te rfa c e » : R i v e rM o d e l : G ro u n d W a te rM o d e l : IL i n ka b l e C o m p o n e n t IL i n ka b l e C o m p o n e n t IL i n ka b l e C o m p o n e n t M a i n P ro g ra m G e tV a l u e s(ti m e = t2 , l i n kID = H _ S W ) K e e p C u rre n tS ta te [1 ] R i v e rS ta te _ t_ b e g i n K e e p C u rre n tS ta te G W S ta te _ t_ b e g i n In i ti a l G u e ss(Q to G W ) [2 ] R e sto re S ta te (R i v e rS ta te _ t_ b e g i n ) [3 ] R e sto re S ta te (G W S ta te _ t_ b e g i n ) [4 ] G e tV a l u e s(ti m e = t2 , l i n kID = H _ G W ) G e tV a l u e s(ti m e = t2 , l i n kID = Q to G W ) Q to G W _ g u e ss H_ G W [5 ] G e tV a l u e s(ti m e = t2 , l i n kID = H _ S W ) G e tV a l u e s(ti m e = t2 , l i n kID = Q to G W ) Q to G W _ g u e ss H_SW E v a l u a te [6 ] N e w G u e ss(Q to G W ) {u n ti l l Q to G W i s sta b i l i z e d } re su l t: H _ S W [7 ]
  • 38. « i n te rfa ce » « i n te rfa ce » R i ve rM o d e l : RR m o d e l : M a i n P ro g ra m IL i n ka b l e C o m p o n e n t IL i n ka b l e C o m p o n e n t Use r : IL i ste n e r S ta rt G e tV a l u e s(ti m e = t1 ,T ri g g e rL i n kID ) [1 ] O n E ve n t(S o u rce A fte rG e tV a l u e sC a l l ) re tu rn co m p u ta ti o n th re a d G e tV a l u e s(ti m e = t1 ,l i n kID= Q to R i ve r) [2 ] O n E ve n t(S o u rce A fte rG e tV a l u e sC a l l ) re tu rn co m p u ta ti o n th re a d P e rfo rm T i m e S te p ((_ d t)) [3 ] O n E ve n t(D a ta Ch a n g e d ) re tu rn co m p u ta ti o n th re a d O n E ve n t(S o u rce B e fo re G e tV a l u e sR e tu rn ) {u n ti l RR ti m e = t1 } P a u se [4 ] R e su m e [5 ] re tu rn co m p u ta ti o n th re a d re tu rn V a l u e S e t(Q to R i ve r, t1 ) O n E ve n t(T a rg e tA fte rG e tV a l u e sR e tu rn ) [6 ] re tu rn co m p u ta ti o n th re a d P e rfo rm T i m e S te p (R M _ d t) O n E ve n t(Da ta C h a n g e d ) [7 ] O n E ve n t(S o u rce B e fo re G e tV a l u e sR e tu rn ) re tu rn co m p u ta ti o n th e a d [8 ] re tu rn V a l u e S e t(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