SOLA
Loading...
Searching...
No Matches
simple_temporal_network.h
1// Copyright 2023 The SOLA authors
2//
3// This file is part of DAISI.
4//
5// DAISI is free software: you can redistribute it and/or modify it under the terms of the GNU
6// General Public License as published by the Free Software Foundation; version 2.
7//
8// DAISI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
9// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10// Public License for more details.
11//
12// You should have received a copy of the GNU General Public License along with DAISI. If not, see
13// <https://www.gnu.org/licenses/>.
14//
15// SPDX-License-Identifier: GPL-2.0-only
16
17#ifndef DAISI_DATASTRUCTURE_SIMPLE_TEMPORAL_NETWORK_H_
18#define DAISI_DATASTRUCTURE_SIMPLE_TEMPORAL_NETWORK_H_
19
20#include <optional>
21
22#include "weighted_directed_graph.tpp"
23
24namespace daisi::datastructure {
25
26template <typename Vertex, typename Edge>
27class SimpleTemporalNetwork : public WeightedDirectedGraph<Vertex, Edge> {
28public:
30 virtual ~SimpleTemporalNetwork() = default;
31
32 void addBinaryConstraint(const Vertex &start, const Vertex &end,
33 const std::optional<double> &lower_bound,
34 const std::optional<double> &upper_bound);
35
36 void addUnaryConstraint(const Vertex &vertex, const std::optional<double> &lower_bound,
37 const std::optional<double> &upper_bound);
38
39 void updateLastBinaryConstraint(const Vertex &start, const Vertex &end,
40 const std::optional<double> &lower_bound,
41 const std::optional<double> &upper_bound);
42
43 void removeVertex(const Vertex &vertex);
44
45 Vertex &getOrigin();
46 std::vector<std::pair<Vertex, double>> getEarliestSolution();
47 std::vector<std::pair<Vertex, double>> getLatestSolution();
48
49 virtual bool solve();
50
51protected:
52 std::vector<std::vector<double>> d_graph_;
53};
54
55} // namespace daisi::datastructure
56
57#endif
Definition simple_temporal_network.h:27
Definition weighted_directed_graph.h:25