-/* Copyright (c) 2004-2018. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
delete static_cast<Variable*>(var);
}
-Variable* System::variable_new(resource::Action* id, double sharing_weight, double bound, int number_of_constraints)
+Variable* System::variable_new(resource::Action* id, double sharing_weight, double bound, size_t number_of_constraints)
{
- XBT_IN("(sys=%p, id=%p, weight=%f, bound=%f, num_cons =%d)", this, id, sharing_weight, bound, number_of_constraints);
+ XBT_IN("(sys=%p, id=%p, weight=%f, bound=%f, num_cons =%zu)", this, id, sharing_weight, bound, number_of_constraints);
Variable* var = static_cast<Variable*>(xbt_mallocator_get(variable_mallocator_));
var->initialize(id, sharing_weight, bound, number_of_constraints, visited_counter_ - 1);
- if (sharing_weight)
+ if (sharing_weight > 0)
variable_set.push_front(*var);
else
variable_set.push_back(*var);
delete[] cnst_light_tab;
}
-/** \brief Attribute the value bound to var->bound.
+/** @brief Attribute the value bound to var->bound.
*
- * \param var the Variable*
- * \param bound the new bound to associate with var
+ * @param var the Variable*
+ * @param bound the new bound to associate with var
*
* Makes var->bound equal to bound. Whenever this function is called a change is signed in the system. To
* avoid false system changing detection it is a good idea to test (bound != 0) before calling it.
// Anyway, caller functions all call check_concurrency() in the end.
}
-/* \brief update the weight of a variable, and enable/disable it.
+/* @brief update the weight of a variable, and enable/disable it.
* @return Returns whether a change was made
*/
void System::update_variable_weight(Variable* var, double weight)
cnst->bound = bound;
}
-/** \brief Update the constraint set propagating recursively to other constraints so the system should not be entirely
+/** @brief Update the constraint set propagating recursively to other constraints so the system should not be entirely
* computed.
*
- * \param cnst the Constraint* affected by the change
+ * @param cnst the Constraint* affected by the change
*
* A recursive algorithm to optimize the system recalculation selecting only constraints that have changed. Each
* constraint change is propagated to the list of constraints for each variable.
/**
* Returns resource load (in flop per second, or byte per second, or similar)
*
- * If the resource is shared (the default case), the load is sum of resource usage made by every variables located on
- * this resource.
+ * If the resource is shared (the default case), the load is sum of resource usage made by
+ * every variables located on this resource.
*
- * If the resource is not shared (ie in FATPIPE mode), then the load is the max (not the sum) of all resource usages
- * located on this resource.
+ * If the resource is not shared (ie in FATPIPE mode), then the load is the max (not the sum)
+ * of all resource usages located on this resource.
*/
double Constraint::get_usage() const
{