module_lp_solver Namespace Reference
A solver module based on a linear programming algorithm. More...
Classes | |
class | LPSolver |
This class is a prototype of an Linear Programming (LP) Solver for the planning problem or a subset of it. More... | |
Functions | |
const char * | initialize (const CommandLoadLibrary::ParameterList &z) |
Variables | |
const Keyword | tag_datafile ("datafile") |
const Keyword | tag_modelfile ("modelfile") |
const Keyword | tag_objective ("objective") |
const Keyword | tag_solutionfile ("solutionfile") |
Detailed Description
A solver module based on a linear programming algorithm.
The solver is intended primarly for prototyping purposes. Cleaner and more performant alternatives are recommended for real production use.
The module uses the "Gnu Linear Programming Kit" library (aka GLPK) to solve the LP model.
The solver works as follows:
- The solver expects a model file and a data file as input.
The model file represents the mathematical representation of the problem to solve.
The data file holds the data to be loaded into the problem. If no data file is specified, the data section in the model file is used instead.
The user is responsible for creating these files. See the unit test lp_solver1 for an example. - The solver solves for a number of objectives in sequence.
After solving an objective's optimal value, the solver freezes the value as a constraint and start for the next objective. Subsequent objectives can thus never yield a solution that is suboptimal for the previous objectives. - After solving for all objectives the solution is written to a solution file.
The user is responsible for all processing of this solution file.
The XML schema extension enabled by this module is (see mod_lpsolver.xsd):
<xsd:complexType name="solver_lp"> <xsd:complexContent> <xsd:extension base="solver"> <xsd:choice minOccurs="0" maxOccurs="unbounded"> <xsd:element name="loglevel" type="loglevel" /> <xsd:element name="minimum" type="xsd:boolean" /> <xsd:element name="modelfile" type="xsd:normalizedString" /> <xsd:element name="datafile" type="xsd:normalizedString" /> <xsd:element name="solutionfile" type="xsd:normalizedString" /> <xsd:element name="objective" type="xsd:normalizedString" /> </xsd:choice> <xsd:attribute name="loglevel" type="loglevel" /> <xsd:attribute name="minimum" type="xsd:boolean" /> <xsd:attribute name="modelfile" type="xsd:normalizedString" /> <xsd:attribute name="datafile" type="xsd:normalizedString" /> <xsd:attribute name="solutionfile" type="xsd:normalizedString" /> <xsd:attribute name="objective" type="xsd:normalizedString" /> </xsd:extension> </xsd:complexContent> </xsd:complexType>
Function Documentation
const char* module_lp_solver::initialize | ( | const CommandLoadLibrary::ParameterList & | z | ) |
Initialization routine for the library.
Variable Documentation
const Keyword module_lp_solver::tag_datafile("datafile") |
const Keyword module_lp_solver::tag_modelfile("modelfile") |
const Keyword module_lp_solver::tag_objective("objective") |
const Keyword module_lp_solver::tag_solutionfile("solutionfile") |
Documentation generated for frePPLe by
