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

Defines a scheduling instance to be solved. More...

#include <instance.h>

Inheritance diagram for delphos::SchedulingInstance:
Inheritance graph
Collaboration diagram for delphos::SchedulingInstance:
Collaboration graph

Public Member Functions

 SchedulingInstance (const delphos::BlockSelection &bs, const unsigned int &horizon, const double discount_rate=0.0, const bool &is_pcpsp=false)
 Creates a new scheduler instance on a given instance, horizon and discount rate. More...
 
 SchedulingInstance (delphos::BlockModel &bm, const unsigned int &horizon, const string &name_attr, const double discount_rate=0.0, const bool &is_pcpsp=false)
 Creates a new scheduler instance on a given instance, horizon and discount rate. More...
 
 SchedulingInstance (delphos::SchedulingInstance &other)
 Copy constructor. More...
 
 SchedulingInstance (delphos::BlockModel &bm, const char *ml_file_name, const bool &is_pcpsp=false)
 Construct instance from cpit or pcpsp MineLib file . More...
 
 SchedulingInstance (delphos::BlockModel &bm, const unsigned int &horizon, const double discount_rate=0.0, const bool &is_pcpsp=false)
 Creates a new scheduler instance on a given instance, horizon and discount rate. More...
 
virtual ~SchedulingInstance ()
 Destructor.
 
void AddConstraint (delphos::Constraint *ctr)
 Adds an additional constraint to the scheduling instance. More...
 
bool RemoveConstraint (const unsigned int &index)
 Removes the ith constraint from the instance. More...
 
const unsigned int NumConstraints () const
 Returns the number of constraints already included in the instance. Deprecated.
 
const unsigned int GetNumConstraints () const
 Returns the number of constraints already included in the instance.
 
const delphos::ConstraintGetConstraint (const unsigned int &index) const
 Returns the i-th constraint already in the model. More...
 
void AddDestination (const Destination &dest)
 Adds an additional destination to the scheduling instance. More...
 
void AddDestination (const string &destname, const string &destvalueattrname)
 Adds an additional destination to the scheduling instance. More...
 
delphos::DestinationList & Destinations ()
 returns the list of destinations in the instance. Deprecated.
 
delphos::DestinationList & GetDestinations ()
 returns the list of destinations in the instance.
 
void AddStock (const Stock &stock)
 Adds an additional stock to the scheduling instance. More...
 
void AddStock (const string &stock_name, const string &tname, const double &tonnage)
 Adds an additional stock to the scheduling instance. More...
 
delphos::StockList & Stocks ()
 returns the stocks defined in the instance.
 
delphos::StockList & GetStocks ()
 returns the stocks defined in the instance.
 
const bool IsStock ()
 returns true only if there is stock.
 
void SetFixedDiscountRate (const double discount_rate)
 (Re-)sets a discount rate that is fixed over the time-periods. More...
 
double GetFixedDiscountRate () const
 Returns the Fixed Discount rate.
 
void SetUpdateFactor (const unsigned int period, const double factor)
 Sets a specific update factor for a specific time-period. More...
 
const double GetUpdateFactor (const unsigned int period) const
 Retrieves the current discount rate for an specific time-period.
 
const unsigned int Horizon () const
 returns the time horizon of the instance. Deprecated.
 
const unsigned int GetHorizon () const
 returns the time horizon of the instance.
 
const delphos::BlockSelectionGetBlockSelection () const
 returns the block selection affected to the instance.
 
virtual void Report ()
 reports the informations about the instance.
 
delphos::SchedulingInstanceAggregateTime (const unsigned int &startperiod, const std::vector< int > &period_unit)
 returns a new time aggregated sheduling instance. More...
 
bool IsPCPSP () const
 returns true only if it is a PCPSP instance.
 
- 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

Defines a scheduling instance to be solved.

A scheduling instance is a problem in which blocks need to be scheduled for extraction over a number of time periods and several different constraints.

This class abstracts the problem considering multiple possible destinations, pre-existing stocks and generic constraints.

Constructor & Destructor Documentation

delphos::SchedulingInstance::SchedulingInstance ( const delphos::BlockSelection bs,
const unsigned int &  horizon,
const double  discount_rate = 0.0,
const bool &  is_pcpsp = false 
)

Creates a new scheduler instance on a given instance, horizon and discount rate.

Parameters
bsThe given block selection to be scheduled.
horizonThe number of periods over which to perform the scheduling.
discount_rateThe discount rate to apply at the end of each time-period.
is_pcpspThe flag that determines if the scheduling instance is used to define a PCPSP model or a full integer model.

These are the minimal elements to specify a scheduling instance.

Different possible process (or "destinations") are defined later, as well as the stocks and additional constraints.

While this constructor allows to specify a constant discount rate, there are also specific method to specify different discount rates per time-period. Note that there is a difference with MineLib in the definition of the discount factor. In case of a discount rate > 0 , for us, for all periods, the discount factor < 1.

delphos::SchedulingInstance::SchedulingInstance ( delphos::BlockModel bm,
const unsigned int &  horizon,
const string &  name_attr,
const double  discount_rate = 0.0,
const bool &  is_pcpsp = false 
)

Creates a new scheduler instance on a given instance, horizon and discount rate.

Parameters
bmThe block model to be scheduled.
horizonThe number of periods over which to perform the scheduling.
name_attrThe name of the attribute that be used to determine a block selection.
discount_rateThe discount rate to apply at the end of each time-period.
is_pcpspThe flag that determines if the scheduling instance is used to define a PCPSP model or a full integer model.

The attribute name is used to create a block selection consisting of blocks such that a certain block value corresponding to the attribute name is different from zero. Note that there is a difference with MineLib in the definition of the discount factor. In case of a discount rate > 0 , for us, for all periods, the discount factor < 1.

delphos::SchedulingInstance::SchedulingInstance ( delphos::SchedulingInstance other)

Copy constructor.

Parameters
otherOther scheduling instance to be copied.
delphos::SchedulingInstance::SchedulingInstance ( delphos::BlockModel bm,
const char *  ml_file_name,
const bool &  is_pcpsp = false 
)

Construct instance from cpit or pcpsp MineLib file .

Parameters
bmThe block model to be scheduled.
ml_file_nameThe MineLib filename from which the instance will be constructed.
is_pcpspThe flag that determines if the scheduling instance is used to define a PCPSP model or a full integer model. By default, when loading a pcpsp file, the full integer model is defined in the scheduling instance, PCPSP flag is off. To solve PCPSP model, is_pcpsp parameter have to be set to true. Blending constraints are not loaded this way. Blending constraints have to be added manually. Note that there is a difference with MineLib in the definition of the discount factor. In case of a discount rate > 0 , for us, for all periods, the discount factor < 1.
delphos::SchedulingInstance::SchedulingInstance ( delphos::BlockModel bm,
const unsigned int &  horizon,
const double  discount_rate = 0.0,
const bool &  is_pcpsp = false 
)

Creates a new scheduler instance on a given instance, horizon and discount rate.

Parameters
bmThe block model to be scheduled.
horizonThe number of periods over which to perform the scheduling.
discount_rateThe discount rate to apply at the end of each time-period.
is_pcpspThe flag that determines if the scheduling instance is used to define a PCPSP model or a full integer model.

These are the minimal elements to specify a scheduling instance.

Different possible process (or "destinations") are defined later, as well as the stocks and additional constraints.

While this constructor allows to specify a constant discount rate, there are also specific method to specify different discount rates per time-period. Note that there is a difference with MineLib in the definition of the discount factor. In case of a discount rate > 0 , for us, for all periods, the discount factor < 1.

Member Function Documentation

void delphos::SchedulingInstance::AddConstraint ( delphos::Constraint ctr)

Adds an additional constraint to the scheduling instance.

Parameters
ctrThe constraint to be added to the instance.
void delphos::SchedulingInstance::AddDestination ( const Destination dest)

Adds an additional destination to the scheduling instance.

Parameters
destThe destination to be added to the instance.
void delphos::SchedulingInstance::AddDestination ( const string &  destname,
const string &  destvalueattrname 
)

Adds an additional destination to the scheduling instance.

Parameters
destnameThe destination name to be added to the instance.
destvalueattrnameThe destination value attribute name.
void delphos::SchedulingInstance::AddStock ( const Stock stock)

Adds an additional stock to the scheduling instance.

Parameters
stockThe stock to be added to the instance.
void delphos::SchedulingInstance::AddStock ( const string &  stock_name,
const string &  tname,
const double &  tonnage 
)

Adds an additional stock to the scheduling instance.

Parameters
stock_nameThe name of the stock to be added to the instance.
tnamethe tonnage attribute name of the stock to be added to the instance.
tonnageOverall tonnage contained in the stock to be added to the instance.
SchedulingInstance * delphos::SchedulingInstance::AggregateTime ( const unsigned int &  startperiod,
const std::vector< int > &  period_unit 
)

returns a new time aggregated sheduling instance.

Parameters
startperiodthe start period of the aggregated instance.
period_unitThe period units of the aggregated instance. Geometric constraints not implemented.
const Constraint & delphos::SchedulingInstance::GetConstraint ( const unsigned int &  index) const

Returns the i-th constraint already in the model.

Parameters
indexThe i_th given position.
bool delphos::SchedulingInstance::RemoveConstraint ( const unsigned int &  index)

Removes the ith constraint from the instance.

Parameters
indexThe index of the constaint to be removed from the instance.
void delphos::SchedulingInstance::SetFixedDiscountRate ( const double  discount_rate)

(Re-)sets a discount rate that is fixed over the time-periods.

Parameters
discount_rateThe discount rate.
void delphos::SchedulingInstance::SetUpdateFactor ( const unsigned int  period,
const double  factor 
)

Sets a specific update factor for a specific time-period.

Parameters
periodthe time period (from 1 to Horizon()).
factorThe update factor. In the case of a fixed discount rate, the update factor is UPDATE_FACTOR = 1 / (1+discount_rate)^period.

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