+System* System::build(const std::string& solver_name, bool selective_update)
+{
+ System* system = nullptr;
+ if (solver_name == "bmf") {
+#if SIMGRID_HAVE_EIGEN3
+ system = new lmm::BmfSystem(selective_update);
+#endif
+ } else if (solver_name == "fairbottleneck") {
+ system = new FairBottleneck(selective_update);
+ } else {
+ system = new System(selective_update);
+ }
+ return system;
+}
+
+void System::validate_solver(const std::string& solver_name)
+{
+ static const std::vector<std::string> opts{"bmf", "maxmin", "fairbottleneck"};
+ if (solver_name == "bmf") {
+#if !SIMGRID_HAVE_EIGEN3
+ xbt_die("Cannot use the BMF solver without installing Eigen3.");
+#endif
+ }
+ if (std::find(opts.begin(), opts.end(), solver_name) == std::end(opts)) {
+ xbt_die("Invalid system solver, it should be one of: \"maxmin\", \"fairbottleneck\" or \"bmf\"");
+ }
+}
+