X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6d64c296b8f063bec38fb27e00ad60469080228a..64caf78080c48d893d253680b7b7dd3e3822ea3a:/src/kernel/lmm/bmf.hpp diff --git a/src/kernel/lmm/bmf.hpp b/src/kernel/lmm/bmf.hpp index 3b5b0afa34..601151b087 100644 --- a/src/kernel/lmm/bmf.hpp +++ b/src/kernel/lmm/bmf.hpp @@ -29,7 +29,16 @@ private: class XBT_PUBLIC BmfSolver { public: - BmfSolver(Eigen::MatrixXd A, Eigen::MatrixXd maxA, Eigen::VectorXd C, Eigen::VectorXd phi); + /** + * @brief Instantiate the BMF solver + * + * @param A A_ji: consumption of player i on resource j + * @param maxA maxA_ji: consumption of larger player i on resource j + * @param C Resource capacity + * @param shared Is resource shared between player or each player receives the full capacity (FATPIPE links) + * @param phi Bound for each player + */ + BmfSolver(Eigen::MatrixXd A, Eigen::MatrixXd maxA, Eigen::VectorXd C, std::vector shared, Eigen::VectorXd phi); /** @brief Solve equation system to find a fair-sharing of resources */ Eigen::VectorXd solve(); @@ -120,12 +129,13 @@ private: Eigen::MatrixXd maxA_; //!< maxA_ji, similar as A_, but containing the maximum consumption of player i (if player a //!< single flow it's equal to A_) Eigen::VectorXd C_; //!< C_j Capacity of each resource - Eigen::VectorXd phi_; //!< phi_i bound for each player + std::vector C_shared_; //!< shared_j Resource j is shared or not + Eigen::VectorXd phi_; //!< phi_i bound for each player std::unordered_set, boost::hash>> allocations_; AllocationGenerator gen_; std::vector allocations_age_; - static constexpr int NO_RESOURCE = -1; //!< flag to indicate player has selected no resource + static constexpr int NO_RESOURCE = -1; //!< flag to indicate player has selected no resource int max_iteration_ = sg_bmf_max_iterations; //!< number maximum of iterations of BMF algorithm }; @@ -164,8 +174,10 @@ private: * * @param cnst_list Constraint list (modified for selective update or active) * @param C Resource capacity vector + * @param shared Resource is shared or not (fatpipe links) */ - template void get_constraint_data(const CnstList& cnst_list, Eigen::VectorXd& C); + template + void get_constraint_data(const CnstList& cnst_list, Eigen::VectorXd& C, std::vector& shared); std::unordered_map idx2Var_; //!< Map player index (and position in matrices) to system's variable std::unordered_map cnst2idx_; //!< Conversely map constraint to index