如何优化有很多约束的问题

问题描述

我想最大程度地减少配给绵羊的食物的成本,例如绵羊需要(PDI,出租车,Pabs,UFL,UEM ...)并有需要的食物。就像这张照片一样:

enter image description here

每种食物都有一个价格,其中价格是每种食物的价格总和*定量的数量 但是要实现这一目标有很多限制,其中一个主题是方程式,其中变量是定量食物中食物的百分比之和* UEM的值 我将把取决于许多变量的方程式放进去:

enter image description here

和约束是这样的:

Apport PDIEration >= PDI

Rmic >= Rmic de l’animal

cost = ([∑(Pi *Prix Ci)]*Qc + [∑(Pi *Prix fi)]*Qf)

我想用Java做。

解决方法

使用优化库,例如Apache Commons Math(https://commons.apache.org/proper/commons-math/userguide/optimization.html)或Google OR-tools(https://developers.google.com/optimization/introduction/java

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...