PGROUTING  3.2
trsp.h File Reference
#include <stdint.h>
Include dependency graph for trsp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  edge
 
struct  path_element
 
struct  restrict_struct
 

Macros

#define MAX_RULE_LENGTH   5
 

Typedefs

typedef struct edge edge_t
 
typedef struct path_element path_element_tt
 
typedef struct restrict_struct restrict_t
 

Functions

int trsp_edge_wrapper (edge_t *edges, size_t edge_count, restrict_t *restricts, size_t restrict_count, int64_t start_edge, double start_pos, int64_t end_edge, double end_pos, bool directed, bool has_reverse_cost, path_element_tt **path, size_t *path_count, char **err_msg)
 

Macro Definition Documentation

◆ MAX_RULE_LENGTH

#define MAX_RULE_LENGTH   5

Definition at line 29 of file trsp.h.

Typedef Documentation

◆ edge_t

typedef struct edge edge_t

◆ path_element_tt

typedef struct path_element path_element_tt

◆ restrict_t

typedef struct restrict_struct restrict_t

Function Documentation

◆ trsp_edge_wrapper()

int trsp_edge_wrapper ( edge_t edges,
size_t  edge_count,
restrict_t restricts,
size_t  restrict_count,
int64_t  start_edge,
double  start_pos,
int64_t  end_edge,
double  end_pos,
bool  directed,
bool  has_reverse_cost,
path_element_tt **  path,
size_t *  path_count,
char **  err_msg 
)

Definition at line 37 of file trsp_core.cpp.

51  {
52  try {
53  std::vector<PDVI> ruleTable;
54 
55  size_t i, j;
56  ruleTable.clear();
57  for (i = 0; i < restrict_count; i++) {
58  std::vector<int64> seq;
59  seq.clear();
60  seq.push_back(restricts[i].target_id);
61  for (j = 0; j < MAX_RULE_LENGTH && restricts[i].via[j] >- 1; j++) {
62  seq.push_back(restricts[i].via[j]);
63  }
64  ruleTable.push_back(make_pair(restricts[i].to_cost, seq));
65  }
66 
67  GraphDefinition gdef;
68  auto res = gdef.my_dijkstra1(edges, edge_count, start_edge, start_pos,
69  end_edge, end_pos, directed, has_reverse_cost, path, path_count,
70  err_msg, ruleTable);
71 
72 
73  if (res < 0)
74  return res;
75  else
76  return EXIT_SUCCESS;
77  }
78  catch(std::exception& e) {
79  *err_msg = const_cast<char *>(e.what());
80  return -1;
81  }
82  catch(...) {
83  *err_msg = const_cast<char *>("Caught unknown exception!");
84  return -1;
85  }
86 }

References MAX_RULE_LENGTH, GraphDefinition::my_dijkstra1(), and restrict_struct::via.

Referenced by compute_trsp().

MAX_RULE_LENGTH
#define MAX_RULE_LENGTH
Definition: trsp.h:29
GraphDefinition::my_dijkstra1
int my_dijkstra1(edge_t *edges, size_t edge_count, int64 start_edge, double start_part, int64 end_edge, double end_part, bool directed, bool has_reverse_cost, path_element_tt **path, size_t *path_count, char **err_msg, std::vector< PDVI > &ruleList)
Definition: GraphDefinition.cpp:210
restrict_struct::via
int via[5]
Definition: trsp.h:52
GraphDefinition
Definition: GraphDefinition.h:115