首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将Excel求解器转换为java

将Excel求解器转换为java
EN

Stack Overflow用户
提问于 2013-07-30 16:31:17
回答 2查看 3.2K关注 0票数 0

我正在尝试将Excel Solver解决方案转换为java应用程序

excel求解器是

代码语言:javascript
复制
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/

代码语言:javascript
复制
    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求解器函数联系起来,我的数学不是很好

EN

回答 2

Stack Overflow用户

发布于 2013-07-30 16:39:53

有一个Simplexsolver implementation in Apache Commons Math,但我不能说任何关于性能或可能的问题大小。寻找优化问题的非属性解决方案可能很棘手,因为很难有效地优化大型问题,而且这是一个正在进行的研究领域,只有一只手才能找到好的商业/研究解决方案。

如果你想把excelfiles作为输入,你需要对数据进行解析和转换。要读取Excel文件,您可以使用Apache POI

票数 0
EN

Stack Overflow用户

发布于 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/

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17942001

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档