1 /* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #ifndef SIMGRID_KERNEL_PROFILE_STOCHASTICDATEDVALUE
7 #define SIMGRID_KERNEL_PROFILE_STOCHASTICDATEDVALUE
9 #include "simgrid/forward.h"
10 #include "src/kernel/resource/profile/DatedValue.hpp"
17 enum Distribution { Dist_Exp, Dist_Norm, Dist_Unif, Dist_Det };
19 class XBT_PUBLIC StochasticDatedValue {
21 Distribution date_law;
22 std::vector<double> date_params;
23 Distribution value_law;
24 std::vector<double> value_params;
25 DatedValue get_datedvalue();
28 explicit StochasticDatedValue() = default;
29 explicit StochasticDatedValue(double d, double v)
30 : date_law(Dist_Det), date_params({d}), value_law(Dist_Det), value_params({v})
33 explicit StochasticDatedValue(Distribution dl, std::vector<double> dp, Distribution vl, std::vector<double> vp)
34 : date_law(dl), date_params(dp), value_law(vl), value_params(vp)
37 bool operator==(StochasticDatedValue const& e2) const;
40 double draw(Distribution law, std::vector<double> params);
43 std::ostream& operator<<(std::ostream& out, const StochasticDatedValue& e);
45 } // namespace profile
47 } // namespace simgrid