Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Comply with clang-format rules
[simgrid.git] / src / kernel / resource / profile / DatedValue.hpp
1 /* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved.          */
2
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. */
5
6 #include <iostream>
7
8 namespace simgrid {
9 namespace kernel {
10 namespace profile {
11
12 /** @brief Modeling of the availability profile (due to an external load) or the churn
13  *
14  * There is 4 main concepts in this module:
15  * - #simgrid::kernel::profile::DatedValue: a pair <timestamp, value> (both are of type double)
16  * - #simgrid::kernel::profile::Profile: a list of dated values
17  * - #simgrid::kernel::profile::Event: links a given trace to a given SimGrid resource.
18  *   A Cpu for example has 2 kinds of events: state (ie, is it ON/OFF) and speed,
19  *   while a link has 3 iterators: state, bandwidth and latency.
20  * - #simgrid::kernel::profile::FutureEvtSet: makes it easy to find the next occuring event of all profiles
21  */
22 class XBT_PUBLIC DatedValue {
23 public:
24   double date_          = 0;
25   double value_         = 0;
26   explicit DatedValue() = default;
27   explicit DatedValue(double d, double v) : date_(d), value_(v) {}
28   bool operator==(DatedValue const& e2) const;
29   bool operator!=(DatedValue const& e2) const { return not(*this == e2); }
30 };
31 std::ostream& operator<<(std::ostream& out, const DatedValue& e);
32
33 } // namespace profile
34 } // namespace kernel
35 } // namespace simgrid