Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into xbt_random
[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 #ifndef SIMGRID_KERNEL_PROFILE_DATEDVALUE
7 #define SIMGRID_KERNEL_PROFILE_DATEDVALUE
8
9 #include "simgrid/forward.h"
10 #include <iostream>
11
12 namespace simgrid {
13 namespace kernel {
14 namespace profile {
15
16 /** @brief Modeling of the availability profile (due to an external load) or the churn
17  *
18  * There is 4 main concepts in this module:
19  * - #simgrid::kernel::profile::DatedValue: a pair <timestamp, value> (both are of type double)
20  * - #simgrid::kernel::profile::Profile: a list of dated values
21  * - #simgrid::kernel::profile::Event: links a given trace to a given SimGrid resource.
22  *   A Cpu for example has 2 kinds of events: state (ie, is it ON/OFF) and speed,
23  *   while a link has 3 iterators: state, bandwidth and latency.
24  * - #simgrid::kernel::profile::FutureEvtSet: makes it easy to find the next occurring event of all profiles
25  */
26 class XBT_PUBLIC DatedValue {
27 public:
28   double date_          = 0;
29   double value_         = 0;
30   explicit DatedValue() = default;
31   explicit DatedValue(double d, double v) : date_(d), value_(v) {}
32   bool operator==(DatedValue const& e2) const;
33   bool operator!=(DatedValue const& e2) const { return not(*this == e2); }
34 };
35 std::ostream& operator<<(std::ostream& out, const DatedValue& e);
36
37 } // namespace profile
38 } // namespace kernel
39 } // namespace simgrid
40
41 #endif