Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

An OpenMI component can be identified through its OMI file. This is an XML file which contains sufficient information to identify a component, instantiate the binary unit on your machine (i.e. find the assembly and the class to instantiate) and populate it with input data. An XML schema definition has been created to enable default tools to parse the information.
In principle, OMI files can reside anywhere on your system. Users are therefore free to organize their own repository, as long as they can find the relevant OMI files themselves when configuring their model combination.
An example OMI file is given in Figure 3 1. The underlying schema definition (XSD) is provided in Figure 2 and 3 2.

Code Block

<?

...

xml version="1.0"?>

...


<LinkableComponent Type="

...

Oatc.OpenMI

...

.Examples.ModelComponents.SpatialModels.GroundWaterModel.GWModelLC" Assembly="

...

..\GroundWaterModel\bin\Debug\Oatc.OpenMI.Examples.ModelComponents.SpatialModels.GroundWaterModel.dll">
  <Arguments>
    <Argument Key="modelID" ReadOnly="true" Value="GW local" />
    <Argument Key="simulationStart" ReadOnly="true" Value="1990,1,2,0,0,0" />
    <Argument Key="simulationEnd" ReadOnly="true" Value="1993,1,1,0,0,0" />
    <Argument Key="nx" ReadOnly="true" Value="20" />
    <Argument Key="ny" ReadOnly="true" Value="30" />
    <Argument Key="ox" ReadOnly="true" Value="3000" />
    <Argument Key="oy" ReadOnly="true" Value="3000" />
    <Argument Key="cellSize" ReadOnly="true" Value="125" />
    <Argument Key="groundWaterLevel" ReadOnly="true" Value="0.5" />
    <Argument Key="gridAngle" ReadOnly="true" Value="20.0" />
   </Arguments>
</LinkableComponent>

Figure 1 OMI file example

Image Added

Figure 2 OMI schema defintion

<Arguments>

<Argument Key="Model" ReadOnly="true" Value="RR" />
<Argument Key="Schematization" ReadOnly="true"
Value="D:\Rain-RR-CF\Model\Cmtwork\sobek_3b.fnm" />

</Arguments>

</LinkableComponent>

Figure 3 1 OMI file example

Code Block
<?xml version="1.0"?>
<!-- OpenMI Linkable component entry point to instantiate the object-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.openmi.org" targetNamespace="http://www.openmi.org" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.4.0.0">
	<xsd:element name="LinkableComponent" type="LinkableComponentComplexType"/>
	<xsd:complexType name="LinkableComponentComplexType">
		<xsd:sequence>
			<xsd:element name="Arguments">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="Argument" minOccurs="0" maxOccurs="unbounded">
							<xsd:annotation>
								<xsd:documentation>arguments for instantiaion</xsd:documentation>
							</xsd:annotation>
							<xsd:complexType>
								<xsd:attribute name="Key" type="xsd:string" use="required" form="unqualified">
									<xsd:annotation>
										<xsd:documentation>attribute key for which a value is provided</xsd:documentation>
									</xsd:annotation>
								</xsd:attribute>
								<xsd:attribute name="ReadOnly" type="xsd:boolean" use="optional" form="unqualified"/>
								<xsd:attribute name="Value" type="xsd:string" use="required" form="unqualified">
									<xsd:annotation>
										<xsd:documentation>attribute value for associated key</xsd:documentation>
									</xsd:annotation>
								</xsd:attribute>
							</xsd:complexType>
						</xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
		</xsd:sequence>
		<xsd:attribute name="Type" type="xsd:string" form="unqualified">
			<xsd:annotation>
				<xsd:documentation>class to be instantiated to create a LinkableComponent-object</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="Assembly" type="xsd:string" use="optional" form="unqualified">
			<xsd:annotation>
				<xsd:documentation>dotNet assembly that can instantiate the class</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="JavaArchive" type="xsd:string" use="optional" form="unqualified">
			<xsd:annotation>
				<xsd:documentation>JavaArchive that can instantiate the class</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>
</xsd:schema>

...