|
|||||
FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A set of variables with a common name and different indices. This object consists of - a set of (symbolic) index values of the variables in the set - a closure which generates the individual variables; the closure is called with the symbolic index of the variable and shall return a list of arguments which will be given to the constructor of a single GVariable (either only a single double value for the coefficient of the variable or the coefficient + a range of allowed values for the variable). - the environment in which the index variable shall be bound See the documentation of GVariable to see the supported constructors. This class is responsible for mapping between the simple indices of the variables in the LPVariableSequence and the symbolic indices in the GLPModel.
Field Summary | |
---|---|
Object |
env
|
Closure |
generateVar
|
GIndexBinding |
idxBinding
|
Constructor Summary | |
GVariables(String name, Object bindDef, Object env, Closure generateVar)
Constructor Create a set of variables based on a binding of index variables. |
Method Summary | |
---|---|
GVariable |
constructVariable(def varDef)
Construct a GVariable object. |
LPVariable |
getLPVariable(int localColumn)
Construct LP-variable that corresponds to a given simple numeric index in the variable sequence |
int |
getLocalColumn(Object idx)
Convert a symbolic index into a simple numeric index |
LPModelIndex |
getModelIndex(Object idx)
|
String |
getName()
|
int |
getNumVars()
|
double |
getSolution(Object idx, GLPSolver solver)
|
Map |
getSolutions(GLPSolver solver)
|
void |
setName(String name)
|
String |
toString()
|
String |
toSummaryString()
|
def |
varIdx(int localColumn)
Convert a simple numeric index into a symbolic index in the binding |
Constructor Detail |
---|
public GVariables(String name, Object bindDef, Object env, Closure generateVar)
Method Detail |
---|
GVariable constructVariable(def varDef)
LPVariable getLPVariable(int localColumn)
public int getLocalColumn(Object idx)
LPModelIndex getModelIndex(Object idx)
String getName()
int getNumVars()
public double getSolution(Object idx, GLPSolver solver)
public Map getSolutions(GLPSolver solver)
void setName(String name)
public String toString()
public String toSummaryString()
def varIdx(int localColumn)