Package net.sf.javailp

Examples of net.sf.javailp.Linear


      double factor1, EleConnector var1,
      double factor2, EleConnector var2,
      double factor3, EleConnector var3,
      String op, double limit) {
   
    Linear linear = new Linear();
   
    double limitCorrection = 0;
   
    if (var1 != null) {
      LPVariablePair c1 = variableMap.get(var1);
      linear.add(factor1, c1.posVar());
      linear.add(-factor1, c1.negVar());
      limitCorrection += factor1 * var1.getPosXYZ().y;
    }
   
    if (var2 != null) {
      LPVariablePair c2 = variableMap.get(var2);
      linear.add(factor2, c2.posVar());
      linear.add(-factor2, c2.negVar());
      limitCorrection += factor2 * var2.getPosXYZ().y;
    }
   
    if (var3 != null) {
      LPVariablePair c3 = variableMap.get(var3);
      linear.add(factor3, c3.posVar());
      linear.add(-factor3, c3.negVar());
      limitCorrection += factor3 * var3.getPosXYZ().y;
    }
   
    problem.add(linear, op, limit - limitCorrection);
   
View Full Code Here


   
  }
 
  private Linear constructObjective() {
 
    Linear objectiveLinear = new Linear();
   
    for (LPVariablePair v : variables) {
     
      if (v.getConnectors().get(0).groundState == ON) {
       
        objectiveLinear.add(1, v.posVar());
        objectiveLinear.add(1, v.negVar());
       
      }
     
    }
   
View Full Code Here

TOP

Related Classes of net.sf.javailp.Linear

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.