Created
March 8, 2012 11:50
-
-
Save fern4lvarez/2000664 to your computer and use it in GitHub Desktop.
Puntuación película por Género-Temperamento (Mix)
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
public double getPuntuacion(PeliGeneros p){ | |
double artesano=u.getPorcentajeArtesano(); | |
double idealista=u.getPorcentajeIdealista(); | |
double guardian=u.getPorcentajeGuardian(); | |
double racional=u.getPorcentajeRacional(); | |
int total=p.getCantidadGeneros(); | |
double porcentaje=0; | |
double aux=0; | |
double acum=0; | |
Generos genero=Generos.Accion; | |
for (int i=0; i<total; i++){ | |
aux=0; | |
porcentaje=p.getPorcentaje(i); | |
genero=p.getGenero(i); | |
aux=artesano*tabla.getValorTabla(genero, Temperamento.Artesano); | |
aux=aux+idealista*tabla.getValorTabla(genero, Temperamento.Idealista); | |
aux=aux+guardian*tabla.getValorTabla(genero, Temperamento.Guardian); | |
aux=aux+racional*tabla.getValorTabla(genero, Temperamento.Racional); | |
acum=acum+porcentaje*aux; | |
} | |
aux=((acum-min)*100)/(max-min); | |
if (aux<0) return 0; | |
return aux; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment