Logo
Reference manual - version orea_version
Public Member Functions | Protected Attributes | List of all members
HistoricalScenarioLoader Class Reference

Class for loading historical scenarios. More...

#include <orea/scenario/historicalscenarioloader.hpp>

Public Member Functions

 HistoricalScenarioLoader ()
 Default constructor.
 
 HistoricalScenarioLoader (const QuantLib::ext::shared_ptr< HistoricalScenarioReader > &scenarioReader, const QuantLib::Date &startDate, const QuantLib::Date &endDate, const QuantLib::Calendar &calendar)
 
 HistoricalScenarioLoader (const boost::shared_ptr< HistoricalScenarioReader > &scenarioReader, const std::set< QuantLib::Date > &dates)
 
 HistoricalScenarioLoader (const std::vector< QuantLib::ext::shared_ptr< ore::analytics::Scenario >> &scenarios, const std::set< QuantLib::Date > &dates)
 
QuantLib::ext::shared_ptr< ore::analytics::ScenariogetHistoricalScenario (const QuantLib::Date &date) const
 Get a Scenario for a given date.
 
QuantLib::Size numScenarios () const
 Number of scenarios.
 
std::vector< QuantLib::ext::shared_ptr< ore::analytics::Scenario > > & historicalScenarios ()
 Set historical scenarios.
 
const std::vector< QuantLib::ext::shared_ptr< ore::analytics::Scenario > > & historicalScenarios () const
 The historical scenarios.
 
std::vector< QuantLib::Date > & dates ()
 Set historical scenario dates.
 
const std::vector< QuantLib::Date > & dates () const
 The historical scenario dates.
 

Protected Attributes

std::vector< QuantLib::ext::shared_ptr< ore::analytics::Scenario > > historicalScenarios_
 
std::vector< QuantLib::Date > dates_
 

Detailed Description

Class for loading historical scenarios.

Constructor & Destructor Documentation

◆ HistoricalScenarioLoader() [1/3]

HistoricalScenarioLoader ( const QuantLib::ext::shared_ptr< HistoricalScenarioReader > &  scenarioReader,
const QuantLib::Date &  startDate,
const QuantLib::Date &  endDate,
const QuantLib::Calendar &  calendar 
)

Constructor that loads scenarios, read from scenarioReader, between startDate and endDate.

Warning:
The scenarios coming from scenarioReader must be in ascending order. If not, an exception is thrown.
Parameters
scenarioReaderA scenario reader that feeds the loader with scenarios
startDateThe first date to load a a scenario for
endDateThe last date to load a scenario for
calendarCalendar to use when advancing dates

◆ HistoricalScenarioLoader() [2/3]

HistoricalScenarioLoader ( const boost::shared_ptr< HistoricalScenarioReader > &  scenarioReader,
const std::set< QuantLib::Date > &  dates 
)

Constructor that loads scenarios, read from scenarioReader, for given dates

Parameters
scenarioReaderA scenario reader that feeds the loader with scenarios
datesThe first date to load a a scenario for

◆ HistoricalScenarioLoader() [3/3]

HistoricalScenarioLoader ( const std::vector< QuantLib::ext::shared_ptr< ore::analytics::Scenario >> &  scenarios,
const std::set< QuantLib::Date > &  dates 
)

Constructor that loads scenarios from a vector

Parameters
scenariosA vector of scenarios
datesThe first date to load a a scenario for