<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
	targetNamespace="http://www.ivoa.net/xml/theory/Simulation/v0.1"
	xmlns="http://www.ivoa.net/xml/theory/Simulation/v0.1"
	xmlns:res="http://www.ivoa.net/xml/VOResource/v1.0"
	elementFormDefault="qualified">
	<xs:import namespace="http://www.ivoa.net/xml/VOResource/v1.0"
		schemaLocation="http://www.ivoa.net/xml/VOResource/VOResource-v1.0.xsd" />

	<xs:include schemaLocation="BaseTypes.xsd" />

	<xs:complexType name="Quantity">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="ucd" type="xs:string" />
				<xs:attribute name="unit" type="xs:string" />
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="CharacterizationAxisType">
		<xs:sequence>
			<xs:element name="name" type="xs:string" />
			<xs:element name="datatype" type="DatatypeType" />
			<xs:element name="cardinality" type="CardinalityType" />
			<xs:element name="description" type="xs:string"
				minOccurs="0" maxOccurs="1" />
		</xs:sequence>
		<xs:attribute name="id" type="xs:ID" use="optional" />
		<xs:attribute name="ucd" type="xs:string" />
		<xs:attribute name="unit" type="xs:string" />
	</xs:complexType>

	<xs:complexType name="CharacterizationType">
		<xs:sequence>
			<xs:element name="lowerBound" type="Quantity" minOccurs="0" />
			<xs:element name="upperBound" type="Quantity" minOccurs="0" />
			<xs:element name="nominalValue" type="Quantity"
				minOccurs="0" />
			<xs:element name="min" type="Quantity" minOccurs="0" />
			<xs:element name="max" type="Quantity" minOccurs="0" />
			<xs:element name="mean" type="Quantity" minOccurs="0" />
			<xs:element name="standardDeviation" type="Quantity"
				minOccurs="0" />
		</xs:sequence>
		<xs:attribute name="charaxis" type="xs:IDREF" use="required" />
	</xs:complexType>

	<xs:complexType name="ProgramType">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="version" type="xs:string" />
				<xs:attribute name="reference" type="xs:anyURI" />
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="SnapshotType">
		<xs:sequence>
			<xs:element name="publisherDID" type="res:IdentifierURI" />
			<xs:element name="PhysicalTime" type="SnapshotTimeType"
				minOccurs="0" maxOccurs="unbounded" />
			<xs:element name="SimulationTime" type="SnapshotTimeType"
				minOccurs="0" maxOccurs="unbounded" />
			<xs:element name="Char" type="CharacterizationType"
				minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="SimulationType">
		<xs:complexContent>
			<xs:extension base="res:Resource">
				<xs:sequence>
					<xs:element name="CharAxis"
						type="CharacterizationAxisType" minOccurs="0"
						maxOccurs="unbounded" />
					<xs:element name="SimulationRun" type="RunType"
						minOccurs="0" maxOccurs="unbounded" />
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

	<xs:complexType name="ParameterType">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="name" type="xs:string" />
				<xs:attribute name="reference" type="xs:anyURI" />
				<xs:attribute name="ucd" type="xs:string" />
				<xs:attribute name="unit" type="xs:string" />
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="SnapshotTimeType">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="name" type="xs:string" />
				<xs:attribute name="ucd" type="xs:string" />
				<xs:attribute name="unit" type="xs:string" />
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="RunType">
		<xs:sequence>
			<xs:element name="publisherDID" type="res:IdentifierURI" />
			<xs:element name="Program" type="ProgramType" minOccurs="1"
				maxOccurs="1" />
			<xs:element name="Parameter" type="ParameterType"
				minOccurs="0" maxOccurs="unbounded" />
			<xs:element name="InputSnapshot" type="res:IdentifierURI"
				minOccurs="0" maxOccurs="unbounded" />
			<xs:element name="Snaphot" type="SnapshotType" minOccurs="0"
				maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<xs:element name="Simulation" type="SimulationType" />

</xs:schema>