-/* Copyright (c) 2004-2022. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2004-2023. 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. */
#include <cmath>
#include <limits>
#include <memory>
+#include <string_view>
#include <vector>
-namespace simgrid {
-namespace kernel {
-namespace lmm {
+namespace simgrid::kernel::lmm {
/** @addtogroup SURF_lmm
* @details
*/
class XBT_PUBLIC Constraint {
public:
- enum class SharingPolicy { NONLINEAR = 2, SHARED = 1, FATPIPE = 0 };
+ enum class SharingPolicy { WIFI = 3, NONLINEAR = 2, SHARED = 1, FATPIPE = 0 };
Constraint(resource::Resource* id_value, double bound_value);
/** @brief Get the usage of the constraint after the last lmm solve */
double get_usage() const;
- int get_variable_amount() const;
/** @brief Sets the concurrency limit for this constraint */
void set_concurrency_limit(int limit)
* @param selective_update Enables lazy updates
* @return pointer to System instance
*/
- static System* build(const std::string& solver_name, bool selective_update);
+ static System* build(std::string_view solver_name, bool selective_update);
/** @brief Validates solver configuration */
static void validate_solver(const std::string& solver_name);
* @param cnst A constraint
* @param var A variable
* @param value The coefficient associated to the variable in the constraint
+ * @param force_creation Force the creation of new element linking the variable to the constraint. Should be used only
+ * by the model ptask_L07 to cope with ptasks composed of flows running on the same resource (see
+ * https://framagit.org/simgrid/simgrid/-/issues/111)
*/
- void expand(Constraint * cnst, Variable * var, double value);
+ void expand(Constraint* cnst, Variable* var, double value, bool force_creation = false);
/** @brief Update the bound of a variable */
void update_variable_bound(Variable * var, double bound);
saturated_constraint_set;
protected:
- bool selective_update_active; /* flag to update partially the system only selecting changed portions */
+ const bool selective_update_active; /* flag to update partially the system only selecting changed portions */
boost::intrusive::list<Constraint, boost::intrusive::member_hook<Constraint, boost::intrusive::list_member_hook<>,
&Constraint::modified_constraint_set_hook_>>
modified_constraint_set;
};
/** @} */
-} // namespace lmm
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::lmm
-#endif
\ No newline at end of file
+#endif