Regarding the provision of Optapy sample programs?

35 Views Asked by At

This is simple example by ortools.

from ortools.linear_solver import pywraplp

def main():
    solver = pywraplp.Solver.CreateSolver('SCIP')

    x = solver.NumVar(-solver.infinity(), solver.infinity(), 'x')

    solver.Add(x <= 3.5)

    objective = solver.Objective()
    objective.SetCoefficient(x, 1)
    objective.SetMinimization()

    solver.Solve()

    print('Optimal value of x:', x.solution_value())

if __name__ == '__main__':
    main()

(1) The above program is written by ortools, could you please provide the code you wrote in OptaPy?

(2) I have configured the configuration in xml in the following way, but it is not done. https://www.optapy.org/docs/latest/planner-configuration/planner-configuration.html If you were able to do it this way, please let us know how you did it.

I would like to read sample code.

0

There are 0 best solutions below