GithubHelp home page GithubHelp logo

rhea's Introduction

Rhea

Linux build status Windows build status Coverage Status Readthedocs build Slack Status

About

Rhea is an incremental constraint solver based on Cassowary, originally developed by Greg J. Badros and Alan Borning. The main differences are:

  • Allows the programmer to write constraints in a natural way
  • Rewritten in C++11
  • CMake instead of GNU Autoconfig
  • Unit tests use the Boost Test Framework
  • Uses Doxygen for documentation
  • Expression parser based on Boost Spirit
  • Does not have a finite domain subsolver

Quick example

#include <rhea/simplex_solver.hpp>
#include <rhea/iostream.hpp>

main()
{
    rhea::variable left, mid, right;
    rhea::simplex_solver solver;

    solver.add_constraints(
    {
        mid == (left + right) / 2,
        right == left + 10,
        right <= 100,
        left >= 0
    });
    solver.suggest(mid, 2);

    std::cout << left << " " << mid << " " << right << std::endl;
    // Prints "0 5 10"
}

This is the line example from the original paper. The constraints make sure the line is at least 10 wide, fits inside the 0..100 range, and that the mid point is halfway the left and the right.

Note that even though we suggest the mid point to be at 2, the solver decides to move it over to 5 so all the constraints can be met.

Status

This software is beta. It does pass all unit tests, it is in active use by several applications, but the interface is not stable yet.

License

Rhea is free software: you can redistribute it and/or modify it under the terms of the MIT/Expat license.

Links

Curious about similar projects? Head over to overconstrained.io.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.