A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
python: First working example
[simgrid.git]
/
src
/
kernel
/
resource
/
Resource.cpp
diff --git
a/src/kernel/resource/Resource.cpp
b/src/kernel/resource/Resource.cpp
index
dc46230
..
816ae08
100644
(file)
--- a/
src/kernel/resource/Resource.cpp
+++ b/
src/kernel/resource/Resource.cpp
@@
-3,9
+3,10
@@
/* 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. */
/* 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. */
-#include "s
rc
/kernel/resource/Resource.hpp"
+#include "s
imgrid
/kernel/resource/Resource.hpp"
#include "src/kernel/lmm/maxmin.hpp" // Constraint
#include "src/surf/surf_interface.hpp"
#include "src/kernel/lmm/maxmin.hpp" // Constraint
#include "src/surf/surf_interface.hpp"
+#include "src/surf/trace_mgr.hpp"
namespace simgrid {
namespace kernel {
namespace simgrid {
namespace kernel {
@@
-18,41
+19,41
@@
Resource::Resource(Model* model, const std::string& name, lmm::Constraint* const
Resource::~Resource() = default;
Resource::~Resource() = default;
-bool Resource::is
O
n() const
+bool Resource::is
_o
n() const
{
{
- return is
O
n_;
+ return is
_o
n_;
}
}
-bool Resource::is
O
ff() const
+bool Resource::is
_o
ff() const
{
{
- return not is
O
n_;
+ return not is
_o
n_;
}
}
-void Resource::turn
O
n()
+void Resource::turn
_o
n()
{
{
- is
O
n_ = true;
+ is
_o
n_ = true;
}
}
-void Resource::turn
O
ff()
+void Resource::turn
_o
ff()
{
{
- is
O
n_ = false;
+ is
_o
n_ = false;
}
}
-double Resource::get
L
oad()
+double Resource::get
_l
oad()
{
return constraint_->get_usage();
}
{
return constraint_->get_usage();
}
-Model* Resource::model() const
+Model* Resource::
get_
model() const
{
return model_;
}
{
return model_;
}
-const std::string& Resource::get
N
ame() const
+const std::string& Resource::get
_n
ame() const
{
return name_;
}
{
return name_;
}
-const char* Resource::get
C
name() const
+const char* Resource::get
_c
name() const
{
return name_.c_str();
}
{
return name_.c_str();
}
@@
-62,9
+63,16
@@
bool Resource::operator==(const Resource& other) const
return name_ == other.name_;
}
return name_ == other.name_;
}
-kernel::lmm::Constraint* Resource::constraint() const
+void Resource::set_state_trace(tmgr_trace_t trace)
{
{
- return const_cast<kernel::lmm::Constraint*>(constraint_);
+ xbt_assert(state_event_ == nullptr, "Cannot set a second state trace to %s", get_cname());
+
+ state_event_ = future_evt_set.add_trace(trace, this);
+}
+
+kernel::lmm::Constraint* Resource::get_constraint() const
+{
+ return constraint_;
}
} // namespace resource
}
} // namespace resource