Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add new entry in Release_Notes.
[simgrid.git] / src / kernel / resource / NetworkModel.hpp
index cbfa9b1..3508777 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2023. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -7,7 +7,7 @@
 #define SIMGRID_KERNEL_RESOURCE_NETWORKMODEL_HPP
 
 #include "simgrid/kernel/resource/Model.hpp"
-#include "simgrid/kernel/resource/NetworkModelIntf.hpp"
+#include "src/kernel/resource/NetworkModelFactors.hpp"
 #include "src/kernel/resource/StandardLinkImpl.hpp"
 
 #include <list>
@@ -18,16 +18,15 @@ namespace simgrid::kernel::resource {
  * Model *
  *********/
 
-/** @ingroup SURF_network_interface
- * @brief SURF network model interface class
+/** @ingroup Model_network_interface
+ * @brief Network model interface class
  * @details A model is an object which handles the interactions between its Resources and its Actions
  */
-class NetworkModel : public Model, public NetworkModelIntf {
+class NetworkModel : public Model, public NetworkModelFactors {
 public:
   static config::Flag<double> cfg_tcp_gamma;
   static config::Flag<bool> cfg_crosstraffic;
-  static double cfg_latency_factor;
-  static double cfg_bandwidth_factor;
+  static config::Flag<double> cfg_weight_S_parameter;
 
   using Model::Model;
   NetworkModel(const NetworkModel&) = delete;
@@ -54,43 +53,18 @@ public:
    * @param rate Allows to limit the transfer rate. Negative value means unlimited.
    * @return The action representing the communication
    */
-  virtual Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) = 0;
-
-  /**
-   * @brief Get the right multiplicative factor for the latency.
-   * @details Depending on the model, the effective latency when sending a message might be different from the
-   * theoretical latency of the link, in function of the message size. In order to account for this, this function gets
-   * this factor.
-   *
-   * @param size The size of the message.
-   * @return The latency factor.
-   */
-  virtual double get_latency_factor(double /* size */) { return cfg_latency_factor; }
-
-  /**
-   * @brief Get the right multiplicative factor for the bandwidth.
-   * @details Depending on the model, the effective bandwidth when sending a message might be different from the
-   * theoretical bandwidth of the link, in function of the message size. In order to account for this, this function
-   * gets this factor.
-   *
-   * @param size The size of the message.
-   * @return The bandwidth factor.
-   */
-  virtual double get_bandwidth_factor(double /* size*/) { return cfg_bandwidth_factor; }
+  virtual Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate, bool streamed) = 0;
 
   double next_occurring_event_full(double now) override;
 
-  void set_lat_factor_cb(const std::function<NetworkFactorCb>& cb) override { THROW_UNIMPLEMENTED; }
-  void set_bw_factor_cb(const std::function<NetworkFactorCb>& cb) override { THROW_UNIMPLEMENTED; }
-
   std::unique_ptr<StandardLinkImpl, StandardLinkImpl::Deleter> loopback_;
 };
 
 /**********
  * Action *
  **********/
-/** @ingroup SURF_network_interface
- * @brief SURF network action interface class
+/** @ingroup Model_network_interface
+ * @brief Network action interface class
  * @details A NetworkAction represents a communication between two [hosts](@ref HostImpl)
  */
 class NetworkAction : public Action {
@@ -101,8 +75,8 @@ public:
   /** @brief Constructor
    *
    * @param model The NetworkModel associated to this NetworkAction
-   * @param cost The cost of this  NetworkAction in [TODO]
-   * @param failed [description]
+   * @param cost The cost of this  NetworkAction in bytes
+   * @param failed Actions can be created in a failed state
    */
   NetworkAction(Model* model, s4u::Host& src, s4u::Host& dst, double cost, bool failed)
       : Action(model, cost, failed), src_(src), dst_(dst)