vrpRouting
0.3
matrix.h
Go to the documentation of this file.
1
/*PGR-GNU*****************************************************************
2
3
FILE: matrix.h
4
5
Copyright (c) 2015 pgRouting developers
6
Mail:
[email protected]
7
8
------
9
10
This program is free software; you can redistribute it and/or modify
11
it under the terms of the GNU General Public License as published by
12
the Free Software Foundation; either version 2 of the License, or
13
(at your option) any later version.
14
15
This program is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
GNU General Public License for more details.
19
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23
24
********************************************************************PGR-GNU*/
25
28
#ifndef INCLUDE_PROBLEM_MATRIX_H_
29
#define INCLUDE_PROBLEM_MATRIX_H_
30
#pragma once
31
32
#include <map>
33
#include <utility>
34
#include <tuple>
35
#include <string>
36
#include <vector>
37
38
#include "
cpp_common/base_matrix.h
"
39
#include "
cpp_common/identifiers.hpp
"
40
#include "
c_types/typedefs.h
"
41
42
43
namespace
vrprouting
{
44
namespace
problem {
45
46
class
Matrix
:
public
base::Base_Matrix
{
47
public
:
48
Matrix
() =
default
;
49
51
Matrix
(
Matrix_cell_t
*,
size_t
,
Time_multipliers_t
*,
size_t
,
const
Identifiers<Id>
&,
Multiplier
= 1.0);
52
54
Matrix
(
const
std::map<std::pair<Coordinate, Coordinate>,
Id
>&,
Time_multipliers_t
*,
size_t
,
Multiplier
= 1.0);
55
57
Matrix
(
Matrix_cell_t
*,
size_t
,
const
Identifiers<Id>
&,
Multiplier
= 1.0);
58
60
explicit
Matrix
(
const
std::map<std::pair<Coordinate, Coordinate>,
Id
>&,
Multiplier
= 1.0);
61
63
TInterval
travel_time
(
Id
,
Id
,
TTimestamp
)
const
;
64
66
TInterval
travel_time
(
Id
,
Id
)
const
;
67
68
std::string
multipliers_str
()
const
;
69
70
private
:
78
std::vector<std::tuple<TTimestamp, Multiplier>>
m_multipliers
;
79
};
80
81
}
// namespace problem
82
}
// namespace vrprouting
83
84
#endif // INCLUDE_PROBLEM_MATRIX_H_
vrprouting::problem::Matrix::travel_time
TInterval travel_time(Id, Id, TTimestamp) const
retrun the travel time times when using the time dependant multipliers
Definition:
matrix.cpp:233
Time_multipliers_t
Time Dependant Multipliers.
Definition:
time_multipliers_t.h:46
vrprouting::problem::Matrix::Matrix
Matrix()=default
vrprouting::problem::Matrix
Definition:
matrix.h:46
Id
int64_t Id
Definition:
typedefs.h:78
typedefs.h
vrprouting::problem::Matrix::multipliers_str
std::string multipliers_str() const
Definition:
matrix.cpp:256
TTimestamp
int64_t TTimestamp
Definition:
typedefs.h:71
Matrix_cell_t
traveling costs
Definition:
matrix_cell_t.h:41
vrprouting::problem::Matrix::m_multipliers
std::vector< std::tuple< TTimestamp, Multiplier > > m_multipliers
time dependant multiplier
Definition:
matrix.h:78
vrprouting::base::Base_Matrix
N x N matrix.
Definition:
base_matrix.h:61
TInterval
int64_t TInterval
Definition:
typedefs.h:72
Multiplier
double Multiplier
Definition:
typedefs.h:77
base_matrix.h
identifiers.hpp
Identifiers
Definition:
identifiers.hpp:51
vrprouting
Definition:
base_matrix.cpp:46
include
problem
matrix.h
Generated on Tue Nov 15 2022 03:49:51 for vrpRouting by
1.8.17