MineLink
 All Data Structures Functions Variables Pages
delphos::GurobiFractionalScheduler Class Reference

Abstracts a Gurobi LP solver that can solve a scheduling instance. More...

#include <gurobi_fractional_scheduler.h>

Inheritance diagram for delphos::GurobiFractionalScheduler:
Inheritance graph
Collaboration diagram for delphos::GurobiFractionalScheduler:
Collaboration graph

Public Member Functions

 GurobiFractionalScheduler (delphos::SchedulingInstance &si)
 Creates a gurobi fractional scheduler with given scheduling instance. More...
 
virtual ~GurobiFractionalScheduler ()
 The destructor.
 
virtual bool Run ()
 Generates the model in Gurobi and optimize it. More...
 
bool CreateModel ()
 Inits the solver and load the model in gurobi. More...
 
void WriteLP (const string outfile)
 Writes the LP model in given file. More...
 
void WriteSol (const string outfile)
 Writes the solution in given file. More...
 
double GetSol (const BlockIndexType &block_index, const unsigned int &period, const unsigned int &destination)
 Returns the solution value for a block period and destination. More...
 
GurobiModel & GetMathematicalModel ()
 Returns the mathematical model.
 
double GetObjValue ()
 Returns the objective value of the optimized model.
 
void SetOptimizationSense (const Model::OptimizationSense &sense)
 Set the sense of the optimization model. More...
 
void SetLogFile (const string &name)
 Set the use of the log with given file name. More...
 
const bool IsStock ()
 Return true only if the inner scheduling instance has stoks.
 
const double GetDual (const string &cname)
 Returns the dual value of given constraint. More...
 
void ComputeExpectedTime (const string column)
 Computes the expected times. More...
 
const delphos::FractionalScheduleGetFractionalSchedule ()
 Returns the result fractional schedule.
 
- Public Member Functions inherited from delphos::FractionalScheduler
 FractionalScheduler (delphos::SchedulingInstance &si)
 Creates a new scheduler. More...
 
virtual ~FractionalScheduler ()
 The destructor.
 
delphos::SchedulingInstanceGetInstance ()
 Returns the associated scheduling instance.
 
virtual const bool Optimized ()
 Returns true only if the scheduler has run succesfully.
 
void SetLPMethod (const int &lpcode)
 Set LP method. More...
 
- Public Member Functions inherited from delphos::BlockModelEntity
 BlockModelEntity (delphos::BlockModel &bm)
 Creates a new block instance associated to a given block model. More...
 
delphos::BlockModelGetBlockModel ()
 Retrieves the block model to which the entity is associated. More...
 
const delphos::BlockModelGetBlockModel () const
 Retrieves the block model to which the entity is associated. More...
 

Detailed Description

Abstracts a Gurobi LP solver that can solve a scheduling instance.

Constructor & Destructor Documentation

delphos::GurobiFractionalScheduler::GurobiFractionalScheduler ( delphos::SchedulingInstance si)

Creates a gurobi fractional scheduler with given scheduling instance.

Parameters
siThe scheduling instance of the gurobi MIP scheduler.

Member Function Documentation

void delphos::GurobiFractionalScheduler::ComputeExpectedTime ( const string  column)
virtual

Computes the expected times.

Parameters
columnThe column name in which the expected times are saved.

Reimplemented from delphos::FractionalScheduler.

bool delphos::GurobiFractionalScheduler::CreateModel ( )

Inits the solver and load the model in gurobi.

Return true if the model has been successfully loaded in gurobi.

const double delphos::GurobiFractionalScheduler::GetDual ( const string &  cname)
virtual

Returns the dual value of given constraint.

Parameters
cnameThe name of the constraint of which the dual value is returned.

the cname of constraint of original name name can be name_lower and name_upper that corresponds to lower bound constraint and upper bound constraint.

Reimplemented from delphos::FractionalScheduler.

double delphos::GurobiFractionalScheduler::GetSol ( const BlockIndexType &  block_index,
const unsigned int &  period,
const unsigned int &  destination 
)

Returns the solution value for a block period and destination.

Parameters
block_indexThe index of the block in the block model.
periodThe period.
destinationThe destination.
bool delphos::GurobiFractionalScheduler::Run ( )
virtual

Generates the model in Gurobi and optimize it.

Return true only if the model has been successfully optimized.

Reimplemented from delphos::FractionalScheduler.

void delphos::GurobiFractionalScheduler::SetLogFile ( const string &  name)
virtual

Set the use of the log with given file name.

Parameters
nameThe name of the log file.

Reimplemented from delphos::FractionalScheduler.

void delphos::GurobiFractionalScheduler::SetOptimizationSense ( const Model::OptimizationSense &  sense)

Set the sense of the optimization model.

Parameters
senseThe sense of the optimization. The sense can be Model::OptimizationSense::MINIMIZATION or Model::OptimizationSense::MAXIMIZATION.
void delphos::GurobiFractionalScheduler::WriteLP ( const string  outfile)

Writes the LP model in given file.

Parameters
outfileThe name of the outfile in which the model is writen in LP format. Return true only if the model has been successfully writen in the LP format in given file. This method can only be used after the method InitSolver.
void delphos::GurobiFractionalScheduler::WriteSol ( const string  outfile)

Writes the solution in given file.

Parameters
outfileThe name of the outfile in which the solution of the model is writen. Return true only if the solution of the model has been successfully writen in given file. This method can only be used after the method RunSolver.

The documentation for this class was generated from the following files: