by AYBABTME · 7y ago · 0 comments
There's many problems I would like to solve using some sort of model definition with constraints given, and variable(s) to optimize. Either to aid in guiding the design of a system, or using generative design.
Example:
- Electrical power, voltage and amperage constraints along with physical size constraints, in a circuit model.
- Data size and throughput and concurrency constraints in a distributed system models.
I have a feeling there must be well known techniques and/or tools to do these kind of general purpose constraint modelling, but I can't put my finger on it. The closest that comes to mind is using Prolog, but I've only used it with boolean type of constraints.Personally, I find the languages and methods used in constraint programming (CP) to define models the most clear, even though that is not always the best way to actaully solve the problems.
To write CP models, the MiniZinc language is quite nice and has support for using many different solvers on the back end. The MiniZinc website (https://www.minizinc.org/) has quite a lot of documentation. For an outsider perspective, Hillel Wayne wrote an interesting blog post on using MiniZinc (https://hillelwayne.com/post/minizinc/).
this is only one of many options but it’s a good one.