1 /* Copyright (c) 2013-2023. The SimGrid Team. All rights reserved. */
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. */
6 #ifndef SIMGRID_ROUTING_GENERIC_HPP_
7 #define SIMGRID_ROUTING_GENERIC_HPP_
9 #include <simgrid/kernel/routing/NetZoneImpl.hpp>
11 namespace simgrid::kernel::routing {
13 /** @ingroup ROUTING_API
14 * @brief NetZone with an explicit routing (abstract class)
16 * This abstract class factors code between its subclasses: Full, Dijkstra and Floyd.
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>
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>
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>
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>
41 * <tr><td><b>Expressiveness</b></td>
42 * <td>Only shortest path</td>
43 * <td>Only shortest path</td>
49 class XBT_PRIVATE RoutedZone : public NetZoneImpl {
51 explicit RoutedZone(const std::string& name);
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;
60 } // namespace simgrid::kernel::routing
62 #endif /* SIMGRID_ROUTING_GENERIC_HPP_ */