PGROUTING  2.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
trsp.h
Go to the documentation of this file.
1 /*
2  * Shortest path with turn restrictions algorithm for PostgreSQL
3  *
4  * Copyright (c) 2011 Stephen Woodbridge
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  *
20  */
21 
22 #ifndef _TRSP_H
23 #define _TRSP_H
24 
25 #define MAX_RULE_LENGTH 5
26 
27 #include "postgres.h"
28 
29 typedef struct edge
30 {
31  int id;
32  long source;
33  long target;
36 } edge_t;
37 
38 typedef struct restrict_struct
39 {
40  int target_id;
43 }
45 
46 typedef struct path_element
47 {
48  long vertex_id;
49  long edge_id;
52 
53 #ifdef __cplusplus
54 extern "C"
55 #endif
56 
58  edge_t *edges,
59  unsigned int edge_count,
60  restrict_t *restricts,
61  int restrict_count,
62  int start_vertex,
63  int end_vertex,
64  bool directed,
65  bool has_reverse_cost,
67  int *path_count,
68  char **err_msg
69  );
70 
71 #ifdef __cplusplus
72 extern "C"
73 #endif
74 
76  edge_t *edges,
77  unsigned int edge_count,
78  restrict_t *restricts,
79  int restrict_count,
80  int start_edge,
81  double start_pos,
82  int end_edge,
83  double end_pos,
84  bool directed,
85  bool has_reverse_cost,
87  int *path_count,
88  char **err_msg
89  );
90 
91 #endif
float8 cost
Definition: trsp.h:34
int trsp_edge_wrapper(edge_t *edges, unsigned int edge_count, restrict_t *restricts, int restrict_count, int start_edge, double start_pos, int end_edge, double end_pos, bool directed, bool has_reverse_cost, path_element_t **path, int *path_count, char **err_msg)
Definition: trsp_core.cpp:60
int path_count
Definition: BDATester.cpp:51
struct restrict_struct restrict_t
long edge_id
Definition: trsp.h:49
int target_id
Definition: trsp.h:40
float8 cost
Definition: trsp.h:50
int trsp_node_wrapper(edge_t *edges, unsigned int edge_count, restrict_t *restricts, int restrict_count, int start_vertex, int end_vertex, bool directed, bool has_reverse_cost, path_element_t **path, int *path_count, char **err_msg)
Definition: trsp_core.cpp:10
double float8
Definition: postgres.h:23
float8 to_cost
Definition: trsp.h:41
int edge_count
Definition: BDATester.cpp:47
edge_astar_t * edges
Definition: BDATester.cpp:46
#define MAX_RULE_LENGTH
Definition: trsp.h:25
struct edge edge_t
path_element_t * path
Definition: BDATester.cpp:49
int via[5]
Definition: trsp.h:42
char * err_msg
Definition: BDATester.cpp:50
long target
Definition: trsp.h:33
struct path_element path_element_t
long vertex_id
Definition: trsp.h:48
float8 reverse_cost
Definition: trsp.h:35
long source
Definition: trsp.h:32