Quantcast

Setting up my own custom crossover and mutation operators

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Setting up my own custom crossover and mutation operators

John Lennon
Hi,

I am currently using the default configuration to my application and i have not set my desired crossover and mutation operators. I would like to set my custom crossover operator where it will be a one point or a two point crossover. Where can i code my own crossover function and also set my desired mutation rate.

Thank you.

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Setting up my own custom crossover and mutation operators

Paul Woodward-2
John,

I did it by extending org.jgap.impl.CrossoverOperator for crossover and org.jgap.BaseGeneticOperator for mutation.

These are then added to your configuration:

final Configuration conf = new Configuration();
...
conf.addGeneticOperator( <your crossover op> );
conf.addGeneticOperator( <your mutation op> );

I didn't bother supported the multitude of constructors, just the one where you can specify a specific crossover/mutation rate because this is all I required.

Paul


On Fri, Oct 25, 2013 at 3:18 AM, John Lennon <[hidden email]> wrote:
Hi,

I am currently using the default configuration to my application and i have not set my desired crossover and mutation operators. I would like to set my custom crossover operator where it will be a one point or a two point crossover. Where can i code my own crossover function and also set my desired mutation rate.

Thank you.

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users



------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Setting up my own custom crossover and mutation operators

Phi-Vu Nguyen
In reply to this post by John Lennon
Hi,

By this I can get/set the mutation rate:
//Print out the mutation rate
            ArrayList<GeneticOperator> arr= new ArrayList<GeneticOperator>(config.getGeneticOperators());
            for (int i=0;i<arr.size();i++){
                if (arr.get(i).toString().contains(".MutationOperator@")){
                    ((MutationOperator)arr.get(i)).setMutationRate(5);
                    System.out.println("Mutation rate: " + ((MutationOperator)arr.get(i)).getMutationRate() + " ");
                }
            }


On Fri, Oct 25, 2013 at 10:18 AM, John Lennon <[hidden email]> wrote:
Hi,

I am currently using the default configuration to my application and i have not set my desired crossover and mutation operators. I would like to set my custom crossover operator where it will be a one point or a two point crossover. Where can i code my own crossover function and also set my desired mutation rate.

Thank you.

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users



------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Loading...