public class XPRBsol
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
delVar(XPRBvar var)
Delete a variable assignment from a solution.
|
int |
getSize()
Get the size of a solution.
|
java.lang.Double |
getVar(XPRBvar var)
Get the value assignet to a variable in a solution.
|
boolean |
isValid()
Test whether a solution is correctly defined.
|
void |
print()
Print out a solution.
|
void |
setVar(XPRBvar var,
double value)
Add a variable assignment in a solution.
|
public boolean isValid()
XPRBsol sol1;
if(sol1.isValid() == false)
System.out.println("Error in sol definition.");
public void setVar(XPRBvar var, double value)
XPRBprob expl1;
XPRBvar x1, x2;
XPRBsol sol1;
expl1 = new XPRBprob("example1");
x1 = expl1.newVar("abc3", XPRB.UI, 1, 100);
x2 = expl1.newVar("abc1", XPRB.PL, 0, XPRB.INFINITY);
sol1 = expl1.newSol();
sol1.setVar(x1,1.0);
sol1.setVar(x2,0.0);
var - a variable of type XPRBvarvalue - a double constantpublic java.lang.Double getVar(XPRBvar var)
XPRBprob expl1;
XPRBvar x1, x2;
XPRBsol sol1;
double val1;
expl1 = new XPRBprob("example1");
x1 = expl1.newVar("abc3", XPRB.UI, 1, 100);
sol1 = expl1.newSol();
sol1.setVar(x1,1.0);
val1 = sol1.getVar(x1, value);
var - a variable of type XPRBvarpublic void delVar(XPRBvar var)
XPRBprob expl2;
XPRBvar x1;
XPRBsol sol1;
expl2 = new XPRBprob("example2");
x1 = expl2.newVar("abc3", XPRB.UI, 1, 100);
sol1 = expl2.newSol();
sol1.addVar(x1, 1.0);
sol1.delVar(x1);
var - a variable of type XPRBvarpublic int getSize()
XPRBprob expl2;
XPRBvar x1;
XPRBsol sol1;
int size;
expl2 = new XPRBprob("example2");
x1 = expl2.newVar("abc3", XPRB.UI, 1, 100);
sol1 = expl2.newSol();
sol1.addVar(x1, 1.0);
size = sol1.getSize();
public void print()
XPRBprob expl2;
XPRBsos set1;
expl2 = new XPRBprob("example2");
sol1 = expl2.newSol();
sol1.print();