namespace kernel {
namespace resource {
-NetworkNS3Model::NetworkNS3Model() : NetworkModel(Model::UpdateAlgo::Full)
+NetworkNS3Model::NetworkNS3Model() : NetworkModel(Model::UpdateAlgo::FULL)
{
xbt_assert(not sg_link_energy_is_inited(),
"LinkEnergy plugin and NS3 network models are not compatible. Are you looking for Ecofen, maybe?");
XBT_DEBUG("ns3_next_occuring_event");
//get the first relevant value from the running_actions list
- if (not get_running_action_set()->size() || now == 0.0)
+ if (not get_started_action_set()->size() || now == 0.0)
return -1.0;
else
do {
static std::vector<std::string> socket_to_destroy;
/* If there are no running flows, advance the NS3 simulator and return */
- if (get_running_action_set()->empty()) {
+ if (get_started_action_set()->empty()) {
while(double_positive(now - ns3::Simulator::Now().GetSeconds(), sg_surf_precision))
ns3_simulator(now-ns3::Simulator::Now().GetSeconds());
XBT_DEBUG("Processing socket %p (action %p)",sgFlow,action);
action->set_remains(action->get_cost() - sgFlow->sentBytes_);
- if (TRACE_is_enabled() && action->get_state() == kernel::resource::Action::State::running) {
+ if (TRACE_is_enabled() && action->get_state() == kernel::resource::Action::State::STARTED) {
double data_delta_sent = sgFlow->sentBytes_ - action->lastSent_;
std::vector<LinkImpl*> route = std::vector<LinkImpl*>();
- action->src_->routeTo(action->dst_, route, nullptr);
+ action->src_->route_to(action->dst_, route, nullptr);
for (auto const& link : route)
- TRACE_surf_link_set_utilization(link->get_cname(), action->get_category(), (data_delta_sent) / delta,
- now - delta, delta);
+ TRACE_surf_resource_set_utilization("LINK", "bandwidth_used", link->get_cname(), action->get_category(),
+ (data_delta_sent) / delta, now - delta, delta);
action->lastSent_ = sgFlow->sentBytes_;
}
if(sgFlow->finished_){
socket_to_destroy.push_back(ns3Socket);
XBT_DEBUG("Destroy socket %p of action %p", ns3Socket.c_str(), action);
- action->finish(kernel::resource::Action::State::done);
+ action->finish(kernel::resource::Action::State::FINISHED);
} else {
XBT_DEBUG("Socket %p sent %u bytes out of %u (%u remaining)", ns3Socket.c_str(), sgFlow->sentBytes_,
sgFlow->totalBytes_, sgFlow->remaining_);
bandwidth_.peak = bandwidth;
latency_.peak = latency;
- s4u::Link::onCreation(this->piface_);
+ s4u::Link::on_creation(this->piface_);
}
LinkNS3::~LinkNS3() = default;
port_number++;
xbt_assert(port_number <= 65000, "Too many connections! Port number is saturated.");
- s4u::Link::onCommunicate(this, src, dst);
+ s4u::Link::on_communicate(this, src, dst);
}
void NetworkNS3Action::suspend() {