<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <xsd:include schemaLocation="baseTypes.xsd"/>
    <xsd:element name="configuration" type="configurationType"/>

    <xsd:complexType name="configurationType">
        <xsd:all>
            <xsd:element name="grid_network" type="grid_networkType" minOccurs="0"/>
            <xsd:element name="spider_network" type="spider_networkType" minOccurs="0"/>
            <xsd:element name="random_network" type="random_networkType" minOccurs="0"/>
            <xsd:element name="output" type="outputType" minOccurs="0"/>
            <xsd:element name="tls_building" type="tls_buildingType" minOccurs="0"/>
            <xsd:element name="edge_removal" type="edge_removalType" minOccurs="0"/>
            <xsd:element name="unregulated_nodes" type="unregulated_nodesType" minOccurs="0"/>
            <xsd:element name="processing" type="processingType" minOccurs="0"/>
            <xsd:element name="building_defaults" type="building_defaultsType" minOccurs="0"/>
            <xsd:element name="report" type="reportType" minOccurs="0"/>
            <xsd:element name="random_number" type="random_numberType" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="grid_networkType">
        <xsd:all>
            <xsd:element name="grid" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="grid.number" type="intOptionType" minOccurs="0"/>
            <xsd:element name="grid.length" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="grid.x-number" type="intOptionType" minOccurs="0"/>
            <xsd:element name="grid.y-number" type="intOptionType" minOccurs="0"/>
            <xsd:element name="grid.x-length" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="grid.y-length" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="grid.attach-length" type="floatOptionType" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="spider_networkType">
        <xsd:all>
            <xsd:element name="spider" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="spider.arm-number" type="intOptionType" minOccurs="0"/>
            <xsd:element name="spider.circle-number" type="intOptionType" minOccurs="0"/>
            <xsd:element name="spider.space-radius" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="spider.omit-center" type="boolOptionType" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="random_networkType">
        <xsd:all>
            <xsd:element name="rand" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="rand.iterations" type="intOptionType" minOccurs="0"/>
            <xsd:element name="rand.bidi-probability" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="rand.max-distance" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="rand.min-distance" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="rand.min-angle" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="rand.num-tries" type="intOptionType" minOccurs="0"/>
            <xsd:element name="rand.connectivity" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="rand.neighbor-dist1" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="rand.neighbor-dist2" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="rand.neighbor-dist3" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="rand.neighbor-dist4" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="rand.neighbor-dist5" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="rand.neighbor-dist6" type="floatOptionType" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="outputType">
        <xsd:all>
            <xsd:element name="output-file" type="fileOptionType" minOccurs="0"/>
            <xsd:element name="plain-output-prefix" type="fileOptionType" minOccurs="0"/>
            <xsd:element name="junctions.join-output" type="fileOptionType" minOccurs="0"/>
            <xsd:element name="map-output" type="fileOptionType" minOccurs="0"/>
            <xsd:element name="matsim-output" type="fileOptionType" minOccurs="0"/>
            <xsd:element name="opendrive-output" type="fileOptionType" minOccurs="0"/>
            <xsd:element name="dlr-navteq-output" type="fileOptionType" minOccurs="0"/>
            <xsd:element name="output.street-names" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="output.original-names" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="street-sign-output" type="fileOptionType" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="tls_buildingType">
        <xsd:all>
            <xsd:element name="tls.set" type="strOptionType" minOccurs="0"/>
            <xsd:element name="tls.unset" type="strOptionType" minOccurs="0"/>
            <xsd:element name="tls.guess" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="tls-guess.joining" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="tls.join" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="tls.green.time" type="intOptionType" minOccurs="0"/>
            <xsd:element name="tls.yellow.min-decel" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="tls.yellow.patch-small" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="tls.yellow.time" type="intOptionType" minOccurs="0"/>
            <xsd:element name="tls.half-offset" type="strOptionType" minOccurs="0"/>
            <xsd:element name="tls.quarter-offset" type="strOptionType" minOccurs="0"/>
            <xsd:element name="tls.default-type" type="strOptionType" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="edge_removalType">
        <xsd:all>
            <xsd:element name="keep-edges.min-speed" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="remove-edges.explicit" type="strOptionType" minOccurs="0"/>
            <xsd:element name="keep-edges.explicit" type="strOptionType" minOccurs="0"/>
            <xsd:element name="keep-edges.input-file" type="fileOptionType" minOccurs="0"/>
            <xsd:element name="keep-edges.in-boundary" type="strOptionType" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="unregulated_nodesType">
        <xsd:all>
            <xsd:element name="keep-nodes-unregulated" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="keep-nodes-unregulated.explicit" type="strOptionType" minOccurs="0"/>
            <xsd:element name="keep-nodes-unregulated.district-nodes" type="boolOptionType" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="processingType">
        <xsd:all>
            <xsd:element name="no-internal-links" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="no-turnarounds" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="no-turnarounds.tls" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="no-left-connections" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="offset.disable-normalization" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="offset.x" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="offset.y" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="flip-y-axis" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="roundabouts.guess" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="lefthand" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="junctions.join" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="junctions.join-dist" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="tls.join-dist" type="floatOptionType" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="building_defaultsType">
        <xsd:all>
            <xsd:element name="default.lanenumber" type="intOptionType" minOccurs="0"/>
            <xsd:element name="default.speed" type="floatOptionType" minOccurs="0"/>
            <xsd:element name="default.priority" type="intOptionType" minOccurs="0"/>
            <xsd:element name="default-junction-type" type="strOptionType" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="reportType">
        <xsd:all>
            <xsd:element name="verbose" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="print-options" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="help" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="version" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="xml-validation" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="no-warnings" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="log" type="fileOptionType" minOccurs="0"/>
            <xsd:element name="message-log" type="fileOptionType" minOccurs="0"/>
            <xsd:element name="error-log" type="fileOptionType" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="random_numberType">
        <xsd:all>
            <xsd:element name="random" type="boolOptionType" minOccurs="0"/>
            <xsd:element name="seed" type="intOptionType" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>

</xsd:schema>
