This file contains hidden or 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
| PeliGeneros p; | |
| int numGen=p.getCantidadGeneros(); | |
| Generos g; | |
| for (int i=0; i<numGen; i++){ | |
| g=p.getGenero(i); | |
| art=art+p.getCantidadGenero(g)*tabla.getValorTabla(g, Temperamento.Artesano); | |
| ide=ide+p.getCantidadGenero(g)*tabla.getValorTabla(g, Temperamento.Idealista); | |
| gua=gua+p.getCantidadGenero(g)*tabla.getValorTabla(g, Temperamento.Guardian); | |
| rac=rac+p.getCantidadGenero(g)*tabla.getValorTabla(g, Temperamento.Racional); | |
| } |
This file contains hidden or 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))); | |
| } |
This file contains hidden or 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
| private void iniciaUsuario(Usuario u){ | |
| valorGenero= new Hashtable<Generos, Double>(); | |
| double artesano=u.getPorcentajeArtesano(); | |
| double guardian=u.getPorcentajeGuardian(); | |
| double idealista=u.getPorcentajeIdealista(); | |
| double racional=u.getPorcentajeRacional(); | |
| Generos[] arrGeneros=Generos.values(); | |
| for (int i=0; i<arrGeneros.length; i++){ | |
| double resul=artesano*tabla.getValorTabla(arrGeneros[i], Temperamento.Artesano)+ | |
| guardian*tabla.getValorTabla(arrGeneros[i], Temperamento.Guardian)+ |
This file contains hidden or 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; |
This file contains hidden or 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 TablaGeneroTemperamento3(){ | |
| tabla=new Hashtable<String, PorcentajeTemperamento[]>(); | |
| meteGenero(Generos.Accion,0.1878,0.0743,0.0540,0.0202); | |
| meteGenero(Generos.Animacion,0.1266,0.0411,0.1028,0.1012); | |
| meteGenero(Generos.Aventuras,0.2086,0.0583,0.0831,0.0488); | |
| meteGenero(Generos.Comedia,0.0826,0.09,0.1184,0.0707); | |
| meteGenero(Generos.Documental,0.0203,0.1509,0.0717,0.1710); | |
| meteGenero(Generos.Drama,0.0191,0.1520,0.1309,0.099); | |
| meteGenero(Generos.Fantasia,0.12,0.0816,0.0982,0.0668); | |
| meteGenero(Generos.Romantica,0.0348,0.0972,0.1870,0.0636); |
This file contains hidden or 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
| # | |
| # This class represents a sequence of numbers characterized by the three | |
| # parameters from, to, and by. The numbers x in the sequence obey the | |
| # following two constraints: | |
| # | |
| # from <= x <= to | |
| # x = from + n*by, where n is an integer | |
| # | |
| class Sequence | |
| # This is an enumerable class; it defines an each iterator below. |
NewerOlder