Code Monkey home page Code Monkey logo

Comments (3)

sccolbert avatar sccolbert commented on July 20, 2024 1

In the original implementation, the strength is just multiplied by the weight to produce a final strength for the constraint when adding it to the solver. I just omittted that and consider the strength to be pre-multiplied by the weight (if you want to even think of weights).

You are not limited to the predefined strengths of weak, medium, strong, and required. You can create your own strengths with any value between those which are predefined. They are just doubles.

Relevant C++ code:
https://github.com/nucleic/kiwi/blob/master/kiwi/strength.h#L18-L34
https://github.com/nucleic/kiwi/blob/master/kiwi/symbolics.h#L670-L683

Relevant Python code:
https://github.com/nucleic/kiwi/blob/master/py/strength.cpp#L30-L78
https://github.com/nucleic/kiwi/blob/master/py/util.h#L45

from kiwi.

sccolbert avatar sccolbert commented on July 20, 2024

In particular, notice the optional 4th weight arg to create_strength, which defaults to 1.0:

C++:
https://github.com/nucleic/kiwi/blob/master/kiwi/strength.h#L18

Python:
https://github.com/nucleic/kiwi/blob/master/py/strength.cpp#L77

from kiwi.

helmesjo avatar helmesjo commented on July 20, 2024

Alright thanks, I'll have a look at it!

from kiwi.

Related Issues (20)

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.