#include "persons.h"
#include "catalog.h"
#include "stage.h"
#include "gclist.h"
#include <iostream>
#include <list>
#include <string>
#include <vector>

int main(){
    int i=0;
    CyclistCatalog cc;
    Stage s1(3);  
    Stage s2(1);
    cc.Load ("/home/yulalo/Escritorio/CARRERA/poo/p5/data/cyclists.csv");
    std::vector<Cyclist> cVect =cc.Data();
    GCList gc(cc);

    s1.Simulate(cVect);
    std::map <std::string, int> delay=s1.GetDelays();
    std::cout << "PRIMERA ETAPA FINALIZADA" << std::endl;
    std::cout << "Resultados: " << std::endl;
    for (auto &a : delay){
        std::cout << cVect[i].GetName() << " | " << a.first << " | " << a.second << "\n" <<std::endl;
        i++;
    }
    gc.ApplyStage(s1);
    std::cout << "" << std::endl;

    i=0;
    s2.Simulate(cVect);
    delay=s2.GetDelays();
    std::cout << "SEGUNDA ETAPA FINALIZADA" << std::endl;
    std::cout << "Resultados: " << std::endl;
    for (auto &a : delay){
        std::cout << cVect[i].GetName() << " | " << a.first << " | " << a.second << "\n" <<std::endl;
        i++;
    }
    gc.ApplyStage(s2);
    std::cout << "" << std::endl;

    std::cout << "-TOP 10 MEJORES MARCAS:" << std::endl;
    std::cout << gc.GetClassification(10) << std::endl;   
}