<?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.vanderbilt.edu/SANet SANet_Network.xsd" xmlns:SANet="http://www.vanderbilt.edu/SANet"
  targetNamespace="http://www.vanderbilt.edu/SANet" elementFormDefault="qualified">
  <!-- Simple types. -->
  <xs:simpleType name="NodeID">
    <xs:restriction base="xs:int">
      <xs:minInclusive value="1" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="PortID">
    <xs:restriction base="xs:string" />
  </xs:simpleType>
  <xs:simpleType name="TaskCost">
    <xs:restriction base="xs:double" />
  </xs:simpleType>
  <xs:simpleType name="CondUtil">
    <xs:restriction base="xs:double" />
  </xs:simpleType>
  <xs:simpleType name="CondKind">
    <xs:restriction base="xs:string">
      <xs:enumeration value="ENVIRON" />
      <xs:enumeration value="SYSTEM" />
      <xs:enumeration value="DATA" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="Probability">
    <xs:restriction base="xs:double">
      <xs:minInclusive value="0" />
      <xs:maxInclusive value="1" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="LinkWeight">
    <xs:restriction base="xs:double">
      <xs:minInclusive value="-1" />
      <xs:maxInclusive value="1" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="MultFactor">
    <xs:restriction base="xs:double">
      <xs:minInclusive value="0" />
      <xs:maxInclusive value="1" />
    </xs:restriction>
  </xs:simpleType>
  <!-- Complex types corresponding to IDL structures.
       (nodes, links, and network). -->
  <xs:complexType name="TaskNode">
    <xs:sequence>
      <xs:element name="nodeID" type="SANet:NodeID" />
      <xs:element name="name" type="xs:string" default="" />
      <xs:element name="priorProb" type="SANet:Probability" />
      <xs:element name="attenFactor" type="SANet:MultFactor" default="1" />
      <xs:element name="cost" type="SANet:TaskCost" default="0" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="CondNode">
    <xs:sequence>
      <xs:element name="nodeID" type="SANet:NodeID" />
      <xs:element name="name" type="xs:string" default="" />
      <xs:element name="probTrue" type="SANet:Probability" default="0" />
      <xs:element name="utility" type="SANet:CondUtil" default="0" />
      <xs:element name="kind" type="SANet:CondKind" default="ENVIRON" />
      <xs:element name="attenFactor" type="SANet:MultFactor" default="1" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="PrecondLink">
    <xs:sequence>
      <xs:element name="condID" type="SANet:NodeID" />
      <xs:element name="taskID" type="SANet:NodeID" />
      <xs:element name="portID" type="SANet:PortID" />
      <xs:element name="trueProb" type="SANet:Probability" />
      <xs:element name="falseProb" type="SANet:Probability" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="EffectLink">
    <xs:sequence>
      <xs:element name="taskID" type="SANet:NodeID" />
      <xs:element name="condID" type="SANet:NodeID" />
      <xs:element name="portID" type="SANet:PortID" />
      <xs:element name="weight" type="SANet:LinkWeight" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Network">
    <xs:sequence>
      <xs:element name="defaultAttenFactor" type="SANet:MultFactor" default="1" />
      <xs:element name="defaultTaskCost" type="SANet:TaskCost" default="0" />
      <xs:element name="defaultCondUtil" type="SANet:CondUtil" default="0" />
      <xs:element name="defaultCondProbTrue" type="SANet:Probability" default="0" />
      <xs:element name="linkThresh" type="SANet:LinkWeight" default="0" />
      <xs:element name="taskNode" type="SANet:TaskNode" maxOccurs="unbounded" />
      <xs:element name="condNode" type="SANet:CondNode" maxOccurs="unbounded" />
      <xs:element name="precondLink" type="SANet:PrecondLink" maxOccurs="unbounded" />
      <xs:element name="effectLink" type="SANet:EffectLink" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <!-- Top-level network element. -->
  <xs:element name="network" type="SANet:Network" />
</xs:schema>