Examples of Deal


Examples of org.gnubridge.core.Deal

  }

  public void testShortCircuitIfRootOnlyHasOneValidMove() {

    Deal game = new Deal(NoTrump.i());
    game.getPlayer(Direction.WEST_DEPRECATED).init(new Card[] { Ace.of(Spades.i()), Nine.of(Spades.i()) });
    game.getPlayer(Direction.NORTH_DEPRECATED).init(new Card[] { Six.of(Spades.i()), Four.of(Hearts.i()) });
    game.getPlayer(Direction.EAST_DEPRECATED).init(new Card[] { Ten.of(Hearts.i()), Three.of(Hearts.i()) });
    game.getPlayer(Direction.SOUTH_DEPRECATED).init(new Card[] { Six.of(Hearts.i()), Two.of(Hearts.i()) });

    game.setNextToPlay(Direction.WEST_DEPRECATED);
    game.play(Ace.of(Spades.i()));
    DoubleDummySolver pruned = new DoubleDummySolver(game.duplicate());
    pruned.setTerminateIfRootOnlyHasOneValidMove(true);
    pruned.search();
    assertEquals(1, pruned.getPositionsExamined());

  }
View Full Code Here

Examples of org.gnubridge.core.Deal

  }

  public void testIfAllMovesTheSameChooseLowestValueCard() {

    Deal game = new Deal(NoTrump.i());
    game.getPlayer(Direction.WEST_DEPRECATED).init(new Card[] { Ace.of(Spades.i()), Queen.of(Spades.i()) });
    game.getPlayer(Direction.NORTH_DEPRECATED).init(new Card[] { Six.of(Spades.i()), Four.of(Spades.i()) });
    game.getPlayer(Direction.EAST_DEPRECATED).init(new Card[] { Ten.of(Hearts.i()), Three.of(Hearts.i()) });
    game.getPlayer(Direction.SOUTH_DEPRECATED).init(new Card[] { Six.of(Hearts.i()), Two.of(Hearts.i()) });

    game.setNextToPlay(Direction.WEST_DEPRECATED);
    DoubleDummySolver pruned = new DoubleDummySolver(game.duplicate());
    //  pruned.useAlphaBetaPruning(false);
    pruned.search();
    assertEquals(Queen.of(Spades.i()), pruned.getRoot().getBestMove().getCardPlayed());

    Deal gameWithCardsFlipped = new Deal(NoTrump.i());
    gameWithCardsFlipped.getPlayer(Direction.WEST_DEPRECATED).init(
        new Card[] { Queen.of(Spades.i()), Ace.of(Spades.i()) });
    gameWithCardsFlipped.getPlayer(Direction.NORTH_DEPRECATED).init(
        new Card[] { Six.of(Spades.i()), Four.of(Spades.i()) });
    gameWithCardsFlipped.getPlayer(Direction.EAST_DEPRECATED).init(
        new Card[] { Ten.of(Hearts.i()), Three.of(Hearts.i()) });
    gameWithCardsFlipped.getPlayer(Direction.SOUTH_DEPRECATED).init(
        new Card[] { Six.of(Hearts.i()), Two.of(Hearts.i()) });

    gameWithCardsFlipped.setNextToPlay(Direction.WEST_DEPRECATED);
    DoubleDummySolver triangulate = new DoubleDummySolver(gameWithCardsFlipped.duplicate());

    //  triangulate.useAlphaBetaPruning(false);
    triangulate.search();
    assertEquals(Queen.of(Spades.i()), triangulate.getRoot().getBestMove().getCardPlayed());
View Full Code Here

Examples of org.switchyard.quickstarts.demo.txpropagation.Deal

        car.setPrice(500.00);
        Offer offer = new Offer();
        offer.setCar(car);
        offer.setAmount(100.00);

        Deal deal = service.operation("offer").sendInOut(offer).getContent(Deal.class);

        // verify the deal is rejected
        Assert.assertFalse(deal.isAccepted());
    }
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.