Skip to content

Commit

Permalink
[pgRouting#1153] Option A
Browse files Browse the repository at this point in the history
Changes committed:

Updating NEWS and release notes
	modified:   NEWS
	modified:   doc/src/release_notes.rst

Updating documentation
	modified:   doc/costMatrix/costMatrix-category.rst
	modified:   doc/costMatrix/pgr_bdDijkstraCostMatrix.rst
	modified:   doc/costMatrix/pgr_dijkstraCostMatrix.rst
	modified:   doc/costMatrix/pgr_withPointsCostMatrix.rst
	modified:   doc/src/routingFunctions.rst
	modified:   doc/tsp/TSP-family.rst
	modified:   pgtap/tsp/TSPeuclidean/illegal_values.sql
	modified:   pgtap/tsp/TSPeuclidean/innerQuery.sql
	modified:   pgtap/tsp/TSPeuclidean/no_crash_test.sql
	modified:   pgtap/tsp/TSPeuclidean/types_check.sql
	modified:   pgtap/tsp/no_crash_test-tsp.sql
	modified:   pgtap/tsp/pgr_TSP_types_check.sql
	modified:   sql/sigs/pgrouting--3.0.0.sig

Renaming documentation files to match function renaming
	renamed:    doc/tsp/pgr_TSPeuclidean.rst -> doc/tsp/pgr_TSPannealingEuclidean.rst
	renamed:    doc/tsp/pgr_TSP.rst -> doc/tsp/pgr_TSPannealing.rst
	renamed:    doc/queries/doc-pgr_TSP.queries -> doc/queries/doc-pgr_TSPannealing.queries
	renamed:    doc/queries/doc-pgr_TSPeuclidean.queries -> doc/queries/doc-pgr_TSPannealingEuclidean.queries

Renaming sql files to match function renaming
	renamed:    sql/tsp/TSP.sql -> sql/tsp/TSPannealing.sql
	renamed:    sql/tsp/TSPeuclidean.sql -> sql/tsp/TSPannealingEuclidean.sql
	renamed:    sql/tsp/_TSP.sql -> sql/tsp/_TSPannealing.sql
	renamed:    sql/tsp/_TSPeuclidean.sql -> sql/tsp/_TSPannealingEuclidean.sql

Renaming test files to match function renaming
	renamed:    test/tsp/doc-pgr_TSP.result -> test/tsp/doc-pgr_TSPannealing.result
	renamed:    test/tsp/doc-pgr_TSP.test.sql -> test/tsp/doc-pgr_TSPannealing.test.sql
	renamed:    test/tsp/doc-pgr_TSPeuclidean.result -> test/tsp/doc-pgr_TSPannealingEuclidean.result
	renamed:    test/tsp/doc-pgr_TSPeuclidean.test.sql -> test/tsp/doc-pgr_TSPannealingEuclidean.test.sql
	renamed:    test/tsp/win-pgr_TSP.result -> test/tsp/win-pgr_TSPannealing.result
	renamed:    test/tsp/win-pgr_TSP.test.sql -> test/tsp/win-pgr_TSPannealing.test.sql

Using new names on build
	modified:   sql/tsp/CMakeLists.txt
	modified:   doc/queries/CMakeLists.txt
	modified:   doc/tsp/CMakeLists.txt

Using new names on documentation queries
	modified:   test/tsp/test.conf

Using new names on transifex configuration
	modified:   .tx/config
  • Loading branch information
cvvergara committed Dec 30, 2018
1 parent 3407f1e commit 34a1ef5
Show file tree
Hide file tree
Showing 34 changed files with 117 additions and 114 deletions.
12 changes: 6 additions & 6 deletions .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ file_filter = locale/<lang>/LC_MESSAGES/pgr_dijkstraCostMatrix.po
source_file = locale/pot/pgr_dijkstraCostMatrix.pot
source_lang = en

[pgrouting.pgr_euclideanTSP]
file_filter = locale/<lang>/LC_MESSAGES/pgr_euclideanTSP.po
source_file = locale/pot/pgr_euclideanTSP.pot
[pgrouting.pgr_TSPannealingEuclidean]
file_filter = locale/<lang>/LC_MESSAGES/pgr_TSPannealingEuclidean.po
source_file = locale/pot/pgr_TSPannealingEuclidean.pot
source_lang = en

[pgrouting.pgr_dijkstraCost]
Expand Down Expand Up @@ -137,9 +137,9 @@ file_filter = locale/<lang>/LC_MESSAGES/pgr_vrpOneDepot.po
source_file = locale/pot/pgr_vrpOneDepot.pot
source_lang = en

[pgrouting.pgr_TSP]
file_filter = locale/<lang>/LC_MESSAGES/pgr_TSP.po
source_file = locale/pot/pgr_TSP.pot
[pgrouting.pgr_TSPannealing]
file_filter = locale/<lang>/LC_MESSAGES/pgr_TSPannealing.po
source_file = locale/pot/pgr_TSPannealing.pot
source_lang = en

[pgrouting.drivingDistance-category]
Expand Down
4 changes: 3 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ pgRouting 3.0.0 Release Notes

*Fixed Issues*

* [#1153 ](https://github.com/pgRouting/pgrouting/issues/1153)_: Renamed pgr_eucledianTSP to pgr_TSPeuclidean
* [#1153 ](https://github.com/pgRouting/pgrouting/issues/1153)_:
* Renamed pgr_eucledianTSP to pgr_TSPannealingEuclidean
* Renamed pgr_TSP to pgr_TSPannealing

*New Experimental functions*

Expand Down
2 changes: 1 addition & 1 deletion doc/costMatrix/costMatrix-category.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Characteristics

The main Characteristics are:

* Can be used as input to :doc:`pgr_TSP`.
* Can be used as input to :doc:`pgr_TSPannealing`.

* :directly: when the resulting matrix is symmetric and there is no :math:`\infty` value.
* It will be the users responsibility to make the matrix symmetric.
Expand Down
4 changes: 2 additions & 2 deletions doc/costMatrix/pgr_bdDijkstraCostMatrix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Complete Signature
:start-after: -- bdDijkstra q2
:end-before: -- bdDijkstra q3

Parameters
Parameters
-------------------------------------------------------------------------------

================ ====================== =================================================
Expand Down Expand Up @@ -107,7 +107,7 @@ See Also

* :doc:`pgr_bdDijkstra`
* :doc:`costMatrix-category`
* :doc:`pgr_TSP`
* :doc:`pgr_TSPannealing`
* The queries use the :doc:`sampledata` network.

.. rubric:: Indices and tables
Expand Down
2 changes: 1 addition & 1 deletion doc/costMatrix/pgr_dijkstraCostMatrix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Signatures

.. index::
single: dijkstraCostMatrix

Complete Signature
...............................................................................

Expand Down
4 changes: 2 additions & 2 deletions doc/costMatrix/pgr_withPointsCostMatrix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Inner query
Additional Examples
-------------------------------------------------------------------------------

:Example: :doc:`pgr_TSP` using ``pgr_withPointsCostMatrix`` for points :math:`\{1, 6\}` and vertices :math:`\{3, 6\}` on an **undirected** graph
:Example: :doc:`pgr_TSPannealing` using ``pgr_withPointsCostMatrix`` for points :math:`\{1, 6\}` and vertices :math:`\{3, 6\}` on an **undirected** graph

.. literalinclude:: doc-pgr_fooDmatrix.queries
:start-after: -- withPoints q3
Expand All @@ -131,7 +131,7 @@ See Also

* :doc:`pgr_withPoints`
* :doc:`costMatrix-category`
* :doc:`pgr_TSP`
* :doc:`pgr_TSPannealing`
* `sampledata` network.

.. rubric:: Indices and tables
Expand Down
4 changes: 2 additions & 2 deletions doc/queries/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ SET(LOCAL_FILES
doc-pgr_nodeNetwork.queries
doc-pgr_analyzeOneWay.queries
doc-pgr_createVerticesTable.queries
doc-pgr_TSPeuclidean.queries
doc-pgr_TSP.queries
doc-pgr_TSPannealingEuclidean.queries
doc-pgr_TSPannealing.queries
doc-pickDeliverEuclidean.queries
doc-contractGraph.queries
doc-pgr_analyzeGraph.queries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BEGIN
SET client_min_messages TO NOTICE;
SET
-- q1
SELECT * FROM pgr_TSP(
SELECT * FROM pgr_TSPannealing(
$$
SELECT * FROM pgr_dijkstraCostMatrix(
'SELECT id, source, target, cost, reverse_cost FROM edge_table',
Expand All @@ -30,7 +30,7 @@ SELECT * FROM pgr_TSP(
(14 rows)

-- q2
SELECT * FROM pgr_TSP(
SELECT * FROM pgr_TSPannealing(
$$
SELECT * FROM pgr_dijkstraCostMatrix(
'SELECT id, source, target, cost, reverse_cost FROM edge_table',
Expand Down Expand Up @@ -60,7 +60,7 @@ SELECT * FROM pgr_TSP(
(14 rows)

-- q3
SELECT * FROM pgr_TSP(
SELECT * FROM pgr_TSPannealing(
$$
SELECT * FROM pgr_withPointsCostMatrix(
'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BEGIN
SET client_min_messages TO NOTICE;
SET
-- q1
SELECT * FROM pgr_TSPeuclidean(
SELECT * FROM pgr_TSPannealingEuclidean(
$$
SELECT id, st_X(the_geom) AS x, st_Y(the_geom)AS y FROM edge_table_vertices_pgr
$$,
Expand Down Expand Up @@ -31,7 +31,7 @@ SELECT * FROM pgr_TSPeuclidean(
(18 rows)

-- q2
SELECT* from pgr_TSPeuclidean(
SELECT* from pgr_TSPannealingEuclidean(
$$
SELECT id, st_X(the_geom) AS x, st_Y(the_geom) AS y FROM edge_table_vertices_pgr
$$,
Expand Down Expand Up @@ -63,7 +63,7 @@ SELECT* from pgr_TSPeuclidean(
-- q3
SET client_min_messages TO DEBUG1;
SET
SELECT* from pgr_TSPeuclidean(
SELECT* from pgr_TSPannealingEuclidean(
$$
SELECT id, st_X(the_geom) AS x, st_Y(the_geom) AS y FROM edge_table_vertices_pgr
$$,
Expand Down
4 changes: 3 additions & 1 deletion doc/src/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ pgRouting 3.0.0 Release Notes

.. rubric:: Fixed Issues

* `#1153 <https://github.com/pgRouting/pgrouting/issues/1153>`__: Renamed pgr_eucledianTSP to pgr_TSPeuclidean
* `#1153 <https://github.com/pgRouting/pgrouting/issues/1153>`__:
* Renamed pgr_eucledianTSP to pgr_TSPannealingEuclidean
* Renamed pgr_TSP to pgr_TSPannealing

.. rubric:: New Experimental functions

Expand Down
2 changes: 1 addition & 1 deletion doc/src/routingFunctions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Routing Functions

:doc:`pgr_trsp` - Turn Restriction Shortest Path (TRSP)

:doc:`pgr_TSP`
:doc:`TSP-family`

.. include:: TSP-family.rst
:start-after: index from here
Expand Down
4 changes: 2 additions & 2 deletions doc/tsp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

SET(LOCAL_FILES
pgr_TSPeuclidean.rst
pgr_TSP.rst
pgr_TSPannealingEuclidean.rst
pgr_TSPannealing.rst
TSP-family.rst
)

Expand Down
8 changes: 4 additions & 4 deletions doc/tsp/TSP-family.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ Traveling Sales Person - Family of functions

.. index from here
* :doc:`pgr_TSP` - When input is given as matrix cell information.
* :doc:`pgr_TSPeuclidean` - When input are coordinates.
* :doc:`pgr_TSPannealing` - When input is given as matrix cell information.
* :doc:`pgr_TSPannealingEuclidean` - When input are coordinates.

.. index to here
.. toctree::
:hidden:

pgr_TSP
pgr_TSPeuclidean
pgr_TSPannealing
pgr_TSPannealingEuclidean

.. contents:: Table of Contents
:local:
Expand Down
12 changes: 6 additions & 6 deletions doc/tsp/pgr_TSP.rst → doc/tsp/pgr_TSPannealing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
****************************************************************************

pgr_TSP
pgr_TSPannealing
=============================================================================

* ``pgr_TSP`` - Using *Simulated Annealing* approximation algorithm
* ``pgr_TSPannealing`` - Using *Simulated Annealing* approximation algorithm

.. rubric:: Availability: 2.0.0

Expand All @@ -35,7 +35,7 @@ Signatures

.. code-block:: none
pgr_TSP(Matrix SQL,
pgr_TSPannealing(Matrix SQL,
[start_id], [end_id],
[max_processing_time],
[tries_per_temperature], [max_changes_per_temperature], [max_consecutive_non_changes],
Expand All @@ -45,7 +45,7 @@ Signatures
:Example: Not having a random execution

.. literalinclude:: doc-pgr_TSP.queries
.. literalinclude:: doc-pgr_TSPannealing.queries
:start-after: -- q1
:end-before: -- q2

Expand Down Expand Up @@ -95,7 +95,7 @@ Additional Examples

:Example: Start from vertex :math:`7`

.. literalinclude:: doc-pgr_TSP.queries
.. literalinclude:: doc-pgr_TSPannealing.queries
:start-after: -- q2
:end-before: -- q3

Expand All @@ -106,7 +106,7 @@ To generate a symmetric matrix:
* the **side** information of pointsOfInterset is ignored by not including it in the query
* and **directed := false**

.. literalinclude:: doc-pgr_TSP.queries
.. literalinclude:: doc-pgr_TSPannealing.queries
:start-after: -- q3
:end-before: -- q4

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
****************************************************************************

pgr_TSPeuclidean
pgr_TSPannealingEuclidean
=============================================================================

``pgr_TSPeuclidean`` - Using *Simulated Annealing* approximation algorithm
``pgr_TSPannealingEuclidean`` - Using *Simulated Annealing* approximation algorithm


.. rubric:: Availability
Expand All @@ -36,7 +36,7 @@ Signatures

.. code-block:: none
pgr_TSPeuclidean(Coordinates SQL,
pgr_TSPannealingEuclidean(Coordinates SQL,
[start_id], [end_id],
[max_processing_time],
[tries_per_temperature], [max_changes_per_temperature], [max_consecutive_non_changes],
Expand All @@ -46,7 +46,7 @@ Signatures
:Example: Not having a random execution

.. literalinclude:: doc-pgr_TSPeuclidean.queries
.. literalinclude:: doc-pgr_TSPannealingEuclidean.queries
:start-after: -- q1
:end-before: -- q2

Expand Down Expand Up @@ -95,13 +95,13 @@ Additional Examples

:Example: Try :math:`3` times per temperature with cooling factor of :math:`0.5`, not having a random execution

.. literalinclude:: doc-pgr_TSPeuclidean.queries
.. literalinclude:: doc-pgr_TSPannealingEuclidean.queries
:start-after: -- q2
:end-before: -- q3

:Example: Skipping the Simulated Annealing & showing some process information

.. literalinclude:: doc-pgr_TSPeuclidean.queries
.. literalinclude:: doc-pgr_TSPannealingEuclidean.queries
:start-after: -- q3
:end-before: -- q4

Expand Down
19 changes: 9 additions & 10 deletions pgtap/tsp/TSPeuclidean/illegal_values.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

\i setup.sql

SELECT plan(9);
Expand All @@ -10,71 +9,71 @@ FROM edge_table_vertices_pgr;


SELECT throws_ok($$
SELECT * FROM pgr_TSPeuclidean('SELECT id, x, y FROM coords',
SELECT * FROM pgr_TSPannealingEuclidean('SELECT id, x, y FROM coords',
max_processing_time := -4,
randomize := false)$$,
'XX000',
'Condition not met: max_processing_time >= 0',
'1 SHOULD throw because max_processing_time has illegal value');

SELECT throws_ok($$
SELECT * FROM pgr_TSPeuclidean('SELECT id, x, y FROM coords',
SELECT * FROM pgr_TSPannealingEuclidean('SELECT id, x, y FROM coords',
tries_per_temperature := -4,
randomize := false)$$,
'XX000',
'Condition not met: tries_per_temperature >= 0',
'2 SHOULD throw because tries_per_temperature has illegal value');

SELECT throws_ok($$
SELECT * FROM pgr_TSPeuclidean('SELECT id, x, y FROM coords',
SELECT * FROM pgr_TSPannealingEuclidean('SELECT id, x, y FROM coords',
max_changes_per_temperature := -4,
randomize := false)$$,
'XX000',
'Condition not met: max_changes_per_temperature > 0',
'3 SHOULD throw because max_changes_per_temperature has illegal value');

SELECT throws_ok($$
SELECT * FROM pgr_TSPeuclidean('SELECT id, x, y FROM coords',
SELECT * FROM pgr_TSPannealingEuclidean('SELECT id, x, y FROM coords',
max_consecutive_non_changes := -4,
randomize := false)$$,
'XX000',
'Condition not met: max_consecutive_non_changes > 0',
'4 SHOULD throw because max_consecutive_non_changes has illegal value');

SELECT throws_ok($$
SELECT * FROM pgr_TSPeuclidean('SELECT id, x, y FROM coords',
SELECT * FROM pgr_TSPannealingEuclidean('SELECT id, x, y FROM coords',
cooling_factor := 0,
randomize := false)$$,
'XX000',
'Condition not met: 0 < cooling_factor < 1',
'5 SHOULD throw because cooling_factor has illegal value');

SELECT throws_ok($$
SELECT * FROM pgr_TSPeuclidean('SELECT id, x, y FROM coords',
SELECT * FROM pgr_TSPannealingEuclidean('SELECT id, x, y FROM coords',
cooling_factor := 1,
randomize := false)$$,
'XX000',
'Condition not met: 0 < cooling_factor < 1',
'6 SHOULD throw because cooling_factor has illegal value');

SELECT throws_ok($$
SELECT * FROM pgr_TSPeuclidean('SELECT id, x, y FROM coords',
SELECT * FROM pgr_TSPannealingEuclidean('SELECT id, x, y FROM coords',
initial_temperature := 0,
randomize := false)$$,
'XX000',
'Condition not met: initial_temperature > final_temperature',
'7 SHOULD throw because initial_temperature has illegal value');

SELECT throws_ok($$
SELECT * FROM pgr_TSPeuclidean('SELECT id, x, y FROM coords',
SELECT * FROM pgr_TSPannealingEuclidean('SELECT id, x, y FROM coords',
final_temperature := 101,
randomize := false)$$,
'XX000',
'Condition not met: initial_temperature > final_temperature',
'8 SHOULD throw because final_temperature has illegal value');

SELECT throws_ok($$
SELECT * FROM pgr_TSPeuclidean('SELECT id, x, y FROM coords',
SELECT * FROM pgr_TSPannealingEuclidean('SELECT id, x, y FROM coords',
final_temperature := 0,
randomize := false)$$,
'XX000',
Expand Down
Loading

0 comments on commit 34a1ef5

Please sign in to comment.