#define SURF_NETWORK_INTERFACE_HPP_
#include "simgrid/s4u/Link.hpp"
+#include "src/kernel/lmm/maxmin.hpp"
#include "src/surf/PropertyHolder.hpp"
#include "src/surf/surf_interface.hpp"
#include "xbt/base.h"
* @param latency The initial latency of the Link in seconds
* @param policy The sharing policy of the Link
*/
- virtual LinkImpl* createLink(const char* name, double bandwidth, double latency,
+ virtual LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
e_surf_link_sharing_policy_t policy) = 0;
/**
*
* @param system The lmm_system_t to solve
*/
- void (*f_networkSolve)(lmm_system_t) = lmm_solve;
+ void (*f_networkSolve)(lmm_system_t) = simgrid::kernel::lmm::lmm_solve;
/**
* @brief Get the right multiplicative factor for the latency.
*/
class LinkImpl : public simgrid::surf::Resource, public simgrid::surf::PropertyHolder {
protected:
- LinkImpl(simgrid::surf::NetworkModel* model, const char* name, lmm_constraint_t constraint);
+ LinkImpl(simgrid::surf::NetworkModel* model, const std::string& name, lmm_constraint_t constraint);
~LinkImpl() override;
public:
tmgr_trace_t trace); /*< setup the trace file with latency events (peak latency changes due to external load).
Trace must contain absolute values */
- tmgr_trace_iterator_t stateEvent_ = nullptr;
+ tmgr_trace_event_t stateEvent_ = nullptr;
s_surf_metric_t latency_ = {1.0, 0, nullptr};
s_surf_metric_t bandwidth_ = {1.0, 0, nullptr};
static std::unordered_map<std::string, LinkImpl*>* links;
public:
- static LinkImpl* byName(const char* name);
+ static LinkImpl* byName(std::string name);
static int linksCount();
static LinkImpl** linksList();
+ static void linksList(std::vector<s4u::Link*>* linkList);
static void linksExit();
};
* @param model The NetworkModel associated to this NetworkAction
* @param cost The cost of this NetworkAction in [TODO]
* @param failed [description]
- * @param var The lmm variable associated to this Action if it is part of a
- * LMM component
+ * @param var The lmm variable associated to this Action if it is part of a LMM component
*/
NetworkAction(simgrid::surf::Model* model, double cost, bool failed, lmm_variable_t var)
: simgrid::surf::Action(model, cost, failed, var){};
void setState(simgrid::surf::Action::State state) override;
- std::list<LinkImpl*> links();
+ virtual std::list<LinkImpl*> links();
- double latency_;
- double latCurrent_;
- double weight_;
- double rate_;
+ double latency_ = {};
+ double latCurrent_ = {};
+ double weight_ = {};
+ double rate_ = {};
};
}
}