我正在尝试将Excel Solver解决方案转换为java应用程序
excel求解器是
Solver Parameters:
Set Objective: D24 to Max
By Changing Variable Cells: C4:C23
Subject to the Constraints:
C24 = B24
L24 <= N24
L25 >= N25
(non-negative)
GRG Nonlinear我已经搜索了一段时间,但找不到一个java库来实现这一点。有什么想法吗?
我试过巧克力解算器http://www.emn.fr/z-info/choco-solver/
Solver solver = new Solver("my first problem");
// 2. Create variables through the variable factory
IntVar x = VariableFactory.bounded("X", 0, 5, solver);
IntVar y = VariableFactory.bounded("Y", 0, 5, solver);
// 3. Create and post constraints by using constraint factories
solver.post(IntConstraintFactory.arithm(x, "+", y, "<", 5));
// 4. Define the search strategy
solver.set(IntStrategyFactory.inputOrder_InDomainMin(new IntVar[]{x,y} ));
// 5. Launch the resolution process
if (solver.findSolution()) {
do {
prettyOut();
}
while (solver.nextSolution());
}我发现很难将它与Excel求解器函数联系起来,我的数学不是很好
发布于 2013-07-30 16:39:53
有一个Simplexsolver implementation in Apache Commons Math,但我不能说任何关于性能或可能的问题大小。寻找优化问题的非属性解决方案可能很棘手,因为很难有效地优化大型问题,而且这是一个正在进行的研究领域,只有一只手才能找到好的商业/研究解决方案。
如果你想把excelfiles作为输入,你需要对数据进行解析和转换。要读取Excel文件,您可以使用Apache POI。
发布于 2013-07-30 16:33:35
如果您正在寻找用于读取和写入microsoft文档的API,请查看Apache POI:
http://poi.apache.org/
http://viralpatel.net/blogs/java-read-write-excel-file-apache-poi/
https://stackoverflow.com/questions/17942001
复制相似问题