public class LpProblemBuilder
Helper class to build LpProblem.
| Constructor and Description |
|---|
LpProblemBuilder()
Helper class to build LpProblem.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConstraint(LpConstraint c)
Adds new constraint. Fails if already added or if it uses variable not added via
addVariable call. |
void |
addVariable(LpVariable v)
Adds new variable. Fails if there already is a variable with given name.
|
LpProblem |
build()
Builds LpProblem.
|
java.util.Set<net.ldvsoft.simplex_lp_solver.LpConstraint> |
getConstraints()
Constraints added to a problem.
Add via
addConstraint. |
LpFunction |
getFunction()
Function to optimize. Setter fails if uses variable not added via
addVariable call.
Must be assigned before build(). |
java.util.Collection<net.ldvsoft.simplex_lp_solver.LpVariable> |
getVariables()
Variables registered to be used in a problem.
Add via
addVariable. |
void |
setFunction(LpFunction newValue)
Function to optimize. Setter fails if uses variable not added via
addVariable call.
Must be assigned before build(). |
public java.util.Collection<net.ldvsoft.simplex_lp_solver.LpVariable> getVariables()
Variables registered to be used in a problem.
Add via addVariable.
public java.util.Set<net.ldvsoft.simplex_lp_solver.LpConstraint> getConstraints()
Constraints added to a problem.
Add via addConstraint.
public LpFunction getFunction()
Function to optimize. Setter fails if uses variable not added via addVariable call.
Must be assigned before build().
public void setFunction(LpFunction newValue)
Function to optimize. Setter fails if uses variable not added via addVariable call.
Must be assigned before build().
public LpProblem build()
Builds LpProblem.
public void addVariable(LpVariable v)
Adds new variable. Fails if there already is a variable with given name.
public void addConstraint(LpConstraint c)
Adds new constraint. Fails if already added or if it uses variable not added via
addVariable call.