static void on_host_creation(s4u::Host const& host)
{
+ if (Container::by_name_or_null(host.get_name())) // This host already exists, do nothing
+ return;
+
Container* container = new HostContainer(host, currentContainer.back());
const Container* root = Container::get_root();
double value = action.get_variable()->get_value() * action.get_variable()->get_constraint_weight(i);
/* Beware of composite actions: ptasks put links and cpus together. Extra pb: we cannot dynamic_cast from void* */
kernel::resource::Resource* resource = action.get_variable()->get_constraint(i)->get_id();
- const kernel::resource::Cpu* cpu = dynamic_cast<kernel::resource::Cpu*>(resource);
+ const kernel::resource::CpuImpl* cpu = dynamic_cast<kernel::resource::CpuImpl*>(resource);
if (cpu != nullptr)
resource_set_utilization("HOST", "speed_used", cpu->get_cname(), action.get_category(), value,