https://github.com/s-martin/galib
Modernized GAlib
https://github.com/s-martin/galib
c-plus-plus cpp cpp17 galib genetic-algorithm
Last synced: about 1 year ago
JSON representation
Modernized GAlib
- Host: GitHub
- URL: https://github.com/s-martin/galib
- Owner: s-martin
- License: other
- Created: 2019-02-05T21:11:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-20T20:38:00.000Z (over 1 year ago)
- Last Synced: 2024-10-21T07:46:15.975Z (over 1 year ago)
- Topics: c-plus-plus, cpp, cpp17, galib, genetic-algorithm
- Language: C
- Homepage: https://s-martin.github.io/galib/
- Size: 25.1 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Modern GAlib: A (modernized) C++ Genetic Algorithm Library

[](https://github.com/s-martin/galib/actions/workflows/ci-linux.yml) [](https://github.com/s-martin/galib/actions/workflows/ci-windows.yml) [](https://github.com/s-martin/galib/actions/workflows/codeql-analysis.yml)
[](https://coveralls.io/github/s-martin/galib?branch=master)
Copyright (c) 1994-1996 MIT, 1996-2005 Matthew Wall
GAlib is a C++ library of genetic algorithm objects. With GAlib you can add
evolutionary algorithm optimization to almost any program using any data
representation and standard or custom selection, crossover, mutation,
scaling, and termination methods.
GAlib was originally developed by Matthew Wall.
Modernized GAlib from version 3.0 on is a fork of the [original GAlib](http://lancet.mit.edu/ga) and modernized the original code using C++17 technology.
The library requires a C++ compiler conforming to C++17. It has been tested with
- Visual Studio 2019
- GCC 8.3, 9.4 (Ubuntu)
- LLVM/Clang 10.0.0 (Ubuntu)
Graphic examples (XWindows) are available, as are
parallel, distributed implementations using PVM. There are about 30 examples
that illustrate various ways to use GAlib on a variety of problems.
In addition many unit tests are available.
## WHERE TO GET IT
Modernized GAlib:
Original GAlib 2.4.7:
## COMPILATION
CMake is used for compilation. There are three things to build: the library, the examples
and the unit tests. Here is the short version of how to build and test everything:
### Windows
Using [vcpkg](https://github.com/microsoft/vcpkg) to install dependencies and [chocolatey](https://chocolatey.org) to install tools is recommended.
- Clone or download the repository
- Install dependencies: `vcpkg install boost-test boost-program-options boost-predef`
- Install coverage tools: `choco install opencppcoverage`
#### Visual Studio 2019 or later
- Open path in Visual Studio as CMake project.
#### Previous versions of Visual Studio
- `md build && cd build`
- `cmake ../ -DCMAKE_TOOLCHAIN_FILE=/scripts/buildsystems/vcpkg.cmake`
- Open created Visual Studio solution file in `build` directory
### Linux (Ubuntu)
- `sudo apt install libboost-test-dev libboost-program-options-dev libx11-dev libxt-dev libxaw7-dev`
If you want to use code coverage:
- `sudo apt install lcov gcovr`
If you want to use Doxygen:
- `sudo apt install doxygen mscgen dia graphviz`
If you want to use PVM examples:
- `sudo apt install pvm-dev`
Configure and build:
- `mkdir build && cd build`
- `cmake ../` (if you don't want to build examples append `-DBUILD_EXAMPLES=OFF`, if you want to build PVM append `-DBUILD_PVM=ON`)
- `make`
Run unit tests:
- `make test`
Run unit tests and create coverage:
- `make GAlib_lcov`
- `make GAlib_gcov`
### Building shared libraries
To build shared libraries append `-DBUILD_SHARED_LIBS:BOOL=ON` to the above `cmake` command.
See also in the CMake docs.
### Common Errors
If that does not work, then here are the files you might have to modify:
- ga/gaconfig.h - this contains the macros that control library options
If you still have problems, look at Installation.html in the doc directory.
## DOCUMENTATION
Doxygen API documentation is available at .
More general documentation is available at `/doc`.
### Documentation of original GAlib (until 2.4.7)
List of bugs is at
#### Original Mailing Lists
There are two GAlib mailing lists: and
The first list is an unmoderated list intended as a forum for galib users to
help each other. The second is only for announcements about GAlib updates.
To subscribe, send email to (or galib-announce-request)
with the word 'subscribe' as the subject and nothing in the body of the email.
To unsubscribe, send email with the word 'unsubscribe' as the subject.