Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use xbt_die instead of xbt_assert(false).
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 28 Oct 2020 17:03:57 +0000 (18:03 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 28 Oct 2020 17:03:57 +0000 (18:03 +0100)
src/kernel/resource/profile/Profile.cpp
src/kernel/resource/profile/StochasticDatedValue.cpp

index f83e605..9a85416 100644 (file)
@@ -146,8 +146,7 @@ Profile* Profile::from_string(const std::string& name, const std::string& input,
         stochevent.date_law = Distribution::UNIF;
         i                   = 3;
       } else {
-        xbt_assert(false, "Unknown law %s", splittedval[0].c_str());
-        i = 0;
+        xbt_die("Unknown law %s", splittedval[0].c_str());
       }
 
       xbt_assert(splittedval.size() > i, "Invalid profile line");
@@ -171,8 +170,7 @@ Profile* Profile::from_string(const std::string& name, const std::string& input,
         stochevent.value_law = Distribution::UNIF;
         j                    = 2;
       } else {
-        xbt_assert(false, "Unknown law %s", splittedval[i].c_str());
-        j = 0;
+        xbt_die("Unknown law %s", splittedval[i].c_str());
       }
 
       xbt_assert(splittedval.size() > i + j, "Invalid profile line");
index 0695de3..6830b75 100644 (file)
@@ -24,8 +24,7 @@ double StochasticDatedValue::draw(Distribution law, std::vector<double> params)
     case Distribution::NORM:
       return simgrid::xbt::random::normal(params[0], params[1]);
     default:
-      xbt_assert(false, "Unimplemented distribution");
-      return 0;
+      xbt_die("Unimplemented distribution");
   }
 }
 double StochasticDatedValue::get_value()