![]() |
fpmas 1.6
|
#include <perf.h>
Public Member Functions | |
ProbeBehavior (api::utils::perf::Monitor &monitor, api::model::Behavior &behavior, std::string probe_name) | |
void | execute (api::model::Agent *agent) const override |
virtual void | execute (Agent *agent) const =0 |
An api::model::Behavior implementation that wraps an other api::model::Behavior in order to estimate its execution time.
The ProbeBehavior can be safely used instead of the probed behavior (assigning the ProbeBehavior to an AgentGroup instead of the original behavior for example) without altering the Model execution.
fpmas::utils::perf::ProbeBehavior::ProbeBehavior | ( | api::utils::perf::Monitor & | monitor, |
api::model::Behavior & | behavior, | ||
std::string | probe_name | ||
) |
ProbeBehavior constructor.
monitor | monitor to which execution times will be committed |
behavior | probed behavior |
probe_name | name of the probe that is used to commit measures to the monitor . This name is also used to retrieve values using Monitor.callCount() and Monitor.totalDuration(). |
|
overridevirtual |
Executes the probed behavior on agent
, probing and committing its execution time to the monitor
.
agent | agent on which the probed behavior is executed |
Implements fpmas::api::model::Behavior.