Examples of Probability


Examples of org.uncommons.maths.random.Probability

     * If the mutation doesn't happen, the candidates should be returned unaltered.
     */
    @Test
    public void testSomeMutations()
    {
        TreeFactory treeFactory = new TreeFactory(1, 4, new Probability(0.6d), new Probability(0.2d));
        EvolutionaryOperator<Node> mutation = new TreeMutation(treeFactory,
                                                               Probability.ONE); // Probability of 1 means guaranteed mutations.
        List<Node> candidates = treeFactory.generateInitialPopulation(20, ExamplesTestUtils.getRNG());

        Map<Node, Node> distinctTrees = new IdentityHashMap<Node, Node>();
View Full Code Here

Examples of org.uncommons.maths.random.Probability

public class TournamentSelectionTest
{
    @Test
    public void testNaturalFitnessSelection()
    {
        SelectionStrategy<Object> selector = new TournamentSelection(new Probability(0.7d));
        List<EvaluatedCandidate<String>> population = new ArrayList<EvaluatedCandidate<String>>(4);
        EvaluatedCandidate<String> steve = new EvaluatedCandidate<String>("Steve", 10.0);
        EvaluatedCandidate<String> mary = new EvaluatedCandidate<String>("Mary", 9.1);
        EvaluatedCandidate<String> john = new EvaluatedCandidate<String>("John", 8.4);
        EvaluatedCandidate<String> gary = new EvaluatedCandidate<String>("Gary", 6.2);
View Full Code Here

Examples of org.uncommons.maths.random.Probability


    @Test
    public void testNonNaturalFitnessSelection()
    {
        SelectionStrategy<Object> selector = new TournamentSelection(new Probability(0.7d));
        List<EvaluatedCandidate<String>> population = new ArrayList<EvaluatedCandidate<String>>(4);
        EvaluatedCandidate<String> gary = new EvaluatedCandidate<String>("Gary", 6.2);
        EvaluatedCandidate<String> john = new EvaluatedCandidate<String>("John", 8.4);
        EvaluatedCandidate<String> mary = new EvaluatedCandidate<String>("Mary", 9.1);
        EvaluatedCandidate<String> steve = new EvaluatedCandidate<String>("Steve", 10.0);
View Full Code Here

Examples of org.uncommons.maths.random.Probability

      selectionLabel = new JLabel("Selection Strategy: ");
      innerPanel.add(selectionLabel);
     
      SelectionStrategy<?>[] selectionStrategies = {new RankSelection(), new RouletteWheelSelection(),
                                                    new StochasticUniversalSampling(),
                                                    new TournamentSelection(new Probability(0.95)),
                                                    new TruncationSelection(0.5)};
     
      selectionCombo = new JComboBox(selectionStrategies);
      selectionCombo.setRenderer(new DefaultListCellRenderer() {
        @Override
View Full Code Here

Examples of org.uncommons.watchmaker.framework.Probability

      selectionLabel = new JLabel("Selection Strategy: ");
      innerPanel.add(selectionLabel);

      SelectionStrategy<?>[] selectionStrategies = {
          new RankSelection(), new RouletteWheelSelection(),
          new StochasticUniversalSampling(), new TournamentSelection(new Probability(0.95d)),
          new TruncationSelection(0.5d)};

      selectionCombo = new JComboBox(selectionStrategies);
      selectionCombo.setRenderer(new DefaultListCellRenderer() {
        @Override
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.