Giter VIP home page Giter VIP logo

ammm's People

Contributors

adrianjimnzz avatar iencinas10 avatar

Watchers

 avatar

ammm's Issues

deberes

Deberes mi adri

  • Arreglar generacion de numeros aleatorios en grasp (mirar alphatuner o generator.cpp)
  • Arreglar pseudocodigo del report
  • Sacar resultados GRASP de nuevo porque no sacaba la optimo, regenerar los archivos de tiempo y puntos
  • Regenerar el results/grasp/clean, regenerar plots con los nuevos resultados de GRASP
  • Sacar tiempo de ejecución del ILP reducido, y hacer el archivo clean. Para añadirlo en el plot de "tiempo" y echarles la bronca

Deberes mi isna

  • Preparar entrega (archivos, ver que vamos a entrenar)
  • Instrucciones para reproducir resultados
    (?)
  • Hacer ILP que solo saque los dias de descanso?
  • Añadir instrucciones para tunear alpha

Cosas por hacer

Set de partidos posibles

Elegir un color fijo en vez de contemplar ambas posibilidades (x vs y), (y vs x).

Para quitarnos el problema de que 2 jugadores lleguen al ultimo dia teniendo que jugar entre si y ambos teniendo que jugar del mismo color

En teoría esto está, pero habría que hacer una función que haga un assert para comprobar que no falle nunca

hasRested

Arreglar, no se pone a true nunca. En teoria hecho¿?

Asegurar solucion

Antes de añadir un partido tenemos que asegurarnos que todos los jugadores que están pendientes de jugar en esta ronda (sí o sí, porque ya han descansado) pueden seguir jugando aunque metamos este partido

Es decir:

Si estamos considerando meter 1 vs 3, pero:

el jugador 2 ha descansado y tiene que jugar obligatoriamente con 1 o con 3, NO podemos meter este partido.

Por eso, haríamos algo así:

Game game_to_add = ...;

uint64_t possible_games = 0;
for(const Player &p: players_that_have_to_play) {
    
   games_for_p = subset_p_plays(games);
   for(const Game &g : games_for_p) {
       
       if(g.doesnt_contain(game_to_add.white) && g.doesnt_contain(game_to_add.black))
          possible_games++;
   }

}

if(possible_games == 0)
    infeasable = true;

Tunear alpha

GRASP ESTÁ MAL

image

PARA PROBAR COMPILA CON -O3 Y -DNDEBUG, MUCHO MAS RAPIDO

Alpha tiene que ser entre 0 y 1. Para tunearlo, habría que hacer:

El "step" de alpha tiene que ser >= 1 / NUM_PLAYERS!!

Por ejemplo, si tenemos 5 jugadores: un alpha de 0.1 NO es distinto que un alpha de 0, porque siempre cogeremos la mejor opción del greedy. Un alpha de 0.2 = 1 / 5 SÍ cambia, porque podríamos coger la mejor opción del greedy o la segunda mejor opción (elementos 0 y 1 en el vector ordenado)

optimal_solutions = {....} // https://github.com/IEncinas10/AMMM/blob/master/results/ilp/clean


best_alpha = -1;
best_alpha_error = +INF;

for(alpha : alphas) {
  solutions_alpha = [] // 1 solution per instance
  errors_alpha = [] // 1 error per solution
  for(instance : instances) {
    solu = solve(instance, alpha)
    solutions_alpha.push_back(solu)
    errors_alpha.push_back(optimal - solu)
  }
  
  curr_alpha_error = arithmetic_mean(errors_alpha)
  if(curr_alpha_error < best_alpha_error) {
     best_alpha = alpha;
     best_alpha_error = curr_alpha_error;
  }
  
  
}

Las soluciones optimas están en el archivo results/ilp/clean

Sacar resultados

Ejemplo de forma facil:

for i in `seq 3 2 31`; do echo $i; oplrun clean.mod ../instances/project.$i.dat > ../results/ilp/"$i"_clean; done

for i in `seq 3 2 31`; do echo $i; oplrun redundant.mod ../instances/project.$i.dat > ../results/ilp/"$i"_redundant; done

for i in `seq 3 2 31`; do echo $i, $(grep "Total" "$i"_clean | awk -F '[=s]' '{print $2}'), $(grep "OBJECTIVE:" "$i"_clean | awk -F '[:]' '{print $2}')>> clean; done;


for i in `seq 3 2 31`; do echo $i, $(grep "Total" "$i"_redundant | awk -F '[=s]' '{print $2}'), $(grep "OBJECTIVE:" "$i"_redundant | awk -F '[:]' '{print $2}') >> redundant; done;

GREEDY/LOCAL SEARCH/GRASP - COMPILAR CON -DNDEBUG Y -O3!!!!!!!

local search
for i in `seq 3 2 31`; do echo $i; ./a.out ../instances/project.$i.dat > ../results/ls/"$i"; done

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.