4 #include "clave_fija.h"
6 #include "keymanager.h"
8 int main (int argc, char *argv[])
10 int bloque, altas, bajas;
13 printf ("Uso : %s <block size> <cantidad de altas> <cantidad de bajas>\n", argv[0]);
17 bloque = atoi (argv[1]);
18 altas = atoi (argv[2]);
19 bajas = atoi (argv[3]);
21 KeyManager<std::string> km;
22 BTree tree ("test.idx", bloque, BTree::KEY_VARIABLE);
24 std::list<std::string> lst;
25 std::list<std::string>::iterator it;
27 Random::Strings (lst, altas);
29 double paltas = bajas / (double)(altas + bajas);
32 while (it != lst.end ()) {
35 double l = Random::Double (0.0f, 1.0f);
36 std::cout << l << " >= " << paltas << std::endl;
39 std::cout << "Clave Agregada " << sss << std::endl;
44 /* Tengo que borrar una clave entre 0 e "i" de la lista
45 * porque son las que ya agregue. */
46 ClaveVariable c(km.GetRandom ());
50 std::cout << "Clave Borrada " << sss << std::endl;
56 std::list <std::string> l = km.GetList ();
60 while (it != l.end ()) {
66 std::cout << "** Clave " << (*it) << " encontrada.\n";
70 std::cout << "** Clave " << (*it) << " NO encontrada.\n";
76 std::cout << "\n\n === Resultados ===\n";
77 std::cout << " Hist : " << bien << "\n";
78 std::cout << " Miss : " << mal << "\n";
79 std::cout << " Total : " << (bien+mal) << "\n";