Skip to content
Snippets Groups Projects
Commit 81dc6208 authored by Franck Dary's avatar Franck Dary
Browse files

Added systematic backtrack

parent 535710e6
Branches
No related tags found
No related merge requests found
......@@ -95,10 +95,16 @@ void Oracle::createDatabase()
})));
str2oracle.emplace("error_tagger", std::unique_ptr<Oracle>(new Oracle(
[](Oracle *)
[](Oracle * oracle)
{
File file(oracle->filename, "r");
FILE * fd = file.getDescriptor();
char b1[1024];
while (fscanf(fd, "%[^\n]\n", b1) == 1)
oracle->data[b1] = b1;
},
[](Config & c, Oracle *)
[](Config & c, Oracle * oracle)
{
if (c.getCurrentStateHistory().size() >= 2 && (c.getCurrentStateHistory().top() == "BACK" || c.getCurrentStateHistory().getElem(1) == "BACK"))
return std::string("EPSILON");
......@@ -109,7 +115,8 @@ void Oracle::createDatabase()
if (c.hashHistory.contains(c.computeHash()))
return std::string("EPSILON");
//return std::string("BACK 1");
if (oracle->data.count("systematic"))
return std::string("BACK 1");
auto & pos = c.getTape("POS");
......@@ -133,10 +140,16 @@ void Oracle::createDatabase()
})));
str2oracle.emplace("error_morpho", std::unique_ptr<Oracle>(new Oracle(
[](Oracle *)
[](Oracle * oracle)
{
File file(oracle->filename, "r");
FILE * fd = file.getDescriptor();
char b1[1024];
while (fscanf(fd, "%[^\n]\n", b1) == 1)
oracle->data[b1] = b1;
},
[](Config & c, Oracle *)
[](Config & c, Oracle * oracle)
{
if (c.getCurrentStateHistory().size() >= 2 && (c.getCurrentStateHistory().top() == "BACK" || c.getCurrentStateHistory().getElem(1) == "BACK"))
return std::string("EPSILON");
......@@ -147,7 +160,8 @@ void Oracle::createDatabase()
if (c.hashHistory.contains(c.computeHash()))
return std::string("EPSILON");
//return std::string("BACK 1");
if (oracle->data.count("systematic"))
return std::string("BACK 1");
auto & morpho = c.getTape("MORPHO");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment