return static_cast<VM*>(surf_host_resource_priv(resource));
}
-char *surf_routing_edge_name(sg_routing_edge_t edge){
- return edge->getName();
-}
-
extern double NOW;
void surf_presolve(void)
Model *model = NULL;
unsigned int iter;
- XBT_DEBUG
- ("First Run! Let's \"purge\" events and put models in the right state");
+ XBT_DEBUG ("First Run! Let's \"purge\" events and put models in the right state");
+
while ((next_event_date = tmgr_history_next_date(history)) != -1.0) {
if (next_event_date > NOW)
break;
XBT_DEBUG("Looking for next action end for all models except NS3");
xbt_dynar_foreach(model_list_invoke, iter, model) {
double next_action_end = -1.0;
- if (strcmp(model->getName(), "network NS3")) {
- XBT_DEBUG("Running for Resource [%s]", model->getName());
+ if (model->shareResourcesIsIdempotent()) {
+ XBT_DEBUG("Running for Resource [%s]", typeid(model).name());
next_action_end = model->shareResources(NOW);
XBT_DEBUG("Resource [%s] : next action end = %f",
- model->getName(), next_action_end);
+ typeid(model).name(), next_action_end);
}
if ((surf_min < 0.0 || next_action_end < surf_min)
&& next_action_end >= 0.0) {
next_event_date = tmgr_history_next_date(history);
- if(!strcmp(surf_network_model->getName(), "network NS3")){
+ if(! surf_network_model->shareResourcesIsIdempotent()){ // NS3, I see you
if(next_event_date!=-1.0 && surf_min!=-1.0) {
surf_min = MIN(next_event_date - NOW, surf_min);
} else{
}
const char *surf_model_name(surf_model_t model){
- return model->getName();
+ return typeid(model).name();
}
surf_action_t surf_model_extract_done_action_set(surf_model_t model){