Created
March 8, 2012 12:03
-
-
Save fern4lvarez/2000718 to your computer and use it in GitHub Desktop.
Puntuación película por Género-Género.Media
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Método con todos los géneros | |
@Override | |
public double getPuntuacion(PeliGeneros p){ | |
double punt=1; | |
Generos[] arrGeneros=Generos.values(); | |
int numGeneros=arrGeneros.length; | |
double cantidadGenero=0; | |
for (int i=0; i<numGeneros; i++){ | |
cantidadGenero=cantidadGenero+(valorGenero.get(Generos.getGenero(i))); | |
} | |
double aux=0; | |
double cantidadGeneroPeli; | |
double cantidadGeneroUser; | |
for (int i=0; i<numGeneros; i++){ | |
cantidadGeneroPeli=p.getCantidadGenero(Generos.getGenero(i))/100; | |
cantidadGeneroUser=valorGenero.get(Generos.getGenero(i))/cantidadGenero; | |
aux=aux+Math.abs(cantidadGeneroUser - cantidadGeneroPeli); | |
} | |
double media=aux/numGeneros; | |
punt=punt-media; | |
return punt; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment