<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="xs3p.xsl"?>
<?xml-stylesheet type="text/xsl" href="xs3p.xsl"?>
<?xml-stylesheet type="text/xsl" href="xs3p.xsl"?>
<?xml-stylesheet type="text/xsl" href="xs3p.xsl"?>
<?xml-stylesheet type="text/xsl" href="xs3p.xsl"?>
<?xml-stylesheet type="text/xsl" href="xs3p.xsl"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="3.0.0">
	<xs:include schemaLocation="VhtngClasses.xsd"/>
	<xs:element name="vhtSimulinkModel" type="vhtSimulinkModel"/>
	<xs:complexType name="vhtSimulinkModel">
		<xs:sequence>
			<xs:element name="ModelConfiguration" type="ModelConfiguration" minOccurs="1" maxOccurs="1"/>
			<xs:element name="ModelVariables" type="ModelVariables" minOccurs="1" maxOccurs="1"/>
		</xs:sequence>
		<xs:attribute name="matlabRelease" use="required" type="MatlabVersions"/>
		<xs:attribute name="modelAuthor" use="optional" type="xs:string"/>
		<xs:attribute name="modelDescription" use="optional" type="xs:string"/>
		<xs:attribute name="modelName" use="required" type="xs:string"/>
		<xs:attribute name="modelVersion" use="optional" type="xs:float"/>
		<xs:attribute name="vhtVersion" use="optional" type="xs:float"/>
		<xs:attribute name="createdOn" use="optional" type="xs:string"/>
		<xs:attribute name="creator" use="optional" type="xs:string"/>
		<xs:attribute name="lastModifiedBy" use="optional" type="xs:string"/>
		<xs:attribute name="lastModifiedDate" use="optional" type="xs:string"/>
		<xs:attribute name="description" use="optional" type="xs:string"/>
	</xs:complexType>
	<xs:simpleType name="MatlabVersions">
		<xs:restriction base="xs:string">
			<xs:enumeration value="R2017b"/>
			<xs:enumeration value="R2017a"/>
			<xs:enumeration value="R2016b"/>
			<xs:enumeration value="R2016a"/>
			<xs:enumeration value="R2018a"/>
			<xs:enumeration value="R2018b"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:element name="ModelVariables" type="ModelVariables"/>
	<xs:complexType name="ModelVariables">
		<xs:sequence>
			<xs:element name="port" type="port" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:simpleType name="ModelSover">
		<xs:restriction base="xs:string">
			<xs:enumeration value="ode8"/>
			<xs:enumeration value="some_other_solver"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="ModelSolverType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="Fixed-step"/>
			<xs:enumeration value="variable_step_size"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:element name="port" type="port"/>
	<xs:complexType name="port">
		<xs:annotation>
			<xs:documentation>defies a port of a simulink model</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>The description of an element</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="version" type="xs:string" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>The version of an element</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="signal" type="signal" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="SimpleBus" type="SimpleBus" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="ComplexBus" type="ComplexBus" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="name" use="required" type="xs:string" form="unqualified">
			<xs:annotation>
				<xs:documentation>The name of the element</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="nameDisplay" use="optional" type="xs:string">
			<xs:annotation>
				<xs:documentation>the nameDisplay may slsocontain special characters as öäü</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="causality" use="optional" type="CausalityTypes">
			<xs:annotation>
				<xs:documentation>if the port is an input for the simulink model.
if causality is "input" this signal is an input the simulink model
if causality is "output" this signal is an output for the simulink model</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="idx" use="optional" type="xs:nonNegativeInteger">
			<xs:annotation>
				<xs:documentation>the index number of the port, which is provided by simulink to this specific port</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:element name="signal" type="signal"/>
	<xs:complexType name="signal">
		<xs:sequence>
			<xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>The description of an element</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="version" type="xs:string" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>The version of an element</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="size" type="size" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="name" use="required" type="xs:string" form="unqualified">
			<xs:annotation>
				<xs:documentation>The name of the element</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="nameDisplay" use="optional" type="xs:string">
			<xs:annotation>
				<xs:documentation>the nameDisplay may slsocontain special characters as öäü</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="dataType" use="required" type="SimulinkDatatypes">
			<xs:annotation>
				<xs:documentation>datatype of the signal. needs to be a valid simulink datatype</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="default_signal" use="optional" type="xs:boolean">
			<xs:annotation>
				<xs:documentation>if there is no signal defined for the port, this attribute is set to "true" to indicate that it was generated as a default signal</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="variable_size" use="optional" type="xs:boolean">
			<xs:annotation>
				<xs:documentation>if the size (array) of the signal is not predefined but variable, this attribute is set to true</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:element name="SimpleBus" type="SimpleBus"/>
	<xs:complexType name="SimpleBus">
		<xs:sequence>
			<xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>The description of an element</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="version" type="xs:string" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>The version of an element</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="signal" type="signal" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="name" use="required" type="xs:string" form="unqualified">
			<xs:annotation>
				<xs:documentation>The name of the element</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="nameDisplay" use="optional" type="xs:string">
			<xs:annotation>
				<xs:documentation>the nameDisplay may slsocontain special characters as öäü</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:element name="ComplexBus" type="ComplexBus"/>
	<xs:complexType name="ComplexBus">
		<xs:sequence>
			<xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>The description of an element</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="version" type="xs:string" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>The version of an element</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="SimpleBus" type="SimpleBus" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="signal" type="signal" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="name" use="required" type="xs:string" form="unqualified">
			<xs:annotation>
				<xs:documentation>The name of the element</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="nameDisplay" use="optional" type="xs:string">
			<xs:annotation>
				<xs:documentation>the nameDisplay may slsocontain special characters as öäü</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:element name="size" type="size"/>
	<xs:complexType name="size">
		<xs:annotation>
			<xs:documentation>the definition of the size for the signal can be done here</xs:documentation>
		</xs:annotation>
		<xs:sequence/>
		<xs:attribute name="dim" use="required" type="xs:nonNegativeInteger">
			<xs:annotation>
				<xs:documentation>the dimension points to the columns of the matrix.
If the dimension is "1" it is an array</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="length" use="required" type="xs:nonNegativeInteger">
			<xs:annotation>
				<xs:documentation>the length points to the rows of the matrix.
If the length and dimension are "1" it is an scalar variable</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:element name="NameDisplay" type="NameDisplay"/>
	<xs:complexType name="NameDisplay">
		<xs:sequence/>
		<xs:attribute name="nameDisplay" use="optional" type="xs:string">
			<xs:annotation>
				<xs:documentation>the nameDisplay may slsocontain special characters as öäü</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:simpleType name="SimulinkDatatypes">
		<xs:restriction base="xs:string">
			<xs:enumeration value="double">
				<xs:annotation>
					<xs:documentation>Double-precision floating point</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="single">
				<xs:annotation>
					<xs:documentation>Single-precision floating point</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="int8">
				<xs:annotation>
					<xs:documentation>Unsigned 8-bit integer</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="uint8">
				<xs:annotation>
					<xs:documentation>Unsigned 8-bit integer</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="int16">
				<xs:annotation>
					<xs:documentation>Signed 16-bit integer</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="uint16">
				<xs:annotation>
					<xs:documentation>Unsigned 16-bit integer</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="int32">
				<xs:annotation>
					<xs:documentation>Signed 32-bit integer</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="uint32">
				<xs:annotation>
					<xs:documentation>Unsigned 32-bit integer</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="int64">
				<xs:annotation>
					<xs:documentation>Signed 64-bit integer</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="uint64">
				<xs:annotation>
					<xs:documentation>Unsigned 64-bit integer</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="string">
				<xs:annotation>
					<xs:documentation>Text</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="boolean"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="CausalityTypes">
		<xs:restriction base="xs:string">
			<xs:enumeration value="input">
				<xs:annotation>
					<xs:documentation>if causality is "input" this signal is an input for the simulink model</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="output">
				<xs:annotation>
					<xs:documentation>if causality is "output" this signal is an output for the simulink model</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
		</xs:restriction>
	</xs:simpleType>
	<xs:element name="ModelConfiguration" type="ModelConfiguration"/>
	<xs:complexType name="ModelConfiguration">
		<xs:sequence/>
		<xs:attribute name="solver" use="required" type="ModelSover"/>
		<xs:attribute name="solverType" use="required" type="ModelSolverType"/>
		<xs:attribute name="stepSize" use="required" type="xs:float"/>
	</xs:complexType>
</xs:schema>
