Comments (2)
Nice question! I would like to know what is the crossover operation you're trying to implement.
Well, we don't need to change the ICrossover interface to get this done, you can just inject the Population in your crossover implementation's constructor, like this:
public class MyCrossover : CrossoverBase
{
private Population m_population;
public MyCrossover(Population population) : base(2, 2)
{
m_population = population;
}
protected override IList<IChromosome> PerformCross(IList<IChromosome> parents)
{
// Now you can read current generation from
// m_population.CurrentGeneration
// your crossover code...
}
}
var selection = new EliteSelection();
var mutation = new ReverseSequenceMutation();
var fitness = new MyProblemFitness();
var chromosome = new MyProblemChromosome();
var population = new Population (50, 70, chromosome);
var crossover = new MyCrossover(population);
var ga = new GeneticAlgorithm(population, fitness, selection, crossover, mutation);
ga.Termination = new GenerationNumberTermination(100);
ga.Start();
from geneticsharp.
Great, I will give a try.
It is just abt math operations; I'm using geneticsharp to solve some math problems.
Thanks
from geneticsharp.
Related Issues (20)
- Reference to defective, outdated chocolatery GTKSharp package prevents contributions
- TplTaskExecutor seems not occupying enough CPU HOT 1
- IMutation. RequiredLength property HOT 1
- Cannot run simple integer array optimization. Got boolean results HOT 1
- Need implementation help HOT 1
- Running optimization on a list of parameters with specific step
- Unity and NuGet package is still at version 2.6.0 at in release 3.0.0 and later HOT 1
- Can we identify which Chromosome is which? HOT 1
- Nuget documentation is missing
- GA pause & resume HOT 2
- FitnessStagnationTermination Does Not Terminate at Expected Generation When Using GenerationRan Event HOT 1
- Resume GA when instantiated using a population with GenerationsNumber > 0 HOT 2
- Multipopulations implementation and fitness stagnation plateau - how to approach
- ChomosomeBase vs FloatingPointChromosome
- Fixed Chromsome Values.
- Selection doesn't seem to do anything HOT 2
- Multiple occurances of same chromosome instance in generation
- ToFloatingPoints() ArgumentException HOT 2
- reinsertion control HOT 1
- Saving current progress HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geneticsharp.