Cleaned retrospective learning

This commit is contained in:
Matúš Púll 2024-11-03 14:36:46 +01:00
parent de5b6f183a
commit f009a278ea

View file

@ -135,18 +135,10 @@ public:
}
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;
// A bit of cleaning
auto cleaned = clean({p_guess, p_response});
auto cleaned = clean(hist);
vector<int> guess = cleaned.guess;
vector<int> response = cleaned.response;
@ -165,15 +157,20 @@ public:
// At least only on the right spot
else if(response[0] == 0) {
if_not_here_then_nowhere(guess);
// TODO maybe I can guess which one is right
something_to_learn = true;
}
// TODO nonzero / nonzero
// Nonzero / nonzero
else {
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
for(int i = 0; i < history.size(); i++)
if(!learn_back(history[i])) {