Examples of Bid


Examples of org.apache.openjpa.trader.domain.Bid

   
    public Bid bid(Trader trader, Stock stock, int volume, double price) {
        EntityManager em = getEntityManager();
        begin();
        Bid bid = new Bid(trader, stock, price, volume);
        em.persist(bid);
        commit();
        return bid;
    }
View Full Code Here

Examples of org.apache.openjpa.trader.domain.Bid

   
    public Trade trade(Match match) {
        EntityManager em = getEntityManager();
        begin();
        Ask ask = em.merge(match.getAsk());
        Bid bid = em.merge(match.getBid());
        Trade trade = new Trade(ask, bid);
        em.persist(trade);
        commit();
        return trade;
    }
View Full Code Here

Examples of org.gnubridge.core.bidding.Bid

    assertEquals(null, rule.getBid());
  }

  public void testCannotOpenOneNTIfHigherBid() {
    Auctioneer a = new Auctioneer(West.i());
    a.bid(new Bid(2, Clubs.i()));
    BiddingRule rule = new Open1NT(a, new Hand("K,2", "A,Q,3", "A,8,6,5,3", "K,J,3"));
    assertEquals(null, rule.getBid());
  }
View Full Code Here

Examples of org.gnubridge.core.bidding.Bid

    result.addAll(calls);
    return result;
  }

  public void bid(Bid b) {
    Bid bid = Bid.cloneBid(b);
    beforeLast = last;
    last = new Call(bid, nextToBid);
    calls.add(last);
    bidCount++;
    if (bid.isPass()) {
      passCount++;
    } else {
      passCount = 0;
      if (DOUBLE.equals(bid)) {
        getHighBid().makeDoubled();
View Full Code Here

Examples of org.gnubridge.core.bidding.Bid

    }
    return result;
  }

  public Call getHighCall() {
    Bid highBid = this.highBid;
    for (Call call : calls) {
      if (call.getBid().equals(highBid)) {
        return call;
      }
    }
View Full Code Here

Examples of org.gnubridge.core.bidding.Bid

    return this.auction.mayOvercall() && calculator.getCombinedPoints() >= 10;
  }

  @Override
  protected Bid prepareBid() {
    Bid result = null;
    if (calculator.getCombinedPoints() < 13) {
      return firstValidBid( //
          bidSuit(1, hand.getSuitsWithAtLeastCards(6)), //
          bidSuit(1, hand.getDecent5LengthSuits()));
    } else if (calculator.getCombinedPoints() < 16) {
View Full Code Here

Examples of org.gnubridge.core.bidding.Bid

    return result;
  }

  private Bid bidSuit(int bidLevel, Collection<Suit> suits) {
    for (Suit suit : suits) {
      if (auction.isValid(new Bid(bidLevel, suit))) {
        return new Bid(bidLevel, suit);
      }
    }
    return null;
  }
View Full Code Here

Examples of org.gnubridge.core.bidding.Bid

    pc = new PointCalculator(hand);
  }

  @Override
  protected Bid prepareBid() {
    return new Bid(1, NoTrump.i());
  }
View Full Code Here

Examples of org.gnubridge.core.bidding.Bid

  @Override
  protected Bid prepareBid() {
    ResponseCalculator calc = new ResponseCalculator(hand, response);
    if (calc.getCombinedPoints() >= 19) {
      return new Bid(4, response.getTrump());
    } else if (calc.getCombinedPoints() >= 16) {
      return new Bid(3, response.getTrump());
    } else {
      return new Bid(2, response.getTrump());
    }
  }
View Full Code Here

Examples of org.gnubridge.core.bidding.Bid

        MainViewImpl mainView = new MainViewImpl("Gnubridge Analysis Mode");
        AnalysisView pv = new AnalysisView(mainView);
        pv.show();
        mainView.show();
        pv.setGame(g, South.i());
        pv.setContract(new Bid(1, g.getTrump()));
        pv.setListener(new MockCardPlayedListener());
        pv.displayCurrentTrick();

      }
    });
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.