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

Class that defines heuristics that use expected times for blocks, computed by Bienstock Zuckerberg algorithm (BZ). More...

#include <etheuristics.h>

Inheritance diagram for delphos::BZHeuristic:
Inheritance graph
Collaboration diagram for delphos::BZHeuristic:
Collaboration graph

Public Member Functions

 BZHeuristic (delphos::SchedulingInstance &si, delphos::FinalPitSolver *fps=NULL)
 Defines a BZ heuristic to solve given scheduling instance. More...
 
virtual ~BZHeuristic ()
 The destructor.
 
virtual bool Run ()
 Run the BZ that defines expected times, then the ETInc heuristic.
 
bool RunBZ (unsigned int nbitermax=1000000)
 Run the Bienstock Zuckerberg algorithm.
 
void SetMipAsPitSolver ()
 use MIP solver for flow model instead of flow algorithm in BZ.
 
double * GetRelaxedSol ()
 Returns the relaxed sol encountered by the BZ. RunBZ() method have to be applied before using this method.
 
double * GetRelaxedDecisionSol ()
 Returns the relaxed decision sol encountered by the BZ. RunBZ() method have to be applied before using this method.
 
vector< double > GetExpectedTime ()
 Returns the expected times. RunBZ() method have to be applied before using this method.
 
bool SetExpectedTime (const string &column)
 Save expected times as a block model attribute with given name. More...
 
bool ExpectedTimeToTextFile (const char *exptime_file) const
 Writes the expected times in given file. More...
 
bool RunTopoHeur ()
 Run the modified Topological sort heuristic. RunBZ() method have to be applied before using this method.
 
void SetHeurParameters (const unsigned int &windowsize, const float &delta, const unsigned int &step)
 Run the ETInc heuristic. More...
 
bool CheckRelaxedSol ()
 Check If the relaxed solution respect the constraints defined in the scheduling instance. RunBZ() method have to be applied before using this method.
 
bool RelaxedSolToTextFile (const char *relsol_file, const char *stocks_file="")
 Writes the relaxed solution in given text files. More...
 
void SetGap (const double &gap)
 Set the desired relative integer gap used by solving sub problems of ETInc and ETDelta.
 
const double GetGap () const
 Returns the desired gap.
 
void SetEmphasis (const Model::Emphasis &emph)
 Set the desired emphasis used by solving sub problems of ETInc and ETDelta. The emphasis can be Model::Emphasis::FEASABILITY, Model::Emphasis::OPTIMALITY or Model::Emphasis::BALANCED.
 
const Model::Emphasis GetEmphasis () const
 Returns the desired emphasis.
 
double GetRelaxedObj ()
 Returns the relaxed objective encountered by BZ. RunBZ() method have to be applied before using this method.
 
unsigned int GetNBIterationsBZ ()
 Returns the number of iterations of BZ algorithm. RunBZ() method have to be applied before using this method.
 
const map< string, double > & GetBZDuals ()
 Returns the dual value encountered by BZ for each constraint. RunBZ() method have to be applied before using this method.
 
bool IsFeasible ()
 Returns true only if BZ run correctly. RunBZ() method have to be applied before using this method.
 
- Public Member Functions inherited from delphos::SchedulingHeuristic
 SchedulingHeuristic (SchedulingInstance &si)
 Creates a heuristic with given scheduling instance. More...
 
virtual ~SchedulingHeuristic ()
 The destructor.
 
const ScheduleGetSchedule ()
 Returns the result schedule.
 
void SetCallBack (delphos::CallBackPtr fp)
 Set a time advance user callback. More...
 
delphos::CallBackPtr GetCallBack ()
 Returns the call back if it exists.
 
const bool Optimized ()
 Returns true only if the MIP have been succesfully optimized.
 
void SetLogFile (const string &name)
 Set the use of the log with given file name. More...
 
- Public Member Functions inherited from delphos::Scheduler
 Scheduler (delphos::SchedulingInstance &si)
 Creates a new scheduler. More...
 
virtual ~Scheduler ()
 The destructor.
 
delphos::SchedulingInstanceGetInstance ()
 Returns the associated scheduling instance.
 
virtual void SetGap (const float &gap)
 Sets the desired gap for the optimization. More...
 
const bool IsStock ()
 Returns true only if the inner scheduling instance has stoks.
 
- 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...
 

Additional Inherited Members

- Static Public Attributes inherited from delphos::Scheduler
static const string CBC_MIPScheduler =string("CBC_MIPScheduler")
 Name of the CBC MIP scheduler.
 
static const string CBC_SlidingTimeWindowHeuristic =string("CBC_SlidingTimeWindowHeuristic")
 Name of the CBC implemtation of the sliding time window heuristic.
 
static const string GUROBI_MIPScheduler =string("GUROBI_MIPScheduler")
 Name of the gurobi MIP scheduler.
 
static const string GUROBI_SlidingTimeWindowHeuristic =string("GUROBI_SlidingTimeWindowHeuristic")
 Name of the gurobi implemtation of the sliding time window heuristic.
 

Detailed Description

Class that defines heuristics that use expected times for blocks, computed by Bienstock Zuckerberg algorithm (BZ).

Constructor & Destructor Documentation

delphos::BZHeuristic::BZHeuristic ( delphos::SchedulingInstance si,
delphos::FinalPitSolver fps = NULL 
)

Defines a BZ heuristic to solve given scheduling instance.

Parameters
siThe sheduling instance that defines the problem to be solved.
fpsThe finalpit solver that will be used by the BZ algorithm. The implementation of the heuristics creates a schedule and not a fractional schedule. If the scheduling instance has got the PCPSP flag on, an exception is thrown.

Member Function Documentation

bool delphos::BZHeuristic::ExpectedTimeToTextFile ( const char *  exptime_file) const

Writes the expected times in given file.

Parameters
exptime_fileThe name of the file in which the expected times are written.
bool delphos::BZHeuristic::RelaxedSolToTextFile ( const char *  relsol_file,
const char *  stocks_file = "" 
)

Writes the relaxed solution in given text files.

Parameters
relsol_fileThe file in which the relaxed solution for the blocks is written.
stocks_fileThe file in which the relaxed solution for the stocks is written. RunBZ() method have to be applied before using this method.
bool delphos::BZHeuristic::SetExpectedTime ( const string &  column)

Save expected times as a block model attribute with given name.

Parameters
columnThe column attribute name in which the expected times will be saved.
void delphos::BZHeuristic::SetHeurParameters ( const unsigned int &  windowsize,
const float &  delta,
const unsigned int &  step 
)

Run the ETInc heuristic.

Parameters
windowsizeThe window size of the ETInc heuristic
deltaThe delta used to the expected time to select the blocks.
stepThe step of the ETInc.
sched_nameThe scheduler name to be used to solve the sub problems. RunBZ() method have to be applied before using this method. ETinc heuristic is a rolling time type heuristic. It uses esperate times to select which blocks will be selected to be scheduled for the current window. A block is selected for the current time window if its esperate time is inferior or equal to delta + upper bound of current time window. Default values for the window size is 1 period, default value for delta is 0.5, default step is 1 period. Set the heuristics parameters
windowsizeThe window size.
deltaThe delta value.
stepThe step.

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