2013-07-30 26 views
0

我想一個Excel求解解決方案轉換爲Java應用程序轉換Excel求解器的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 

我一直goggling了一段時間,並不能找到一個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的求解器的功能,如果你正在尋找一個API來讀我的數學是不是很大

+0

你到目前爲止試過了什麼?面對任何特定的問題? – araknoid

+0

這是你在找什麼? http://poi.apache.org/ – bas

+0

我不認爲閱讀excel文件是問題,但實際問題解決/優化。 – ssindelar

回答

0

有一個Simplexsolver implementation in Apache Commons Math,但我不能說性能或可能的問題大小。爲優化問題尋找非房地產解決方案可能會非常棘手,因爲很難有效地優化大型問題規模,而且只有一手掌握好商業/研究解決方案纔是持續的研究領域。

如果你想保持excelfiles作爲輸入,你需要解析數據並進行轉換。爲了閱讀Excel文件,您可以使用Apache POI

+0

Apache公共數學不支持非線性GRG – user2205623