Index: xssim/trunk/src/test/rewolucja/schemas/XSSimResSchema.xsd
===================================================================
--- xssim/trunk/src/test/rewolucja/schemas/XSSimResSchema.xsd	(revision 282)
+++ xssim/trunk/src/test/rewolucja/schemas/XSSimResSchema.xsd	(revision 293)
@@ -2,4 +2,126 @@
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
 	elementFormDefault="qualified" attributeFormDefault="unqualified">
+		
+	<xs:complexType name="timeEstimationPluginType">
+		<xs:annotation>
+			<xs:documentation>Time estimation plugin</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="name" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="resource">
+		<xs:attribute name="type" type="xs:string" use="required" />
+		<xs:attribute name="id" type="xs:ID" use="optional" />
+		<xs:attribute name="count" type="xs:integer" use="optional" />
+	</xs:complexType>
+
+	<xs:complexType name="computingResourceInterface">
+		<xs:annotation>
+			<xs:documentation>Computing resource</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="resource">
+			<xs:sequence>
+				<xs:choice minOccurs="0" maxOccurs="unbounded">
+					<xs:element name="computingResource" type="computingResourceType"></xs:element>
+					<xs:element name="resourceParameter" type="computingResourceParameterType"></xs:element>
+					<xs:element name="otherParameter" type="otherParameterType"/>
+				</xs:choice>
+				<xs:choice minOccurs="0" maxOccurs="1">
+					<xs:element name="energyEstimationPlugin" type="energyEstimationPluginType"></xs:element>
+				</xs:choice>
+				<xs:choice minOccurs="0" maxOccurs="1">
+					<xs:element name="energyPowerProfile" type="energyPowerProfileType"></xs:element>
+				</xs:choice>
+			</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="computingResourceType">
+		<xs:annotation>
+			<xs:documentation>Computing resource</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="computingResourceInterface">
+				<xs:sequence>
+					<xs:choice minOccurs="0" maxOccurs="1">
+						<xs:element name="location" type="locationType"></xs:element>
+					</xs:choice>
+					<xs:choice minOccurs="0" maxOccurs="1">
+						<xs:element name="size" type="sizeType"></xs:element>
+					</xs:choice>
+				</xs:sequence>
+				<xs:attribute name="templateId" type="xs:IDREF" use="optional"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="computingResourceTemplateType">
+		<xs:annotation>
+			<xs:documentation>Computing resource template</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="computingResourceInterface"/>
+		</xs:complexContent>
+	</xs:complexType>
+
+	<xs:complexType name="schedulerType">
+		<xs:annotation>
+			<xs:documentation>Scheduler</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="resource">
+				<xs:sequence minOccurs="0" maxOccurs="1">
+					<xs:element name="schedulingPlugin" type="schedulingPluginType" minOccurs="0" maxOccurs="1"></xs:element>
+					<xs:choice minOccurs="0" maxOccurs="unbounded">
+						<xs:element name="scheduler" type="schedulerType"></xs:element>
+						<xs:element name="managedComputingResource" type="managedComputingResourceType" minOccurs="0" maxOccurs="1"></xs:element>
+						<xs:element name="schedulingParameter" type="parameterType" minOccurs="0" maxOccurs="1"></xs:element>
+					</xs:choice>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="schedulingPluginType">
+		<xs:annotation>
+			<xs:documentation>Scheduling plugin</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="name" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
+			<xs:element name="frequency" type="xs:integer" minOccurs="0" maxOccurs="1"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<!--  
+	<xs:complexType name="schedulingParameterType">
+		<xs:annotation>
+			<xs:documentation>Scheduling resource related parameter</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="parameterType">
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	-->
+	
+	<xs:complexType name="managedComputingResourceType">
+		<xs:annotation>
+			<xs:documentation>Computing resource</xs:documentation>
+		</xs:annotation>
+		<xs:choice minOccurs="0" maxOccurs="1">
+			<xs:element name="associatedComputingResource" type="xs:string"></xs:element>
+			<xs:element name="listOfManagedResources" type="resourceList"></xs:element>
+		</xs:choice>
+	</xs:complexType>
+	
+	<xs:complexType name="resourceList">
+		<xs:choice minOccurs="0" maxOccurs="unbounded">
+			<xs:element name="resourceId" type="xs:string"></xs:element>
+		</xs:choice>
+	</xs:complexType>
 	
 	<xs:complexType name="computingResourceParameterType">
@@ -9,5 +131,4 @@
 		<xs:complexContent>
 			<xs:extension base="parameterType">
-				<xs:attribute name="name" type="computingResourceParameterName" use="required"/>
 			</xs:extension>
 		</xs:complexContent>
@@ -32,6 +153,32 @@
 	</xs:simpleType>
 	
-	<!--  
-	<xs:complexType name="logicalResourceParameterType">
+	<xs:complexType name="energyEstimationPluginType">
+		<xs:annotation>
+			<xs:documentation>Energy consumption estimation plugin</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="name" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
+			<xs:choice minOccurs="0" maxOccurs="unbounded">
+				<xs:element name="energyParameter" type="parameterType"></xs:element>
+			</xs:choice>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="energyPowerProfileType">
+		<xs:annotation>
+			<xs:documentation>Energy power profile</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="name" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
+			<xs:choice minOccurs="0" maxOccurs="unbounded">
+				<xs:element name="powerStates" type="powerStatesType"></xs:element>
+				<xs:element name="pStates" type="pStatesType"></xs:element>
+				<xs:element name="energyParameter" type="parameterType"></xs:element>
+			</xs:choice>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<!-- 
+	<xs:complexType name="energyParameterType">
 		<xs:annotation>
 			<xs:documentation>Computational resource related parameter</xs:documentation>
@@ -39,16 +186,15 @@
 		<xs:complexContent>
 			<xs:extension base="parameterType">
-				<xs:attribute name="name" type="logicalResourceParameterName" use="required"/>
-			</xs:extension>
-		</xs:complexContent>
-	</xs:complexType>
-	
-	<xs:simpleType name="logicalResourceParameterName">
-		<xs:restriction base="xs:string">
-			<xs:enumeration value="TO DO"/>
-		</xs:restriction>
-	</xs:simpleType>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
 	-->
-		
+	
+	<xs:complexType name="pStatesType">
+		<xs:choice minOccurs="1" maxOccurs="unbounded">
+			<xs:element name="pState" type="pStateType"></xs:element>
+		</xs:choice>
+	</xs:complexType>
+	
 	<xs:complexType name="pStateType">
 		<xs:sequence>
@@ -60,10 +206,4 @@
 	</xs:complexType>
 	
-	<xs:complexType name="pStatesType">
-		<xs:choice minOccurs="1" maxOccurs="unbounded">
-			<xs:element name="pState" type="pStateType"></xs:element>
-		</xs:choice>
-	</xs:complexType>
-	
 	<xs:complexType name="powerStatesType">
 		<xs:choice minOccurs="1" maxOccurs="unbounded">
@@ -76,173 +216,75 @@
 			<xs:element name="name" type="xs:string"></xs:element>
 			<xs:element name="power" type="xs:double" minOccurs="0" maxOccurs="1"></xs:element>
-		</xs:sequence>
-	</xs:complexType>
-	
-	<xs:complexType name="energyParameterType">
-		<xs:annotation>
-			<xs:documentation>Computational resource related parameter</xs:documentation>
+			<xs:element name="transition" type="energyStatesTransitionType" minOccurs="0" maxOccurs="1"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="energyStatesTransitionType">
+		<xs:sequence>
+			<xs:element name="to" type="xs:string"></xs:element>
+			<xs:element name="power" type="xs:double"></xs:element>
+			<xs:element name="time" type="xs:double"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="locationType">
+		<xs:annotation>
+			<xs:documentation>Location parameters of resource</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="vertical" type="xs:long"/>
+			<xs:element name="horizontal" type="xs:long"/>
+			<xs:element name="depth" type="xs:long"/>
+		</xs:sequence>
+	</xs:complexType>
+
+	<xs:complexType name="sizeType">
+		<xs:annotation>
+			<xs:documentation>Size parameters of resource</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="length" type="xs:long"/>
+			<xs:element name="width" type="xs:long"/>
+			<xs:element name="height" type="xs:long"/>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="parameterType">
+		<xs:annotation>
+			<xs:documentation>Description of parameter of resource</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="paramValue" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+		<xs:attribute name="name" type="xs:string" use="required"/>
+	</xs:complexType>
+	
+	<xs:complexType name="otherParameterType">
+		<xs:annotation>
+			<xs:documentation>Other parameters</xs:documentation>
 		</xs:annotation>
 		<xs:complexContent>
 			<xs:extension base="parameterType">
-				<xs:attribute name="name" type="energyParameterName" use="required"/>
-			</xs:extension>
-		</xs:complexContent>
-	</xs:complexType>
-	
-	<xs:simpleType name="energyParameterName">
-		<xs:restriction base="xs:string">
-			<xs:enumeration value="powerProfile"/>
-			<xs:enumeration value="estimationPlugin"/>
-		</xs:restriction>
-	</xs:simpleType>
-	
-	<xs:complexType name="energyEstimationPluginType">
-		<xs:annotation>
-			<xs:documentation>Computational resource related parameter</xs:documentation>
-		</xs:annotation>
-		<xs:sequence>
-			<xs:element name="name" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
-			<xs:choice minOccurs="0" maxOccurs="unbounded">
-				<xs:element name="energyParameter" type="energyParameterType"></xs:element>
-			</xs:choice>
-		</xs:sequence>
-	</xs:complexType>
-	
-		<xs:complexType name="energyProfileType">
-		<xs:annotation>
-			<xs:documentation>Computational resource related parameter</xs:documentation>
-		</xs:annotation>
-		<xs:sequence>
-			<xs:element name="name" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
-			<xs:choice minOccurs="0" maxOccurs="unbounded">
-				<xs:element name="pStates" type="pStatesType"></xs:element>
-				<xs:element name="powerStates" type="powerStatesType"></xs:element>
-				<xs:element name="energyParameter" type="energyParameterType"></xs:element>
-			</xs:choice>
-		</xs:sequence>
-	</xs:complexType>
-	
-	<xs:complexType name="schedulingPluginType">
-		<xs:annotation>
-			<xs:documentation>Computational resource related parameter</xs:documentation>
-		</xs:annotation>
-		<xs:sequence>
-			<xs:element name="name" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
-			<xs:element name="frequency" type="xs:integer" minOccurs="0" maxOccurs="1"></xs:element>
-		</xs:sequence>
-	</xs:complexType>
-	
-	<xs:complexType name="schedulingParameterType">
-		<xs:annotation>
-			<xs:documentation>Scheduling resource related parameter</xs:documentation>
-		</xs:annotation>
-		<xs:complexContent>
-			<xs:extension base="parameterType">
-				<xs:attribute name="name" type="schedulingParameterName" use="required"/>
-			</xs:extension>
-		</xs:complexContent>
-	</xs:complexType>
-	
-	<xs:simpleType name="schedulingParameterName">
-		<xs:restriction base="xs:string">
-			<xs:enumeration value="frequency"/>
-		</xs:restriction>
-	</xs:simpleType>
-	
-	<xs:complexType name="otherParameterType">
-		<xs:annotation>
-			<xs:documentation>Dynamically defined parameter of resource</xs:documentation>
-		</xs:annotation>
-		<xs:complexContent>
-			<xs:extension base="parameterType">
-				<xs:attribute name="name" type="xs:string" use="required"/>
-				<xs:attribute name="endpoint" type="xs:string" use="optional"/>
-			</xs:extension>
-		</xs:complexContent>
-	</xs:complexType>
-	
-	<xs:complexType name="parameterType">
-		<xs:annotation>
-			<xs:documentation>Description of parameter of resource</xs:documentation>
-		</xs:annotation>
-		<xs:sequence>
-			<xs:element name="paramValue" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
-			<xs:element name="property" minOccurs="0" maxOccurs="unbounded">
-				<xs:complexType>
-					<xs:sequence>
-						<xs:element name="value" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
-					</xs:sequence>
-					<xs:attribute name="name" type="xs:string" use="required"/>
-					<xs:attribute name="exclude" type="xs:boolean" use="optional" default="false"/>
-				</xs:complexType>
-			</xs:element>
-		</xs:sequence>
-	</xs:complexType>
-	
-	<xs:complexType name="managedComputingResourceType">
-		<xs:annotation>
-			<xs:documentation>Computing resource</xs:documentation>
-		</xs:annotation>
-
-				<xs:choice minOccurs="0" maxOccurs="1">
-					<xs:element name="associatedComputingResource" type="xs:string"></xs:element>
-					<xs:element name="listOfManagedResources" type="resourceList"></xs:element>
-				</xs:choice>
-	</xs:complexType>
-	
-	<xs:complexType name="resourceList">
-		<xs:choice minOccurs="0" maxOccurs="unbounded">
-			<xs:element name="resourceId" type="xs:string"></xs:element>
-		</xs:choice>
-	</xs:complexType>
-	
-	<xs:complexType name="computingResourceType">
-		<xs:annotation>
-			<xs:documentation>Computing resource</xs:documentation>
-		</xs:annotation>
-		<xs:complexContent>
-			<xs:extension base="resource">
-				<xs:choice minOccurs="0" maxOccurs="unbounded">
-					<xs:element name="computingResource" type="computingResourceType"></xs:element>
-					<xs:element name="resourceParameter" type="computingResourceParameterType"></xs:element>
-					<xs:element name="energyEstimationPlugin" type="energyEstimationPluginType"></xs:element>
-					<xs:element name="energyProfile" type="energyProfileType"></xs:element>
-					<xs:element name="otherParameter" type="otherParameterType"/>
-				</xs:choice>
-			</xs:extension>
-		</xs:complexContent>
-	</xs:complexType>
-	
-	<xs:complexType name="schedulerType">
-		<xs:annotation>
-			<xs:documentation>Computing resource</xs:documentation>
-		</xs:annotation>
-		<xs:complexContent>
-			<xs:extension base="resource">
-			<xs:sequence minOccurs="0" maxOccurs="1">
-				<xs:element name="schedulingPlugin" type="schedulingPluginType" minOccurs="0" maxOccurs="1"></xs:element>
-				<xs:choice minOccurs="0" maxOccurs="unbounded">
-					<xs:element name="scheduler" type="schedulerType"></xs:element>
-					<xs:element name="managedComputingResource" type="managedComputingResourceType" minOccurs="0" maxOccurs="1"></xs:element>
-					<xs:element name="schedulingParameter" type="schedulingParameterType" minOccurs="0" maxOccurs="1"></xs:element>
-				</xs:choice>
-			</xs:sequence>
-			</xs:extension>
-		</xs:complexContent>
-	</xs:complexType>
-
-	<xs:complexType name="resource">
-		<xs:attribute name="resourceType" type="xs:string" use="required" />
-		<xs:attribute name="resourceId" type="xs:string" use="optional" />
-		<xs:attribute name="count" type="xs:integer" use="optional" />
-	</xs:complexType>
-
+				<xs:sequence>
+					<xs:element name="property" minOccurs="0" maxOccurs="unbounded">
+						<xs:complexType>
+							<xs:sequence>
+								<xs:element name="value" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+							</xs:sequence>
+							<xs:attribute name="name" type="xs:string" use="required"/>
+						</xs:complexType>
+					</xs:element>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	
 	<xs:element name="environment">
 		<xs:annotation>
-			<xs:documentation>Schema describing simulation environment
-			</xs:documentation>
+			<xs:documentation>Schema describing simulation environment</xs:documentation>
 		</xs:annotation>
 		<xs:complexType>
 			<xs:sequence>
+				<xs:element name="timeEstimationPlugin" type="timeEstimationPluginType" minOccurs="0" maxOccurs="1"></xs:element>
 				<xs:element name="resources">
 					<xs:annotation>
@@ -251,8 +293,16 @@
 					<xs:complexType>
 						<xs:sequence>
-							<xs:element name="computingResource" type="computingResourceType" maxOccurs="unbounded">
-							</xs:element>
-							<xs:element name="scheduler" type="schedulerType" minOccurs="0">
-							</xs:element>
+							<xs:element name="computingResource" type="computingResourceType" maxOccurs="unbounded"/>
+							<xs:element name="scheduler" type="schedulerType" minOccurs="0"/>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="templates" minOccurs="0">
+					<xs:annotation>
+						<xs:documentation>Description of resource templates</xs:documentation>
+					</xs:annotation>
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="computingResourceTemplate" type="computingResourceTemplateType" maxOccurs="unbounded"/>
 						</xs:sequence>
 					</xs:complexType>
