Releases: giacomelli/GeneticSharp
3.1.4
Issues
Bug fixes
- Population.BestChromosomeChanged fires every generation with the same chromosome #70
- Updated System.Drawing.Common package due to a security vulnerability #105
Updating
.NET 6
Only GeneticSharp:
update-package GeneticSharp
GeneticSharp and extensions (TSP, AutoConfig, Bitmap equality, Equality equation, Equation solver, Function builder, etc):
update-package GeneticSharp.Extensions
Unity3D
You should use the UnityNuGet to install GeneticSharp directly from NuGet.
Or you can use the latest GeneticSharp.unitypackage available in the Assets
section of this release.
.NET Standard 2.0 and .NET Framework 4.6.2
To install previous version that support .NET Standard 2.0 and .NET Framework 4.6.2:
install-package GeneticSharp -Version 2.6.0
Mono and .NET Framework 3.5
To install previous version that support .NET Framework 3.5:
install-package GeneticSharp -Version 1.2.0
More about installing/setup: https://github.com/giacomelli/GeneticSharp/wiki/Setup.
3.1.2
Issues
Features
- Suggestion: Add an ability to set PRNG's initial seed #62
Bug fixes
- GeneticAlgorithm.BestChromosome.Fitness decrease over time when using EliteSelection #72
- Multiple occurances of same chromosome instance in generation #92
Updating
.NET 6
Only GeneticSharp:
update-package GeneticSharp
GeneticSharp and extensions (TSP, AutoConfig, Bitmap equality, Equality equation, Equation solver, Function builder, etc):
update-package GeneticSharp.Extensions
Unity3D
You should use the UnityNuGet to install GeneticSharp directly from NuGet.
Or you can use the latest GeneticSharp.unitypackage available in the Assets
section of this release.
.NET Standard 2.0 and .NET Framework 4.6.2
To install previous version that support .NET Standard 2.0 and .NET Framework 4.6.2:
install-package GeneticSharp -Version 2.6.0
Mono and .NET Framework 3.5
To install previous version that support .NET Framework 3.5:
install-package GeneticSharp -Version 1.2.0
More about installing/setup: https://github.com/giacomelli/GeneticSharp/wiki/Setup.
3.0.0
.NET 6
With version 3.0.0, GeneticSharp now supports .NET 6.
Performance improvements
The performance of many operations has been improved just for use .NET 6:
Chromosomes
Crossovers
Task executors
Mutations
Randomizations
Reinsertions
Selections
Terminations
More about performance: https://github.com/giacomelli/GeneticSharp/wiki/Performance.
Streamlining namespaces
To avoid the necessity to write many using
statements to write a basic genetic algorithm with GeneticSharp:
using GeneticSharp.Domain;
using GeneticSharp.Domain.Crossovers;
using GeneticSharp.Domain.Mutations;
using GeneticSharp.Domain.Populations;
using GeneticSharp.Domain.Selections;
using GeneticSharp.Domain.Terminations;
using GeneticSharp.Infrastructure.Framework.Threading;
The namespaces needed to use GeneticSharp have been simplified to just two:
using GeneticSharp;
and this one if you want to use the extensions:
using GeneticSharp.Extensions;
Installing
.NET 6
Only GeneticSharp:
install-package GeneticSharp
GeneticSharp and extensions (TSP, AutoConfig, Bitmap equality, Equality equation, Equation solver, Function builder, etc):
install-package GeneticSharp.Extensions
Unity3D
You should use the UnityNuGet to install GeneticSharp directly from NuGet.
Or you can use the latest GeneticSharp.unitypackage available in the Assets
section of this release.
.NET Standard 2.0 and .NET Framework 4.6.2
To install previous version that support .NET Standard 2.0 and .NET Framework 4.6.2:
install-package GeneticSharp -Version 2.6.0
Mono and .NET Framework 3.5
To install previous version that support .NET Framework 3.5:
install-package GeneticSharp -Version 1.2.0
More about installing/setup: https://github.com/giacomelli/GeneticSharp/wiki/Setup.
2.6.0
Blazor template
Now we have 4 dotnet new
templates, besides the GeneticSharpConsoleApp
, GeneticSharpTspConsoleApp
and GeneticSharpTspUnity3d
already existent, a new template for a Blazor client app was added: GeneticSharpTspBlazorApp
:
dotnet new -i GeneticSharp.Templates
dotnet new GeneticSharpTspBlazorApp -o TspBlazorApp
cd TspBlazorApp
dotnet run
If you want to know more about how to use GeneticSharp with Blazor, take a look in this tutorial TSP with GeneticSharp and Blazor.
New papers and projects using GeneticSharp
Four papers and one project were added to the list:
- Design of a warehouse order picking policy using genetic algorithm (paper)
- Fabrication of Adiabatic Quantum-Flux-Parametron Integrated Circuits Using an Automatic Placement Tool Based on Genetic Algorithms (paper)
- Modelling and Simulation Analysis of Goal-Oriented Business Process (paper)
- Optimization by genetic algorithm of lattices structures for the media generation in additive manufacturing (paper)
- TrussOptimization (project)
How to install the new version
.NET Standard 2.0
Only GeneticSharp:
install-package GeneticSharp
GeneticSharp and extensions (TSP, AutoConfig, Bitmap equality, Equality equation, Equation solver, Function builder, etc):
install-package GeneticSharp.Extensions
Unity3D
You should use the UnityNuGet to install GeneticSharp directly from NuGet.
Or you can use the latest GeneticSharp.unitypackage available on our release page.
Let's evolve!
2.5.2
2.5.1
Bug fix
- Runtime exception on .NET 4.6.2 #58
NuGet update
Only GeneticSharp:
update-package GeneticSharp
GeneticSharp and extensions (TSP, AutoConfig, Bitmap equality, Equality equation, Equation solver, Function builder, etc):
update-package GeneticSharp.Extensions
Unity3d
The bug #58 does not affect the Unity3d package, so you can still use the 2.4.0 version.
v2.4.0
The additions of this version are the two new crossovers implementations and a new option of ITaskExecutor that use TPL.
Crossovers
Alternating-position (AP)
The alternating position crossover operator (Larrañaga et al. 1996a) simply creates an offspring by selecting alternately the next element of the first parent and the next element of the second parent, omitting the elements already present in the offspring.
Voting Recombination Crossover (VR)
It can be seen as a P-sexual crossover operator, where p (parents number) is a natural number greater than, or equal to, 2.
It starts by defining a threshold, which is a natural number smaller than, or equal to p.
Next, for every; i E {l, 2, . . .N} the set of ith elements of all the parents is considered. If in this set an element occurs at least the threshold number of times, it is copied into the offspring.
TPL
Three new classes were implemented to run some key points of a genetic algorithm using TPL.
Those new classes can be used alone, but normally you will use all them together. You can see a sample usage at unit test Start_TplManyGenerations_Optimization
.
TplTaskExecutor:
An ITaskExecutor's implementation that executes the tasks in a parallel fashion using Task Parallel Library (TPL).
TplPopulation
Represents a population of candidate solutions (chromosomes) using TPL to create them.
TplOperatorsStrategy
A new interface called IOperatorsStrategy was added to GeneticAlgorithm as an option. Two options of operators strategy were created, the default one, called DefaultOperatorsStrategy and the new one called TplOperatosStrategy.
Thanks to
I would like to thanks to EMostafaAli and Alexey I. for opened some issues and made small pull requests and Dan for contributing with the TPL implementations.
Let's evolve!
v2.2.0
The additions of this version are the new whole sample and extensions showing how to use GeneticSharp to solve a Sudoku.
The GeneticSharp.Extensions project receive those new features:
Multiple
MultipleChromosome
Compound chromosome to artificially increase genetics diversity by evolving a list of chromosomes instead of just one.
Sub-genes are inlined into a single compound list of genes.
MultipleFitness
Fitness class that can evaluate a compound chromosome by summing over the evaluation of its sub-chromosomes.
Sudoku
ISudokuChromosome:
Represents each type of chromosome for solving a sudoku is simply required to output a list of candidate sudokus.
SudokuBoard
A class that represents a Sudoku, fully or partially completed.
Holds a list of 81 int for cells, with 0 for empty cells.
Can parse strings and files from most common formats and displays the sudoku in an easy to read format.
SudokuCellsChromosome
This simple chromosome simply represents each cell by a gene with a value between 1 and 9, accounting for the target mask if given.
SudokuFitness
Evaluates a sudoku chromosome for completion by counting duplicates in rows, columns, boxes, and differences from the target mask.
SudokuPermutationsChromosome
This more elaborated chromosome manipulates rows instead of cells, and each of its 9 gene holds an integer for the index of the row's permutation amongst all that respect the target mask.
Permutations are computed once when a new Sudoku is encountered, and stored in a static dictionary for further reference.
SudokuRandomPermutationsChromosome
This chromosome aims at increasing genetic diversity of SudokuPermutationsChromosome, which exhibits only 9 permutation genes.
Here, instead, an arbitrary number of Sudokus are generated where for each row, a random gene is picked amongst an arbitrary number of corresponding permutation genes.
Samples
Thanks to
I would like to thanks to Jean-Sylvain Boige (@jsboige) for contributing with those great new samples and extensions and for use GeneticSharp in his Artificial Intelligence course in French engineering schools (course).
Take a look on the pull-request for fore details about those new features: New Sudoku extension and GTK# sample #43.
Let's evolve!
v2.1.0
v2.0.0 - .NET Core
.NET Standard 2.0 and .NET Framework 4.6.2
In march GenetichSharp start to support .NET Standard 2.0 in the 2.0.0-rc version. Two months have pass and in the meanwhile the community have time to test that release candidate version and now Unity3D has an official .NET Standard 2.0 profile.
So, it's time to release the GeneticSharp v2.0.0.
Installing
.NET Standard 2.0 and .NET Framework 4.6.2
Only GeneticSharp:
install-package GeneticSharp
GeneticSharp and extensions (TSP, AutoConfig, Bitmap equality, Equality equation, Equation solver, Function builder, etc):
install-package GeneticSharp.Extensions
Unity3D
If want to use GeneticSharp on Unity3D you can use the GeneticSharp.unitypackage.
In this tutorial there is an introduction showing how to use GeneticSharp with Unity3D: TSP with GeneticSharp and Unity3D
Mono and .NET Framework 3.5
If you're still in a .NET Framework version lower than 4.6.2 project use the 1.2.0 version.
install-package GeneticSharp -Version 1.2.0
More about the release in this blog post GeneticSharp v2.0.0 - .NET Core