TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
knowledge_base.hpp File Reference

Persistent knowledge base (design doc 06 §4, failure-memory tier T3): what was learned on earlier runs. More...

#include <cstdint>
#include <memory>
#include <string>
#include <vector>
#include "model/board.hpp"

Go to the source code of this file.

Classes

struct  tmk::learn::BoardFeatures
struct  tmk::learn::FailedConnection
class  tmk::learn::KnowledgeBase

Namespaces

namespace  tmk
namespace  tmk::learn

Functions

BoardFeatures tmk::learn::features_of (const model::Board &b, const std::string &file_text, int connections)

Detailed Description

Persistent knowledge base (design doc 06 §4, failure-memory tier T3): what was learned on earlier runs.

  • per board-feature bucket: how often each router variant was run and how often it produced the best result (Thompson-sampling bandit over portfolio variants);
  • per board (content hash): connections that failed before, so a re-run routes them first.

SQLite file, default ~/.local/share/tracemaker/kb.sqlite. Every call is best-effort: a missing or locked database never stops routing.

Definition in file knowledge_base.hpp.