Package org.uncommons.watchmaker.framework.selection

Examples of org.uncommons.watchmaker.framework.selection.TruncationSelection


      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
        public Component getListCellRendererComponent(JList list,
View Full Code Here


      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
        public Component getListCellRendererComponent(JList list,
View Full Code Here

      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
        public Component getListCellRendererComponent(JList list, Object value,
View Full Code Here

      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
        public Component getListCellRendererComponent(JList list, Object value,
View Full Code Here


    @Test
    public void testChangeSelection()
    {
        SelectionStrategy<Object> quarter = new TruncationSelection(0.25);
        SelectionStrategy<Object> half = new TruncationSelection(0.5);
        List<SelectionStrategy<? super Object>> strategies = new LinkedList<SelectionStrategy<? super Object>>();
        strategies.add(quarter);
        strategies.add(half);
        SelectionStrategyControl<Object> control = new SelectionStrategyControl<Object>(strategies);
View Full Code Here


    @Test(dependsOnMethods = "testChangeSelection")
    public void testReset()
    {
        SelectionStrategy<Object> quarter = new TruncationSelection(0.25);
        SelectionStrategy<Object> half = new TruncationSelection(0.5);
        List<SelectionStrategy<? super Object>> strategies = new LinkedList<SelectionStrategy<? super Object>>();
        strategies.add(quarter);
        strategies.add(half);
        SelectionStrategyControl<Object> control = new SelectionStrategyControl<Object>(strategies);
View Full Code Here

        options.add(new RankSelection());
        options.add(new RouletteWheelSelection());
        options.add(new SigmaScaling());
        options.add(new StochasticUniversalSampling());
        options.add(new TournamentSelection(tournamentProbability));
        options.add(new TruncationSelection(truncationRatio));
        return options;
    }
View Full Code Here

     */
    @Test
    public void testWithMutation()
    {
        TravellingSalesmanStrategy strategy = new EvolutionaryTravellingSalesman(data,
                                                                                 new TruncationSelection(0.5),
                                                                                 10, // Small population.
                                                                                 0, // No elitism.
                                                                                 3, // Only a few generations.
                                                                                 false, // Cross-over.
                                                                                 true); // Mutation.
View Full Code Here

     */
    @Test
    public void testWithCrossover()
    {
        TravellingSalesmanStrategy strategy = new EvolutionaryTravellingSalesman(data,
                                                                                 new TruncationSelection(0.5),
                                                                                 10, // Small population.
                                                                                 0, // No elitism.
                                                                                 3, // Only a few generations.
                                                                                 true, // Cross-over
                                                                                 false); // Mutation.
View Full Code Here

     */
    @Test(expectedExceptions = IllegalArgumentException.class)
    public void testNoEvolution()
    {
        new EvolutionaryTravellingSalesman(data,
                                           new TruncationSelection(0.5),
                                           10,
                                           0,
                                           3,
                                           false,
                                           false); // Should throw an IllegalArgumentException as no operators are enabled.
View Full Code Here

TOP

Related Classes of org.uncommons.watchmaker.framework.selection.TruncationSelection

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.