<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="solution">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="route" maxOccurs="unbounded">
          <xs:complexType>
            <xs:sequence>
              <xs:element ref="depot" maxOccurs="1"/>
              <xs:choice maxOccurs="unbounded">
                <xs:element name="customer" maxOccurs="1">
                  <xs:complexType>
                    <xs:attribute name="id" type="xs:int" use="required"/>
                  </xs:complexType>
                </xs:element>
                <xs:element name="station" minOccurs="0" maxOccurs="1">
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element name="wait" type="xs:float">
                        <!--The total time waited at the station before the starting of the charging operation-->
                        <xs:annotation>
                          <xs:documentation>The amount of time that the vehicle waits before start charing</xs:documentation>
                        </xs:annotation>
                      </xs:element>
                      <!--The total energy charged at the station-->
                      <xs:element name="charge" type="xs:float">
                        <xs:annotation>
                          <xs:documentation>The amount of energy charged during this visit to this station</xs:documentation>
                        </xs:annotation>
                      </xs:element>
                    </xs:sequence>
                    <xs:attribute name="id" type="xs:int" use="required"/>
                  </xs:complexType>
                </xs:element>
              </xs:choice>
              <xs:element ref="depot" maxOccurs="1"/>
            </xs:sequence>
            <xs:attribute name="id" type="xs:int" form="unqualified" use="required"/>
          </xs:complexType>
        </xs:element>
        <xs:element ref="runtime"/>
      </xs:sequence>
      <xs:attribute name="instance" use="required" type="xs:string">
        <xs:annotation>
          <xs:documentation>Name of the instance. The value of this attribut should correspond to the value of the instance/info/name element in the original instance file.</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="solver" use="required" type="xs:string">
        <xs:annotation>
          <xs:documentation>Name of your solver</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="optimal" type="xs:boolean">
        <xs:annotation>
          <xs:documentation>Set this attribute to true if you have a proof of optimality for the solutin reported in the file.</xs:documentation>
        </xs:annotation>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="depot">
    <xs:complexType>
      <xs:attribute name="id" type="xs:int" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="machine">
    <xs:complexType>
      <xs:all>
        <xs:element name="cpu" type="xs:float">
          <xs:annotation>
            <xs:documentation>Clock speed rate of the CPU in GHz.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="cores" type="xs:int">
          <xs:annotation>
            <xs:documentation>Number of cores in the CPU</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="ram" type="xs:float">
          <xs:annotation>
            <xs:documentation>Random Access Memory (RAM) in GB</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="language" type="xs:string">
          <xs:annotation>
            <xs:documentation>Programming language</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="os" type="xs:string">
          <xs:annotation>
            <xs:documentation>Operating system</xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:all>
    </xs:complexType>
  </xs:element>
  <xs:element name="runtime">
    <xs:complexType>
      <xs:all>
        <xs:element name="cputime" type="xs:long">
          <xs:annotation>
            <xs:documentation>Running time of the solver in milliseconds</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element ref="machine"/>
      </xs:all>
    </xs:complexType>
  </xs:element>
</xs:schema>
