Commit c5360099 authored by Yuqi Zhang's avatar Yuqi Zhang
Browse files

add update-dominant pattern for list op-gen

parent 2263fde4
......@@ -7,7 +7,6 @@
#include "../exp_runner.h"
#include "list_generator.h"
// TODO to be decided
exp_setting::default_setting list_exp::list_setting{
.total_sec = 2000,
.delay = 50,
......
......@@ -21,7 +21,7 @@ public:
// ! List types: "r", "rwf"
add_type("r");
add_type("rwf");
// TODO add_pattern("???");
add_pattern("upddominant");
}
};
......
......@@ -13,9 +13,9 @@ constexpr int MAX_COLOR = 1u << 25u;
list_generator::list_op_gen_pattern &list_generator::get_pattern(const string &name)
{
// TODO patterns?
static map<string, list_op_gen_pattern> patterns{
{"default", {.PR_ADD = 0.41, .PR_UPD = 0.2, .PR_REM = 0.39}}};
{"default", {.PR_ADD = 0.41, .PR_UPD = 0.2, .PR_REM = 0.39}},
{"upddominant", {.PR_ADD = 0.11, .PR_UPD = 0.8, .PR_REM = 0.09}}};
if (patterns.find(name) == patterns.end()) return patterns["default"];
return patterns[name];
}
......
......@@ -320,6 +320,13 @@ protected:
inline void exp_impl(const string &type) { exp_impl(type, "default"); }
public:
void test_patterns()
{
for (auto &p : rdt_patterns)
for (auto &t : rdt_types)
pattern_fix(p, t);
}
void test_delay(int round)
{
for (int delay = rdt_exp_setting.delay_e.start; delay <= rdt_exp_setting.delay_e.end;
......@@ -387,9 +394,7 @@ public:
{
auto start = chrono::steady_clock::now();
for (auto &p : rdt_patterns)
for (auto &t : rdt_types)
pattern_fix(p, t);
test_patterns();
for (int i = 0; i < rounds; i++)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment