Skip to content

morinim/vita

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vita Version

C++17 Build Status CII License Twitter

Important notice

Project is in maintenance mode. Only bug fixes and security patches will be issued.

All future development efforts have been shifted to Ultra. Ultra aims to be an easy replacement for Vita, featuring a simpler architecture and full concurrency support.

Overview

Vita is a scalable, high performance framework for genetic programming and genetic algorithms.

It's suitable for classification, symbolic regression, content base image retrieval, data mining and software agent implementation. Main features:

  • flexible and fast
  • easy integration with other systems
  • simple addition of features and modules
  • fast experimentation with detailed run-log
  • modern, standard ISO C++17 source code
  • more

This software was originally developed by EOS without open source in mind. Later (early 2011) the code has been commented, restructured, documented and released as open source.

Symbolic regression example

// DATA SAMPLE
// (the target function is `x + sin(x)`)
std::istringstream training(R"(
  -9.456,-10.0
  -8.989, -8.0
  -5.721, -6.0
  -3.243, -4.0
  -2.909, -2.0
   0.000,  0.0
   2.909,  2.0
   3.243,  4.0
   5.721,  6.0
   8.989,  8.0
)");

// READING INPUT DATA
vita::src_problem prob(training);

// SETTING UP SYMBOLS
prob.insert<vita::real::sin>();
prob.insert<vita::real::cos>();
prob.insert<vita::real::add>();
prob.insert<vita::real::sub>();
prob.insert<vita::real::div>();
prob.insert<vita::real::mul>();

// SEARCHING
vita::src_search s(prob);
auto result(s.run());

It's pretty straightforward (further details in the specific tutorial).

Documentation

There is a comprehensive wiki. You should probably start with the tutorials.

Build requirements

Vita is designed to have fairly minimal requirements to build and use with your projects, but there are some. Currently, we support Linux and Windows. We will also make our best effort to support other platforms (e.g. Mac OS X, Solaris, AIX). However, since core members of the Vita project have no access to these platforms, Vita may have outstanding issues there. If you notice any problems on your platform, please use the issue tracking system; patches for fixing them are even more welcome!

Mandatory

  • A C++17-standard-compliant compiler
  • CMake

Optional

Getting the source

There are two ways of getting Vita's source code: you can download a stable source release in your preferred archive format or directly clone the source from a repository.

Cloning a repository requires a few extra steps and some extra software packages on your system, but lets you track the latest development and make patches much more easily, so we highly encourage it.

Run the following command:

git clone https://github.com/morinim/vita.git

The Vita distribution

This is a sketch of the resulting directory structure:

vita/
  doc/
  misc/
  src/
    CMakeLists.txt
    examples/ .............Various examples
      forex/ ..............Forex example
      sr/ .................Symbolic regression and classification utility
    kernel/ ...............Vita kernel (core library)
    test/ .................Test-suite
    third_party/ ..........Third party libraries
    utility/ ..............Support libraries / files
  tools/ ..................C++ lint checker and other tools
  CONTRIBUTING.md
  LICENSE
  NEWS.md..................Don't let your friends dump git logs into NEWS
  README.md

Setting up the build

cd vita
cmake -B build/ src/

To suggest a specific compiler you can write:

CXX=clang++ cmake -B build/ src/

You're now ready to build using the underlying build system tool:

  • everything: cmake --build build/
  • kernel library (libvita.a): cmake --build build/ --target vita
  • sr tool: cmake --build build/ --target sr
  • tests: cmake --build build/ --target tests
  • the ABC example: cmake --build build/ --target ABC
  • for a list of valid targets: cmake --build build/ --target help

The output files are stored in subdirectories of build/ (out of source build).

Windows may need various expedients about which you can read in the Windows walkthrough.

Installing Vita

To install Vita use the command:

cmake --install build/

(requires superuser, i.e. root, privileges)

Manually installing is also very easy. There are just two files, both inside the build/kernel directory:

  • a static library (e.g. libvita.a under Unix);
  • an automatically generated global/single header (auto_vita.h which can be renamed).

As a side note, the command to build the global header is:

./tools/single_include.py --src-include-dir src/ --src-include kernel/vita.h --dst-include mysingleheaderfile.h

(must be executed from the repository main directory)

License

Mozilla Public License v2.0 (also available in the accompanying LICENSE file).

Versioning

Vita uses semantic versioning. Releases are tagged.

Note that the major version will change rapidly and API changes are fairly common. Read the NEWS.md file for details about the breaking changes.