1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00
This commit is contained in:
Stefan Schroeder 2013-06-04 10:25:47 +02:00
commit 3581d6e097
435 changed files with 46952 additions and 0 deletions

View file

@ -0,0 +1,206 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2013 Stefan Schroeder
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Contributors:
Stefan Schroeder - initial API and implementation
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3schools.com"
xmlns="http://www.w3schools.com" elementFormDefault="qualified">
<xs:element name="algorithm">
<xs:complexType>
<xs:sequence>
<xs:element name="iterations" type="xs:integer" minOccurs="0" maxOccurs="1" default="100"/>
<xs:element name="construction" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="insertion" type="insertionType" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="strategy">
<xs:complexType>
<xs:all>
<xs:element name="memory" type="xs:integer" minOccurs="0" maxOccurs="1" default="1"/>
<xs:element name="searchStrategies" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="searchStrategy" type="searchStrategyType" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="searchStrategyType">
<xs:sequence>
<xs:element name="selector" type="selectorType"/>
<xs:element name="acceptor" type="acceptorType"/>
<xs:element name="modules" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="module" type="moduleType" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="probability">
<xs:simpleType>
<xs:restriction base="xs:double">
<xs:minInclusive value="0.0"/>
<xs:maxInclusive value="1.0"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
</xs:complexType>
<xs:complexType name="selectorType">
<xs:attribute name="name">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="selectBest"/>
<xs:enumeration value="selectRandomly"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="acceptorType">
<xs:sequence>
<xs:element name="alpha" type="xs:double" minOccurs="0" maxOccurs="1"/>
<xs:element name="warmup" type="xs:double" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="name">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="acceptNewRemoveWorst"/>
<xs:enumeration value="schrimpfAcceptance"/>
<xs:enumeration value="acceptNewRemoveFirst"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="moduleType">
<xs:choice>
<xs:group ref="ruin_and_recreate_group"/>
<xs:group ref="gendreau_group"/>
</xs:choice>
<xs:attribute name="name">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="ruin_and_recreate"/>
<xs:enumeration value="gendreau"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:group name="ruin_and_recreate_group">
<xs:sequence>
<xs:element name="ruin" type="ruinType"/>
<xs:element name="insertion" type="insertionType"/>
</xs:sequence>
</xs:group>
<xs:group name="gendreau_group">
<xs:sequence>
<xs:element name="itertions" type="xs:integer"/>
<xs:element name="share" type="xs:double"/>
</xs:sequence>
</xs:group>
<xs:complexType name="ruinType">
<xs:sequence>
<xs:element name="share">
<xs:simpleType>
<xs:restriction base="xs:double">
<xs:minInclusive value="0.0"/>
<xs:maxInclusive value="1.0"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="randomRuin"/>
<xs:enumeration value="radialRuin"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="id" type="xs:string"/>
</xs:complexType>
<xs:complexType name="insertionType">
<xs:sequence>
<xs:element name="level" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="forwardLooking" type="xs:string"/>
<xs:attribute name="memory" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="considerFixedCosts" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="weight" type="xs:double"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="experimental" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0"/>
</xs:sequence>
<xs:attribute name="timeSlice" type="xs:string"/>
<xs:attribute name="neighboringSlices" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="bestInsertion" />
<xs:enumeration value="regretInsertion" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="id" type="xs:string"/>
</xs:complexType>
</xs:schema>

View file

@ -0,0 +1,87 @@
<?xml version="1.0" ?>
<!--
Copyright (C) 2013 Stefan Schroeder
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Contributors:
Stefan Schroeder - initial API and implementation
-->
<config>
<controler>
<iterations>2000</iterations>
</controler>
<construction>
<insertion name="bestInsertion"/>
</construction>
<strategy>
<memory>3</memory>
<searchStrategies>
<searchStrategy id="randomRuinAndRecreate">
<selector name="selectBest"/>
<acceptor name="acceptNewRemoveWorst"/>
<!-- <acceptor id="1" name="schrimpfAcceptance">
<alpha>0.1</alpha>
<iterations>10</iterations>
</acceptor> -->
<modules>
<module name="randomRuin">
<share>0.5</share>
</module>
<module name="bestInsertion"></module>
</modules>
<probability>0.5</probability>
</searchStrategy>
<searchStrategy id="radialRuinAndRecreate">
<selector id="1" name="selectBest"/>
<acceptor name="acceptNewRemoveWorst"/>
<!-- <acceptor id="1" name="schrimpfAcceptance">
<alpha>0.1</alpha>
<iterations>10</iterations>
</acceptor> -->
<modules>
<module name="radialRuin">
<share>0.3</share>
<distanceMeasure>euclid</distanceMeasure>
</module>
<module name="bestInsertion"></module>
</modules>
<probability>0.5</probability>
</searchStrategy>
<!-- <searchStrategy id="gendreauPostOpt"> -->
<!-- <modules> -->
<!-- <module name="gendreauPostOpt"> -->
<!-- <iterations>200</iterations> -->
<!-- <share>0.2</share> -->
<!-- </module> -->
<!-- </modules> -->
<!-- <probability>0.1</probability> -->
<!-- </searchStrategy> --> -->
</searchStrategies>
<before></before>
<after></after>
</strategy>
</config>

View file

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2013 Stefan Schroeder
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Contributors:
Stefan Schroeder - initial API and implementation
-->
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd" >
<log4j:configuration>
<appender name="stdout" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{ISO8601} %5p %C{1}:%L %m%n"/>
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="LevelMin" value="trace" />
<param name="LevelMax" value="info" />
</filter>
</appender>
<root>
<priority value="debug"></priority>
<appender-ref ref="stdout"/>
</root>
</log4j:configuration>

View file

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2013 Stefan Schroeder
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Contributors:
Stefan Schroeder - initial API and implementation
-->
<algorithm xmlns="http://www.w3schools.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3schools.com algorithm_schema.xsd">
<construction>
<insertion name="bestInsertion"/>
</construction>
<strategy>
<memory>1</memory>
<searchStrategies>
<searchStrategy name="randomRuinAndRecreate">
<selector name="selectBest"/>
<acceptor name="acceptNewRemoveFirst"/>
<modules>
<module name="ruin_and_recreate">
<ruin name="randomRuin">
<share>0.5</share>
</ruin>
<insertion name="bestInsertion"/>
</module>
</modules>
<probability>0.5</probability>
</searchStrategy>
<searchStrategy name="radialRuinAndRecreate">
<selector name="selectBest"/>
<acceptor name="acceptNewRemoveFirst"/>
<modules>
<module name="ruin_and_recreate">
<ruin name="radialRuin">
<share>0.3</share>
</ruin>
<insertion name="bestInsertion"/>
</module>
</modules>
<probability>0.5</probability>
</searchStrategy>
</searchStrategies>
</strategy>
</algorithm>

View file

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2013 Stefan Schroeder
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Contributors:
Stefan Schroeder - initial API and implementation
-->
<algorithm xmlns="http://www.w3schools.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3schools.com algorithm_schema.xsd">
<iterations>2000</iterations>
<construction>
<insertion name="bestInsertion"/>
</construction>
<strategy>
<memory>1</memory>
<searchStrategies>
<searchStrategy name="randomRuinAndRecreate">
<selector name="selectBest"/>
<acceptor name="schrimpfAcceptance">
<alpha>0.4</alpha>
<warmup>100</warmup>
</acceptor>
<modules>
<module name="ruin_and_recreate">
<ruin name="randomRuin">
<share>0.5</share>
</ruin>
<insertion name="bestInsertion"/>
</module>
</modules>
<probability>0.5</probability>
</searchStrategy>
<searchStrategy name="radialRuinAndRecreate">
<selector name="selectBest"/>
<acceptor name="schrimpfAcceptance"/>
<modules>
<module name="ruin_and_recreate">
<ruin name="radialRuin">
<share>0.3</share>
</ruin>
<insertion name="bestInsertion"/>
</module>
</modules>
<probability>0.5</probability>
</searchStrategy>
</searchStrategies>
</strategy>
</algorithm>

View file

@ -0,0 +1,203 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2013 Stefan Schroeder
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Contributors:
Stefan Schroeder - initial API and implementation
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3schools.com"
xmlns="http://www.w3schools.com" elementFormDefault="qualified">
<xs:element name="problem">
<xs:complexType>
<xs:sequence>
<xs:element name="problemType" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="fleetSize">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="INFINITE" />
<xs:enumeration value="FINITE" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="fleetComposition">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="HOMOGENEOUS" />
<xs:enumeration value="HETEROGENEOUS" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="vehicles" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="vehicle" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:all>
<xs:element name="id" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="location">
<xs:complexType>
<xs:all>
<xs:element name="id" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="coord" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="x" type="xs:decimal" use="required"/>
<xs:attribute name="y" type="xs:decimal" use="required"/>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="typeId" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="timeSchedule" type="timeWindowType"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="vehicleTypes" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="type" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:all>
<xs:element name="id" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="capacity" type="xs:integer" minOccurs="0" maxOccurs="1" default="0"/>
<xs:element name="costs">
<xs:complexType>
<xs:all>
<xs:element name="fixed" type="xs:decimal" minOccurs="0" maxOccurs="1" default="0.0"/>
<xs:element name="distance" type="xs:decimal" minOccurs="0" maxOccurs="1" default="0.0"/>
<xs:element name="time" type="xs:decimal" minOccurs="0" maxOccurs="1" default="0.0"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="services" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="service" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:all>
<xs:element name="locationId" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="coord" type="coordType" minOccurs="0" maxOccurs="1"/>
<xs:element name="capacity-demand" type="xs:integer" minOccurs="0" maxOccurs="1" default="0"/>
<xs:element name="duration" type="xs:decimal" minOccurs="0" maxOccurs="1" default="0.0"/>
<xs:element name="timeWindows" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="timeWindow" type="timeWindowType" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="id" type="xs:string" use="required" />
<xs:attribute name="type" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="solutions" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="solution" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="cost" type="xs:decimal"/>
<xs:element name="routes" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="route" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="cost" type="xs:double" minOccurs="1" maxOccurs="1"/>
<xs:element name="driverId" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="vehicleId" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="start" type="xs:double" minOccurs="1" maxOccurs="1"/>
<xs:element name="act" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:all>
<xs:element name="serviceId" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="arrTime" type="xs:double" minOccurs="1" maxOccurs="1"/>
<xs:element name="endTime" type="xs:double" minOccurs="1" maxOccurs="1"/>
</xs:all>
<xs:attribute name="type" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="end" type="xs:double" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="timeWindowType">
<xs:sequence>
<xs:element name="start" type="xs:double"/>
<xs:element name="end" type="xs:double"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="coordType">
<xs:attribute name="x" type="xs:double" use="required" />
<xs:attribute name="y" type="xs:double" use="required" />
</xs:complexType>
</xs:schema>