/* 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 "catch.hpp"
/* 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 "catch.hpp"
#include "src/kernel/resource/profile/StochasticDatedValue.hpp"
#include "src/surf/surf_interface.hpp"
#include "src/kernel/resource/profile/StochasticDatedValue.hpp"
#include "src/surf/surf_interface.hpp"
void apply_event(simgrid::kernel::profile::Event* event, double value) override
{
XBT_VERB("t=%.1f: Change value to %lg (idx: %u)", the_date, value, event->idx);
void apply_event(simgrid::kernel::profile::Event* event, double value) override
{
XBT_VERB("t=%.1f: Change value to %lg (idx: %u)", the_date, value, event->idx);
static std::vector<simgrid::kernel::profile::DatedValue> trace2vector(const char* str)
{
std::vector<simgrid::kernel::profile::DatedValue> res;
static std::vector<simgrid::kernel::profile::DatedValue> trace2vector(const char* str)
{
std::vector<simgrid::kernel::profile::DatedValue> res;
- simgrid::kernel::profile::Profile* trace = simgrid::kernel::profile::Profile::from_string("TheName", str, 0);
+ simgrid::kernel::profile::Profile* trace = simgrid::kernel::profile::ProfileBuilder::from_string("TheName", str, 0);
XBT_VERB("---------------------------------------------------------");
XBT_VERB("data>>\n%s<<data\n", str);
XBT_VERB("---------------------------------------------------------");
XBT_VERB("data>>\n%s<<data\n", str);
XBT_VERB("event: d:%lg v:%lg", evt.date_, evt.value_);
MockedResource daResource;
XBT_VERB("event: d:%lg v:%lg", evt.date_, evt.value_);
MockedResource daResource;
-static std::vector<simgrid::kernel::profile::StochasticDatedValue> trace2selist(const char* str)
-{
- const simgrid::kernel::profile::Profile* trace = simgrid::kernel::profile::Profile::from_string("TheName", str, 0);
- std::vector<simgrid::kernel::profile::StochasticDatedValue> stocevlist = trace->stochastic_event_list;
- tmgr_finalize();
- return stocevlist;
-}
-
TEST_CASE("kernel::profile: Resource profiles, defining the external load", "kernel::profile")
{
SECTION("No event, no loop")
TEST_CASE("kernel::profile: Resource profiles, defining the external load", "kernel::profile")
{
SECTION("No event, no loop")
want.emplace_back(Distribution::DET, std::vector<double>{0}, Distribution::UNIF, std::vector<double>{10, 20});
REQUIRE(want == got);
want.emplace_back(Distribution::DET, std::vector<double>{0}, Distribution::UNIF, std::vector<double>{10, 20});
REQUIRE(want == got);
want.emplace_back(Distribution::DET, std::vector<double>{0}, Distribution::DET, std::vector<double>{4});
want.emplace_back(Distribution::NORM, std::vector<double>{25, 10}, Distribution::DET, std::vector<double>{3});
want.emplace_back(Distribution::UNIF, std::vector<double>{10, 20}, Distribution::NORM, std::vector<double>{25, 10});
want.emplace_back(Distribution::DET, std::vector<double>{0}, Distribution::DET, std::vector<double>{4});
want.emplace_back(Distribution::NORM, std::vector<double>{25, 10}, Distribution::DET, std::vector<double>{3});
want.emplace_back(Distribution::UNIF, std::vector<double>{10, 20}, Distribution::NORM, std::vector<double>{25, 10});