Examples of CombinationGenerator


Examples of cz.cuni.mff.abacs.tools.CombinationGenerator

     *
     * @param n
     * @param r
     */
    public PseudoRandomCombinationGenerator(int n, int r) {
      this._gener = new CombinationGenerator(n, r);
      this.fillBuffer();
    }
View Full Code Here

Examples of org.cspoker.ai.experiments.util.CombinationGenerator

        botIDs[i] = clientContext.getAccountContext().getPlayerID();
      }
 
      executor = SingleThreadRequestExecutor.getInstance();
 
      combinationgenerator = new CombinationGenerator(botFactories.length, nbPlayersPerGame);
    } catch (LoginException e) {
      throw new IllegalStateException("Login Failed", e);
    } catch (RemoteException e) {
      logger.error(e);
      throw new IllegalStateException("Server setup failed.", e);
View Full Code Here

Examples of org.mitre.medfacts.i2b2.util.CombinationGenerator

{

  @Test
  public void testGenerateCombinations()
  {
    CombinationGenerator g = new CombinationGenerator();
    int inputSize = 4;
    List<Set<Integer>> combinations = g.generateCombinations(inputSize);


    int expectedSize = g.twoToThePowerOf(inputSize) - 1;
    int actualSize = combinations.size();
    assertEquals(String.format("number of combinations for an input size of %d should be %d instead of %d", inputSize, expectedSize, actualSize), expectedSize, actualSize);
  }
View Full Code Here

Examples of org.mitre.medfacts.i2b2.util.CombinationGenerator

  @Ignore
  @Test
  public void testTwoToThePowerOf()
  {
    CombinationGenerator g = new CombinationGenerator();

    int input = 0;
    int expectedOutput = 1;
    int actualOutput = g.twoToThePowerOf(input);

    assertEquals(String.format("2 to the %d should equal %d; actual value was %d", input, expectedOutput, actualOutput), expectedOutput, actualOutput);


    input = 1;
    expectedOutput = 2;
    actualOutput = g.twoToThePowerOf(input);

    assertEquals(String.format("2 to the %d should equal %d; actual value was %d", input, expectedOutput, actualOutput), expectedOutput, actualOutput);

    input = 2;
    expectedOutput = 4;
    actualOutput = g.twoToThePowerOf(input);

    assertEquals(String.format("2 to the %d should equal %d; actual value was %d", input, expectedOutput, actualOutput), expectedOutput, actualOutput);

    input = 3;
    expectedOutput = 8;
    actualOutput = g.twoToThePowerOf(input);

    assertEquals(String.format("2 to the %d should equal %d; actual value was %d", input, expectedOutput, actualOutput), expectedOutput, actualOutput);

    input = 4;
    expectedOutput = 16;
    actualOutput = g.twoToThePowerOf(input);

    assertEquals(String.format("2 to the %d should equal %d; actual value was %d", input, expectedOutput, actualOutput), expectedOutput, actualOutput);

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