Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Prefer enum class over legacy enum.
[simgrid.git] / src / kernel / resource / profile / StochasticDatedValue.cpp
index b044334..0695de3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2020. 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. */
@@ -15,13 +15,13 @@ namespace profile {
 double StochasticDatedValue::draw(Distribution law, std::vector<double> params)
 {
   switch (law) {
-    case Dist_Det:
+    case Distribution::DET:
       return params[0];
-    case Dist_Exp:
+    case Distribution::EXP:
       return simgrid::xbt::random::exponential(params[0]);
-    case Dist_Unif:
+    case Distribution::UNIF:
       return simgrid::xbt::random::uniform_real(params[0], params[1]);
-    case Dist_Norm:
+    case Distribution::NORM:
       return simgrid::xbt::random::normal(params[0], params[1]);
     default:
       xbt_assert(false, "Unimplemented distribution");
@@ -50,26 +50,6 @@ bool StochasticDatedValue::operator==(StochasticDatedValue const& e2) const
          (e2.date_params == date_params);
 }
 
-std::ostream& operator<<(std::ostream& out, const StochasticDatedValue& e)
-{
-  out << e.date_law << " (";
-  for (unsigned int i = 0; i < e.date_params.size(); i++) {
-    out << e.date_params[i];
-    if (i != e.date_params.size() - 1) {
-      out << ",";
-    }
-  }
-  out << ") " << e.value_law << " (";
-  for (unsigned int i = 0; i < e.value_params.size(); i++) {
-    out << e.value_params[i];
-    if (i != e.value_params.size() - 1) {
-      out << ",";
-    }
-  }
-  out << ")";
-  return out;
-}
-
 } // namespace profile
 } // namespace kernel
 } // namespace simgrid