Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add new entry in Release_Notes.
[simgrid.git] / include / simgrid / kernel / routing / RoutedZone.hpp
1 /* Copyright (c) 2013-2023. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SIMGRID_ROUTING_GENERIC_HPP_
7 #define SIMGRID_ROUTING_GENERIC_HPP_
8
9 #include <simgrid/kernel/routing/NetZoneImpl.hpp>
10
11 namespace simgrid::kernel::routing {
12
13 /** @ingroup ROUTING_API
14  *  @brief NetZone with an explicit routing (abstract class)
15  *
16  * This abstract class factors code between its subclasses: Full, Dijkstra and Floyd.
17  *
18  * <table>
19  * <caption>Comparison of the RoutedZone subclasses</caption>
20  * <tr><td></td><td>DijkstraZone</td><td>FloydZone</td><td>FullZone</td></tr>
21  * <tr><td><b>Platform-file content</b></td>
22  * <td>Only 1-hop routes (rather small)</td>
23  * <td>Only 1-hop routes (rather small)</td>
24  * <td>Every path, explicitly (very large)</td>
25  * </tr>
26  * <tr><td><b>Initialization time</b></td>
27  * <td>Almost nothing</td>
28  * <td>Floyd-Warshall algorithm: O(n^3)</td>
29  * <td>Almost nothing</td>
30  * </tr>
31  * <tr><td><b>Memory usage</b></td>
32  * <td>1-hop routes (+ cache of routes)</td>
33  * <td>O(n^2) data (intermediate)</td>
34  * <td>O(n^2) + sum of path lengths (very large)</td>
35  * </tr>
36  * <tr><td><b>Lookup time</b></td>
37  * <td>Dijkstra Algo: O(n^3)</td>
38  * <td>not much (reconstruction phase)</td>
39  * <td>Almost nothing</td>
40  * </tr>
41  * <tr><td><b>Expressiveness</b></td>
42  * <td>Only shortest path</td>
43  * <td>Only shortest path</td>
44  * <td>Everything</td>
45  * </tr>
46  * </table>
47  */
48
49 class XBT_PRIVATE RoutedZone : public NetZoneImpl {
50 public:
51   explicit RoutedZone(const std::string& name);
52
53 protected:
54   Route* new_extended_route(RoutingMode hierarchy, NetPoint* gw_src, NetPoint* gw_dst,
55                             const std::vector<resource::StandardLinkImpl*>& link_list, bool preserve_order);
56   void get_route_check_params(const NetPoint* src, const NetPoint* dst) const;
57   void add_route_check_params(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
58                               const std::vector<s4u::LinkInRoute>& link_list, bool symmetrical) const;
59 };
60 } // namespace simgrid::kernel::routing
61
62 #endif /* SIMGRID_ROUTING_GENERIC_HPP_ */