Package net.gouline.riskybusiness.model

Examples of net.gouline.riskybusiness.model.Customer


    }

    DecimalFormat decimalFormat = new DecimalFormat("#.##");
    List<UnsettledBet> unsettledBets = unsettledBetParser.parse(unsettledReader, true);
    for (UnsettledBet unsettledBet : unsettledBets) {
      Customer customer = getCustomer(customers, unsettledBet.getCustomerId());

      double successRate = customer.getSuccessRate();
      if (successRate > 0.6) {
        unsettledBet.addRisk(RiskType.SUCCESS_RATE,
                "Success rate: " + decimalFormat.format(successRate * 100) + "%");
      }

      double averageStake = customer.getAverageStake();
      double stakeRatio = unsettledBet.getStake() / averageStake;
      if (stakeRatio > 10) {
        RiskType type = RiskType.STAKE_AVERAGE;
        if (stakeRatio > 30) {
          type = RiskType.STAKE_AVERAGE_HIGH;
View Full Code Here


    return unsettledBets;
  }

  private static Customer getCustomer(Map<Long, Customer> customers, long id) {
    Customer customer = customers.get(id);
    if (customer == null) {
      customer = new Customer(id);
      customers.put(id, customer);
    }
    return customer;
  }
View Full Code Here

TOP

Related Classes of net.gouline.riskybusiness.model.Customer

Copyright © 2018 www.massapicom. 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.