Hi.
Is there a way to instruct the solver to find values if possible and only if not found increase the precision step by step?
A user specifies max number of digits after decimal point e.g. 0, 2 or 4 and the range of variable values e.g. (-100, 100)
- solver tries to find a solution
- if the solution does not exist then the solver should try to solve with maximum number of digits after the decimal point
A more useful approach would be if the solver tries to increase number of digits and ranges step by step and finds a solution with the configuration closest to the original request of the user.
E.g. user asks for a solution with variable ranges (-100,100) and maximum or 2 digits after decimal points.
Then the solver may need to run several passes and log the outcome.
In each pass, the solver broadens the range (by multiplying by 10) and precision (by adding 2 digits)
Pass 1: no solution found for variable range: [-100,100], precision: 2 digits
Pass 2: no solution found for variable range: [-1000,1000], precision: 4 digits
Pass 3: no solution found for variable range: [-10000,10000], precision: 6 digits
Pass 4: no solution found for variable range: [-100000,100000], precision: 8 digits
Pass 5: SOLUTION FOUND for variable range: [-1000000,1000000], precision: 10 digits:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The solver cannot be "instructed" to extend the domains but you can write a program that builds your model with variable ranges (-100, 100) and calls search. If thissearch fails you build the model again but, in this case, with broader ranges and again calls the search. You can do it untill a solution is found.
/Kris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi.
Is there a way to instruct the solver to find values if possible and only if not found increase the precision step by step?
A user specifies max number of digits after decimal point e.g. 0, 2 or 4 and the range of variable values e.g. (-100, 100)
- solver tries to find a solution
- if the solution does not exist then the solver should try to solve with maximum number of digits after the decimal point
A more useful approach would be if the solver tries to increase number of digits and ranges step by step and finds a solution with the configuration closest to the original request of the user.
E.g. user asks for a solution with variable ranges (-100,100) and maximum or 2 digits after decimal points.
Then the solver may need to run several passes and log the outcome.
In each pass, the solver broadens the range (by multiplying by 10) and precision (by adding 2 digits)
Pass 1: no solution found for variable range: [-100,100], precision: 2 digits
Pass 2: no solution found for variable range: [-1000,1000], precision: 4 digits
Pass 3: no solution found for variable range: [-10000,10000], precision: 6 digits
Pass 4: no solution found for variable range: [-100000,100000], precision: 8 digits
Pass 5: SOLUTION FOUND for variable range: [-1000000,1000000], precision: 10 digits:
Hi!
The solver cannot be "instructed" to extend the domains but you can write a program that builds your model with variable ranges (-100, 100) and calls search. If thissearch fails you build the model again but, in this case, with broader ranges and again calls the search. You can do it untill a solution is found.
/Kris
Thank you
Kris.
Best Artur.