Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.apache.commons.jexl2.*;
- public class NelderMead {
- // константы
- private static int M = 3;
- private static double E = 0.005;
- private static double A = 1.000;
- private static double B = 0.500;
- private static double Y = 2.000;
- // переменные
- private JexlEngine jexl;
- private Expression func;
- private String funcString = "";
- private MapContext[] iterations;
- public NelderMead(){
- this.jexl = new JexlEngine(null, new FullMath(true), null, null);
- }
- public NelderMead(String funcString){
- this.jexl = new JexlEngine(null, new FullMath(true), null, null);
- this.setFunc(funcString);
- }
- public void setFunc(String funcString){
- this.funcString = funcString;
- this.func = this.jexl.createExpression(funcString);
- }
- public Object funcEval(MapContext args){
- return this.func.evaluate(args);
- }
- public boolean checkCriterian(){
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment