Examples of Deal


Examples of de.olivergierke.whoops.core.Deal

  @Autowired DealProcessor processor;

  @Test
  public void processesEquities() {

    Deal deal = new Deal(new Equity("Deutsche Bank"));

    Result result = processor.process(deal);
    assertThat(result.getFee(), is(new BigDecimal(10.5)));
  }
View Full Code Here

Examples of de.olivergierke.whoops.core.Deal

  }

  @Test(expected = UnsupportedInstrumentException.class)
  public void handlesUnsupportedInstrument() {

    Deal deal = new Deal(new UnsupportedInstrument());
    Result result = processor.process(deal);

    assertThat(result.getFee(), is(new BigDecimal(0.0)));
  }
View Full Code Here

Examples of de.olivergierke.whoops.core.Deal

  @Autowired DealProcessor processor;

  @Test
  public void processesEquities() {

    Deal deal = new Deal(new Equity("Deutsche Bank"));

    Result result = processor.process(deal);
    assertThat(result.getFee(), is(new BigDecimal(10.5)));
  }
View Full Code Here

Examples of de.olivergierke.whoops.core.Deal

  }

  @Test(expected = UnsupportedInstrumentException.class)
  public void handlesUnsupportedInstrument() {

    Deal deal = new Deal(new UnsupportedInstrument());
    processor.process(deal);
  }
View Full Code Here

Examples of de.olivergierke.whoops.core.Deal

  }

  @Test
  public void vmWareEquitiesIsFree() {

    Deal deal = new Deal(new Equity("VMware"));
    Result result = processor.process(deal);

    assertThat(result.getFee(), is(BigDecimal.ZERO));
  }
View Full Code Here

Examples of jc.pbntools.Deal

    for (int iDeal=1; iDeal<=m_cDeals; iDeal++) {
      if (Thread.interrupted()) {
        println(PbnTools.getStr("msg.interrupted"));
        break;
      }
      Deal ad[] = readDeals(getLocalLinkForDeal(iDeal), false);
      if (ad != null) {
        for (Deal d: ad) {
          d.setIdentField("Event", m_sTitle);
          deals.add(d);
        }
View Full Code Here

Examples of org.gnubridge.core.Deal

  }

  // this pruning disabled for now
  public void _testOnlyExpandFirstCardInSequenceCardTwoPlayedBetweenTwoUnplayedCards() {
    Node node = new Node(null);
    Deal game = new Deal(NoTrump.i());
    game.getPlayer(Direction.WEST_DEPRECATED).init(new Hand("", "", "4,3,2", ""));
    game.getPlayer(Direction.NORTH_DEPRECATED).init(new Hand("K,10,3", "", "", ""));
    game.getPlayer(Direction.EAST_DEPRECATED).init(new Hand("A,J,2", "", "", ""));
    game.getPlayer(Direction.SOUTH_DEPRECATED).init(new Hand("Q", "3,2", "", ""));
    game.setNextToPlay(Direction.NORTH_DEPRECATED);
    game.play(King.of(Spades.i()));
    game.play(Two.of(Spades.i()));
    game.play(Queen.of(Spades.i()));
    game.play(Two.of(Diamonds.i())); //north takes trick
    game.play(Ten.of(Spades.i()));
    DoubleDummySolver s = new DoubleDummySolver(game);

    s.examinePosition(node);
    assertEquals(2, s.getStack().size());
    assertTrue(s.getStack().contains(node.children.get(0)));
View Full Code Here

Examples of org.gnubridge.core.Deal

    assertTrue(node.children.get(0).isPruned());
    assertTrue(node.children.get(0).isPlayedSequencePruned());
  }

  public void testWhenPruningPlayedSequenceDoNotConsiderCardsInCurrentTrickAsPlayed() {
    Deal game = new Deal(Spades.i());
    game.getWest().init(new Hand("", "A,Q", "", ""));
    game.getNorth().init(new Hand("", "K,J", "", ""));
    game.getEast().init(new Hand("", "3,2", "", ""));
    game.getSouth().init(new Hand("2", "4", "", ""));
    game.setNextToPlay(Direction.WEST_DEPRECATED);
    SolverConfigurator configurator = new SolverConfigurator();
    configurator.setUseAlphaBetaPruning(false);
    DoubleDummySolver search = new DoubleDummySolver(game, configurator);
    search.setUseDuplicateRemoval(false);
    search.search();
View Full Code Here

Examples of org.gnubridge.core.Deal

    assertEquals(1, search.getRoot().getTricksTaken(Player.WEST_EAST));
    assertEquals(Ace.of(Hearts.i()), search.getRoot().getBestMove().getCardPlayed());
  }

  public void testTricksTallyIsTrickLimit() {
    Deal game = new Deal(NoTrump.i());
    game.getPlayer(Direction.WEST_DEPRECATED).init(new String[] { "3", "A", "4" });
    game.getPlayer(Direction.NORTH_DEPRECATED).init(new String[] { "2", "9", "6" });
    game.getPlayer(Direction.SOUTH_DEPRECATED).init(new String[] { "10", "5", "J" });
    game.getPlayer(Direction.EAST_DEPRECATED).init(new String[] { "K", "7", "Q" });
    game.setNextToPlay(Direction.SOUTH_DEPRECATED);
    DoubleDummySolver s = new DoubleDummySolver(game);
    s.setMaxTricks(1);
    s.search();
    assertEquals(1, s.getRoot().getTricksTaken(Player.WEST_EAST) + s.getRoot().getTricksTaken(Player.NORTH_SOUTH));
  }
View Full Code Here

Examples of org.gnubridge.core.Deal

    assertEquals(1, s.getRoot().getTricksTaken(Player.WEST_EAST) + s.getRoot().getTricksTaken(Player.NORTH_SOUTH));
  }

  public void testExaminePositionInitsChildMove() {
    Node node = new Node(null);
    Deal game = new Deal(NoTrump.i());
    game.getPlayer(Direction.WEST_DEPRECATED).init(new String[] { "3", "10" });
    game.getPlayer(Direction.NORTH_DEPRECATED).init(new String[] { "2", "9" });
    game.getPlayer(Direction.SOUTH_DEPRECATED).init(new String[] { "A", "5" });
    game.getPlayer(Direction.EAST_DEPRECATED).init(new String[] { "K", "7" });
    game.setNextToPlay(Direction.SOUTH_DEPRECATED);
    DoubleDummySolver s = new DoubleDummySolver(game);
    s.examinePosition(node);
    Node child1 = s.getStack().pop();
    Node child2 = s.getStack().pop();
    s.examinePosition(child1);
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.