net.sourceforge.combean.mathprog.lp.model
Class ConstructableLPModel

Package class diagram package ConstructableLPModel
java.lang.Object
  extended by net.sourceforge.combean.mathprog.lp.model.ConstructableLPModel
All Implemented Interfaces:
LPModel

public class ConstructableLPModel
extends Object
implements LPModel

An LP model which can be constructed by sequentially adding rows, columns etc. The purpose of the LP model is to collect the components of an LP before the LP is loaded into the solver, using an instance of LPModelSolver. Please note that the implementation of LPModelSolver may impose certain restrictions on how the components may be put together. Please refer to the documentation of the LPModelSolver that you plan to use.


Constructor Summary
ConstructableLPModel()
          constructor for an empty LP model.
 
Method Summary
 void addConstraintSequence(LPConstraintSequence constrSeq)
          Add a constraint sequence.
 void addVariableSequence(LPVariableSequence varSeq)
          Add a variable sequence.
 void appendModelComponent(LPModelComponent component)
          Add a model component.
 LPConstraintSequence getConstraintSequence(String rowOffsetId)
          Get the constraint sequence for a given offset identifier.
 Iterator getConstraintSequences()
          Get an iterator through sequences of constraints.
 Iterator getModelComponents()
          Get an iterator through all components of the model.
 int getNumColumns()
          The number of columns in the model.
 int getNumRows()
          The number of rows in the model.
 LPVariableSequence getVariableSequence(String columnOffsetId)
          Get the variable sequence for a given offset identifier.
 Iterator getVariableSequences()
          Get an iterator through sequences of variables.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstructableLPModel

public ConstructableLPModel()
constructor for an empty LP model.

Method Detail

getNumColumns

public int getNumColumns()
Description copied from interface: LPModel
The number of columns in the model.

Specified by:
getNumColumns in interface LPModel
Returns:
the number of columns.

getNumRows

public int getNumRows()
Description copied from interface: LPModel
The number of rows in the model.

Specified by:
getNumRows in interface LPModel
Returns:
the number of rows.

getConstraintSequences

public Iterator getConstraintSequences()
Description copied from interface: LPModel
Get an iterator through sequences of constraints.

Specified by:
getConstraintSequences in interface LPModel
Returns:
an iterator through sequences of constraints.

getVariableSequences

public Iterator getVariableSequences()
Description copied from interface: LPModel
Get an iterator through sequences of variables.

Specified by:
getVariableSequences in interface LPModel
Returns:
an iterator through sequences of variables.

getModelComponents

public Iterator getModelComponents()
Description copied from interface: LPModel
Get an iterator through all components of the model.

Specified by:
getModelComponents in interface LPModel
Returns:
an iterator through all components of the model.

getConstraintSequence

public LPConstraintSequence getConstraintSequence(String rowOffsetId)
Description copied from interface: LPModel
Get the constraint sequence for a given offset identifier.

Specified by:
getConstraintSequence in interface LPModel
Parameters:
rowOffsetId - the offset identifier for the row.
Returns:
the corresponding constraint sequence (or null if no matching sequence exists).

getVariableSequence

public LPVariableSequence getVariableSequence(String columnOffsetId)
Description copied from interface: LPModel
Get the variable sequence for a given offset identifier.

Specified by:
getVariableSequence in interface LPModel
Parameters:
columnOffsetId - the offset identfier for the column.
Returns:
the correponding variable sequence. (or null if no matching sequence exists).

addConstraintSequence

public void addConstraintSequence(LPConstraintSequence constrSeq)
Add a constraint sequence.

Parameters:
constrSeq - the constraint sequence to be added.

addVariableSequence

public void addVariableSequence(LPVariableSequence varSeq)
Add a variable sequence.

Parameters:
varSeq - the variable sequence to be added.

appendModelComponent

public void appendModelComponent(LPModelComponent component)
Add a model component.

Parameters:
component - the model component to be added.

toString

public String toString()
Overrides:
toString in class Object