Cleaned retrospective learning
This commit is contained in:
parent
de5b6f183a
commit
f009a278ea
1 changed files with 9 additions and 12 deletions
19
solver.hpp
19
solver.hpp
|
@ -135,18 +135,10 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
bool learn_back(Historic_guess hist) {
|
bool learn_back(Historic_guess hist) {
|
||||||
bool something_to_learn = true;
|
|
||||||
|
|
||||||
hist = clean(hist);
|
|
||||||
// TODO Actually learn
|
|
||||||
|
|
||||||
return something_to_learn;
|
|
||||||
}
|
|
||||||
void learn(vector<int> p_guess, vector<int> p_response) {
|
|
||||||
bool something_to_learn;
|
bool something_to_learn;
|
||||||
|
|
||||||
// A bit of cleaning
|
// A bit of cleaning
|
||||||
auto cleaned = clean({p_guess, p_response});
|
auto cleaned = clean(hist);
|
||||||
vector<int> guess = cleaned.guess;
|
vector<int> guess = cleaned.guess;
|
||||||
vector<int> response = cleaned.response;
|
vector<int> response = cleaned.response;
|
||||||
|
|
||||||
|
@ -165,15 +157,20 @@ public:
|
||||||
// At least only on the right spot
|
// At least only on the right spot
|
||||||
else if(response[0] == 0) {
|
else if(response[0] == 0) {
|
||||||
if_not_here_then_nowhere(guess);
|
if_not_here_then_nowhere(guess);
|
||||||
// TODO maybe I can guess which one is right
|
|
||||||
something_to_learn = true;
|
something_to_learn = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO nonzero / nonzero
|
// Nonzero / nonzero
|
||||||
else {
|
else {
|
||||||
something_to_learn = true;
|
something_to_learn = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return something_to_learn;
|
||||||
|
}
|
||||||
|
void learn(vector<int> p_guess, vector<int> p_response) {
|
||||||
|
// Learn something new
|
||||||
|
bool something_to_learn = learn_back({p_guess, p_response});
|
||||||
|
|
||||||
// Learn from previous guesses
|
// Learn from previous guesses
|
||||||
for(int i = 0; i < history.size(); i++)
|
for(int i = 0; i < history.size(); i++)
|
||||||
if(!learn_back(history[i])) {
|
if(!learn_back(history[i])) {
|
||||||
|
|
Loading…
Reference in a new issue