- virtual NetworkLinkPtr createResource(const char *name,
- double bw_initial,
- tmgr_trace_t bw_trace,
- double lat_initial,
- tmgr_trace_t lat_trace,
- e_surf_resource_state_t state_initial,
- tmgr_trace_t state_trace,
- e_surf_link_sharing_policy_t policy,
- xbt_dict_t properties)=0;
-
- //FIXME:void updateActionsStateLazy(double now, double delta);
- virtual void gapAppend(double /*size*/, const NetworkLinkLmmPtr /*link*/, NetworkActionLmmPtr /*action*/) {};
- virtual ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst,
- double size, double rate)=0;
- virtual xbt_dynar_t getRoute(RoutingEdgePtr src, RoutingEdgePtr dst); //FIXME: kill field? That is done by the routing nowadays
- void (*f_networkSolve)(lmm_system_t);
+/** @ingroup SURF_network_interface
+ * @brief SURF network model interface class
+ * @details A model is an object which handles the interactions between its Resources and its Actions
+ */
+class NetworkModel : public kernel::resource::Model {
+public:
+ /** @brief Constructor */
+ NetworkModel() : Model() {}
+
+ /** @brief Destructor */
+ ~NetworkModel() override;
+
+ /**
+ * @brief Create a Link
+ *
+ * @param name The name of the Link
+ * @param bandwidth The initial bandwidth of the Link in bytes per second
+ * @param latency The initial latency of the Link in seconds
+ * @param policy The sharing policy of the Link
+ */
+ virtual LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
+ e_surf_link_sharing_policy_t policy) = 0;
+
+ /**
+ * @brief Create a communication between two hosts.
+ * @details It makes calls to the routing part, and execute the communication
+ * between the two end points.
+ *
+ * @param src The source of the communication
+ * @param dst The destination of the communication
+ * @param size The size of the communication in bytes
+ * @param rate Allows to limit the transfer rate. Negative value means
+ * unlimited.
+ * @return The action representing the communication
+ */
+ virtual kernel::resource::Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) = 0;
+
+ /** @brief Function pointer to the function to use to solve the lmm_system_t
+ *
+ * @param system The lmm_system_t to solve
+ */
+ void (*f_networkSolve)(kernel::lmm::System*) = kernel::lmm::lmm_solve;
+
+ /**
+ * @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.
+ */