Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
snake_case routing
[simgrid.git] / include / simgrid / kernel / routing / FloydZone.hpp
1 /* Copyright (c) 2013-2018. 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 SURF_ROUTING_FLOYD_HPP_
7 #define SURF_ROUTING_FLOYD_HPP_
8
9 #include <simgrid/kernel/routing/RoutedZone.hpp>
10
11 namespace simgrid {
12 namespace kernel {
13 namespace routing {
14
15 /** @ingroup ROUTING_API
16  *  @brief NetZone with an explicit routing computed at initialization with Floyd-Warshal
17  *
18  *  The path between components is computed at creation time from every one-hop links,
19  *  using the Floyd-Warshal algorithm.
20  *
21  *  This result in rather small platform file, slow initialization time,  and intermediate memory requirements
22  *  (somewhere between the one of @{DijkstraZone} and the one of @{FullZone}).
23  */
24 class XBT_PRIVATE FloydZone : public RoutedZone {
25 public:
26   explicit FloydZone(NetZone* father, std::string name);
27   ~FloydZone() override;
28
29   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
30   void add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src,
31                  kernel::routing::NetPoint* gw_dst, std::vector<simgrid::surf::LinkImpl*>& link_list,
32                  bool symmetrical) override;
33   void seal() override;
34
35 private:
36   /* vars to compute the Floyd algorithm. */
37   int* predecessor_table_;
38   double* cost_table_;
39   RouteCreationArgs** link_table_;
40 };
41 } // namespace routing
42 } // namespace kernel
43 } // namespace simgrid
44
45 #endif /* SURF_ROUTING_FLOYD_HPP_ */