Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
c2219d97fdd88c9e62df8c88e68edf77c65b470a
[simgrid.git] / src / surf / network_constant.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 NETWORK_CONSTANT_HPP_
7 #define NETWORK_CONSTANT_HPP_
8
9 #include <xbt/base.h>
10
11 #include "network_interface.hpp"
12
13 namespace simgrid {
14 namespace kernel {
15 namespace resource {
16
17 /***********
18  * Classes *
19  ***********/
20
21 class XBT_PRIVATE NetworkConstantModel;
22 class XBT_PRIVATE NetworkConstantAction;
23
24 /*********
25  * Model *
26  *********/
27 class NetworkConstantModel : public NetworkModel {
28 public:
29   NetworkConstantModel() : NetworkModel(Model::UpdateAlgo::Full) {}
30   Action* communicate(simgrid::s4u::Host* src, simgrid::s4u::Host* dst, double size, double rate) override;
31   double next_occuring_event(double now) override;
32   void update_actions_state(double now, double delta) override;
33
34   LinkImpl* createLink(const std::string& name, double bw, double lat, e_surf_link_sharing_policy_t policy) override;
35     };
36
37     /**********
38      * Action *
39      **********/
40     class NetworkConstantAction : public NetworkAction {
41     public:
42       NetworkConstantAction(NetworkConstantModel *model_, double size, double latency);
43       ~NetworkConstantAction();
44       double initialLatency_;
45       void update_remains_lazy(double now) override;
46     };
47
48   }
49 }
50 } // namespace simgrid
51
52 #endif /* NETWORK_CONSTANT_HPP_ */