Examples of Casella


Examples of prop.hex.domini.models.Casella

   */
  public Casella obteMoviment( EstatCasella fitxa )
  {
    if ( partida.getTornsJugats() <= 1 )
    {
      Casella obertura = obertura();
      if ( obertura != null )
      {
        return obertura;
      }
    }

    //Cridem al minimax.
    int[] casella = super.minimax( partida, fitxa, profunditat_maxima );

    //Retornem la casella.
    if ( casella != null )
    {
      return new Casella( casella[0], casella[1] );
    }
    else
    {
      return null;
    }
View Full Code Here

Examples of prop.hex.domini.models.Casella

    for ( int fila = 0; fila < tauler.getMida(); fila++ )
    {
      for ( int columna = 0; columna < tauler.getMida(); columna++ )
      {
        Casella casella = new Casella( fila, columna );

        if ( tauler.esMovimentValid( fitxa_jugador, casella ) )
        {
          int potencial_moviment = potencials[fila][columna];
          if ( potencial_moviment == 0 )
View Full Code Here

Examples of prop.hex.domini.models.Casella

    ResistenciaCasella resistencia_actual;

    while ( moviments.hasNext() &&
            ( resistencia_actual = moviments.next() ).getResistencia() <= resistencia_minima + 2 )
    {
      Casella actual = resistencia_actual.getCasella();
      tauler.mouFitxa( contrincant, actual );
      estat_iteracio = partida.comprovaEstatPartida( actual.getFila(), actual.getColumna() );
      puntuacio = -sexSearch( contrincant, jugador, -beta_2, -alfa, profunditat + 1,
          cost + resistencia_actual.getResistencia(), estat_iteracio );

      if ( alfa < puntuacio && puntuacio < beta && !primer_fill )
      {
View Full Code Here

Examples of prop.hex.domini.models.Casella

   */
  public Casella obteMoviment( EstatCasella fitxa )
  {
    if ( partida.getTornsJugats() <= 1 )
    {
      Casella obertura = obertura();
      if ( obertura != null )
      {
        return obertura;
      }
    }

    tauler = partida.getTauler();

    int puntuacio_millor = Integer.MIN_VALUE + 1;

    Set<ResistenciaCasella> moviments_ordenats = movimentsOrdenats( fitxa );
    ArrayList<Casella> millors_moviments = new ArrayList<Casella>();

    if ( tauler.getTotalFitxes() % ( ( int ) ( 1.3 * tauler.getMida() ) ) == 0 && partida.getTornsJugats() != 0 )
    {
      profunditat_maxima++;
    }

    int resistencia_minima = moviments_ordenats.iterator().next().getResistencia();
    for ( ResistenciaCasella resistencia_actual : moviments_ordenats )
    {
      Casella actual = resistencia_actual.getCasella();
      tauler.mouFitxa( fitxa, actual );
      pressupost = Math.max( pressupost_defecte, resistencia_actual.getResistencia() + 1 );
      if ( partida.getTornsJugats() < 3 )
      {
        profunditat_maxima = 2;
      }
      else if ( resistencia_actual.getResistencia() >= resistencia_minima + 3 )
      {
        profunditat_maxima = 2;
      }
      else
      {
        profunditat_maxima = profunditat_defecte;
      }

      int puntuacio_actual =
          sexSearch( fitxa, fitxaContraria( fitxa ), Integer.MIN_VALUE + 1, Integer.MAX_VALUE - 1, 1,
              resistencia_actual.getResistencia(),
              partida.comprovaEstatPartida( actual.getFila(), actual.getColumna() ) );

      tauler.treuFitxa( actual );

      if ( puntuacio_actual > puntuacio_millor )
      {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.