OpenRules Platform

Decision Optimization

Simple Arithmetic Problem

Learn the essential Rule Solver concepts with a small arithmetic model that defines variables, constraints, and an optimization objective.

Problem Description. There are 3 variables X, Y, and Z with possible values from 1 to 10. It is known that

X < Y and X + Y = Z.

Find a solution (values of X, Y, and Z) that maximizes Z.

Implementation. You can find the implementation in the project “openrules.solver/Arithmetic”. Here is the Glossary:

image

We will rely on the standard Rule Solver top-level decision “DefineAndSolve”:

Simple Arithmetic Problem illustration

Here are our two main sub-decisions “Define” and “Solve”:

image

The following tables define the objective and post constraints:

image

When we execute this decision model with “test.bat”, it will produce the following results:

image

Try Rule Solver

Build decision models that find the best answer.

Start with the free evaluation, then install Rule Solver and explore its optimization examples.