<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:include schemaLocation="fmi3Annotation.xsd"/>
    <xs:include schemaLocation="fmi3AttributeGroups.xsd"/>
    <xs:annotation>
        <xs:documentation>
Copyright(c) 2008-2011 MODELISAR consortium,
             2012-2024 Modelica Association Project "FMI".
             All rights reserved.

This file is licensed by the copyright holders under the 2-Clause BSD License
(https://opensource.org/licenses/BSD-2-Clause):

----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above copyright notice,
 this list of conditions and the following disclaimer.

- Redistributions in binary form must reproduce the above copyright notice,
 this list of conditions and the following disclaimer in the documentation
 and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----------------------------------------------------------------------------
        </xs:documentation>
    </xs:annotation>
    <xs:complexType name="fmi3AbstractVariable" abstract="true">
        <xs:sequence>
            <xs:element ref="Annotations" minOccurs="0"/>
        </xs:sequence>
        <xs:attribute name="name" type="xs:normalizedString" use="required"/>
        <xs:attribute name="valueReference" type="xs:unsignedInt" use="required"/>
        <xs:attribute name="description" type="xs:string"/>
        <xs:attribute name="causality" default="local">
            <xs:simpleType>
                <xs:restriction base="xs:normalizedString">
                    <xs:enumeration value="parameter"/>
                    <xs:enumeration value="calculatedParameter"/>
                    <xs:enumeration value="input"/>
                    <xs:enumeration value="output"/>
                    <xs:enumeration value="local"/>
                    <xs:enumeration value="independent"/>
                    <xs:enumeration value="structuralParameter"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
        <xs:attribute name="variability">
            <xs:simpleType>
                <xs:restriction base="xs:normalizedString">
                    <xs:enumeration value="constant"/>
                    <xs:enumeration value="fixed"/>
                    <xs:enumeration value="tunable"/>
                    <xs:enumeration value="discrete"/>
                    <xs:enumeration value="continuous"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
        <xs:attribute name="canHandleMultipleSetPerTimeInstant" type="xs:boolean"/>
        <xs:attribute name="clocks">
            <xs:simpleType>
                <xs:list itemType="xs:unsignedInt"/>
            </xs:simpleType>
        </xs:attribute>
    </xs:complexType>
    <xs:group name="fmi3Dimensions">
        <xs:sequence>
            <xs:element name="Dimension" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:attribute name="start" type="xs:unsignedLong"/>
                    <xs:attribute name="valueReference" type="xs:unsignedInt"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:group>
    <xs:complexType name="fmi3ArrayableVariable" abstract="true">
        <xs:complexContent>
            <xs:extension base="fmi3AbstractVariable">
                <xs:group ref="fmi3Dimensions"/>
                <xs:attribute name="intermediateUpdate" type="xs:boolean"/>
                <xs:attribute name="previous" type="xs:unsignedInt"/>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3TypedVariable" abstract="true">
        <xs:complexContent>
            <xs:extension base="fmi3AbstractVariable">
                <xs:attribute name="declaredType" type="xs:normalizedString"/>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3TypedArrayableVariable" abstract="true">
        <xs:complexContent>
            <xs:extension base="fmi3ArrayableVariable">
                <xs:attribute name="declaredType" type="xs:normalizedString"/>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3MandatorilyTypedArrayableVariable" abstract="true">
        <xs:complexContent>
            <xs:restriction base="fmi3TypedArrayableVariable">
                <xs:sequence>
                    <xs:element ref="Annotations" minOccurs="0"/>
                    <xs:group ref="fmi3Dimensions"/>
                </xs:sequence>
                <xs:attribute name="declaredType" type="xs:normalizedString" use="required"/>
            </xs:restriction>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3InitializableVariable" abstract="true">
        <xs:complexContent>
            <xs:extension base="fmi3TypedArrayableVariable">
                <xs:attribute name="initial">
                    <xs:simpleType>
                        <xs:restriction base="xs:normalizedString">
                            <xs:enumeration value="exact"/>
                            <xs:enumeration value="approx"/>
                            <xs:enumeration value="calculated"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3MandatorilyTypedInitializableVariable">
        <xs:complexContent>
            <xs:extension base="fmi3MandatorilyTypedArrayableVariable">
                <xs:attribute name="initial">
                    <xs:simpleType>
                        <xs:restriction base="xs:normalizedString">
                            <xs:enumeration value="exact"/>
                            <xs:enumeration value="approx"/>
                            <xs:enumeration value="calculated"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3Float32">
        <xs:complexContent>
            <xs:extension base="fmi3InitializableVariable">
                <xs:sequence>
                    <xs:element name="Alias" type="fmi3FloatVariableAlias" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attributeGroup ref="fmi3RealBaseAttributes"/>
                <xs:attributeGroup ref="fmi3Float32Attributes"/>
                <xs:attribute name="start">
                    <xs:simpleType>
                        <xs:list itemType="xs:float"/>
                    </xs:simpleType>
                </xs:attribute>
                <xs:attributeGroup ref="fmi3RealVariableAttributes"/>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3Float64">
        <xs:complexContent>
            <xs:extension base="fmi3InitializableVariable">
                <xs:sequence>
                    <xs:element name="Alias" type="fmi3FloatVariableAlias" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attributeGroup ref="fmi3RealBaseAttributes"/>
                <xs:attributeGroup ref="fmi3Float64Attributes"/>
                <xs:attribute name="start">
                    <xs:simpleType>
                        <xs:list itemType="xs:double"/>
                    </xs:simpleType>
                </xs:attribute>
                <xs:attributeGroup ref="fmi3RealVariableAttributes"/>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3Int8">
        <xs:complexContent>
            <xs:extension base="fmi3InitializableVariable">
                <xs:sequence>
                    <xs:element name="Alias" type="fmi3VariableAlias" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attributeGroup ref="fmi3IntegerBaseAttributes"/>
                <xs:attributeGroup ref="fmi3Int8Attributes"/>
                <xs:attribute name="start">
                    <xs:simpleType>
                        <xs:list itemType="xs:byte"/>
                    </xs:simpleType>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3UInt8">
        <xs:complexContent>
            <xs:extension base="fmi3InitializableVariable">
                <xs:sequence>
                    <xs:element name="Alias" type="fmi3VariableAlias" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attributeGroup ref="fmi3IntegerBaseAttributes"/>
                <xs:attributeGroup ref="fmi3UInt8Attributes"/>
                <xs:attribute name="start">
                    <xs:simpleType>
                        <xs:list itemType="xs:unsignedByte"/>
                    </xs:simpleType>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3Int16">
        <xs:complexContent>
            <xs:extension base="fmi3InitializableVariable">
                <xs:sequence>
                    <xs:element name="Alias" type="fmi3VariableAlias" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attributeGroup ref="fmi3IntegerBaseAttributes"/>
                <xs:attributeGroup ref="fmi3Int16Attributes"/>
                <xs:attribute name="start">
                    <xs:simpleType>
                        <xs:list itemType="xs:short"/>
                    </xs:simpleType>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3UInt16">
        <xs:complexContent>
            <xs:extension base="fmi3InitializableVariable">
                <xs:sequence>
                    <xs:element name="Alias" type="fmi3VariableAlias" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attributeGroup ref="fmi3IntegerBaseAttributes"/>
                <xs:attributeGroup ref="fmi3UInt16Attributes"/>
                <xs:attribute name="start">
                    <xs:simpleType>
                        <xs:list itemType="xs:unsignedShort"/>
                    </xs:simpleType>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3Int32">
        <xs:complexContent>
            <xs:extension base="fmi3InitializableVariable">
                <xs:sequence>
                    <xs:element name="Alias" type="fmi3VariableAlias" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attributeGroup ref="fmi3IntegerBaseAttributes"/>
                <xs:attributeGroup ref="fmi3Int32Attributes"/>
                <xs:attribute name="start">
                    <xs:simpleType>
                        <xs:list itemType="xs:int"/>
                    </xs:simpleType>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3UInt32">
        <xs:complexContent>
            <xs:extension base="fmi3InitializableVariable">
                <xs:sequence>
                    <xs:element name="Alias" type="fmi3VariableAlias" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attributeGroup ref="fmi3IntegerBaseAttributes"/>
                <xs:attributeGroup ref="fmi3UInt32Attributes"/>
                <xs:attribute name="start">
                    <xs:simpleType>
                        <xs:list itemType="xs:unsignedInt"/>
                    </xs:simpleType>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3Int64">
        <xs:complexContent>
            <xs:extension base="fmi3InitializableVariable">
                <xs:sequence>
                    <xs:element name="Alias" type="fmi3VariableAlias" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attributeGroup ref="fmi3IntegerBaseAttributes"/>
                <xs:attributeGroup ref="fmi3Int64Attributes"/>
                <xs:attribute name="start">
                    <xs:simpleType>
                        <xs:list itemType="xs:long"/>
                    </xs:simpleType>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3UInt64">
        <xs:complexContent>
            <xs:extension base="fmi3InitializableVariable">
                <xs:sequence>
                    <xs:element name="Alias" type="fmi3VariableAlias" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attributeGroup ref="fmi3IntegerBaseAttributes"/>
                <xs:attributeGroup ref="fmi3UInt64Attributes"/>
                <xs:attribute name="start">
                    <xs:simpleType>
                        <xs:list itemType="xs:unsignedLong"/>
                    </xs:simpleType>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3Boolean">
        <xs:complexContent>
            <xs:extension base="fmi3InitializableVariable">
                <xs:sequence>
                    <xs:element name="Alias" type="fmi3VariableAlias" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attribute name="start">
                    <xs:simpleType>
                        <xs:list itemType="xs:boolean"/>
                    </xs:simpleType>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3String">
        <xs:complexContent>
            <xs:extension base="fmi3InitializableVariable">
                <xs:sequence>
                    <xs:element name="Start" minOccurs="0" maxOccurs="unbounded">
                        <xs:complexType>
                            <xs:attribute name="value" type="xs:string"/>
                        </xs:complexType>
                    </xs:element>
                    <xs:element name="Alias" type="fmi3VariableAlias" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3Binary">
        <xs:complexContent>
            <xs:extension base="fmi3InitializableVariable">
                <xs:sequence>
                    <xs:element name="Start" minOccurs="0" maxOccurs="unbounded">
                        <xs:complexType>
                            <xs:attribute name="value" type="xs:hexBinary"/>
                        </xs:complexType>
                    </xs:element>
                    <xs:element name="Alias" type="fmi3VariableAlias" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attribute name="mimeType" type="xs:normalizedString" default="application/octet-stream"/>
                <xs:attribute name="maxSize" type="xs:nonNegativeInteger"/>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3Enumeration">
        <xs:complexContent>
            <xs:extension base="fmi3MandatorilyTypedInitializableVariable">
                <xs:sequence>
                    <xs:element name="Alias" type="fmi3VariableAlias" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attributeGroup ref="fmi3IntegerBaseAttributes"/>
                <xs:attributeGroup ref="fmi3EnumerationAttributes"/>
                <xs:attribute name="start">
                    <xs:simpleType>
                        <xs:list itemType="xs:long"/>
                    </xs:simpleType>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3Clock">
        <xs:complexContent>
            <xs:extension base="fmi3TypedVariable">
                <xs:sequence>
                    <xs:element name="Alias" type="fmi3VariableAlias" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attributeGroup ref="fmi3ClockAttributes"/>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="fmi3VariableAlias">
        <xs:attribute name="name" type="xs:normalizedString" use="required"/>
        <xs:attribute name="description" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="fmi3FloatVariableAlias">
        <xs:complexContent>
            <xs:extension base="fmi3VariableAlias">
                <xs:attribute name="displayUnit" type="xs:normalizedString"/>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:group name="fmi3Variable">
        <xs:choice>
            <xs:element name="Float32" type="fmi3Float32"/>
            <xs:element name="Float64" type="fmi3Float64"/>
            <xs:element name="Int8" type="fmi3Int8"/>
            <xs:element name="UInt8" type="fmi3UInt8"/>
            <xs:element name="Int16" type="fmi3Int16"/>
            <xs:element name="UInt16" type="fmi3UInt16"/>
            <xs:element name="Int32" type="fmi3Int32"/>
            <xs:element name="UInt32" type="fmi3UInt32"/>
            <xs:element name="Int64" type="fmi3Int64"/>
            <xs:element name="UInt64" type="fmi3UInt64"/>
            <xs:element name="Boolean" type="fmi3Boolean"/>
            <xs:element name="String" type="fmi3String"/>
            <xs:element name="Binary" type="fmi3Binary"/>
            <xs:element name="Enumeration" type="fmi3Enumeration"/>
            <xs:element name="Clock" type="fmi3Clock"/>
        </xs:choice>
    </xs:group>
</xs:schema>
