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 boost::shared_ptr< HistoricalScenarioReader > &scenarioReader, const QuantLib::Date &startDate, const QuantLib::Date &endDate, const QuantLib::Calendar &calendar)
 
boost::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< boost::shared_ptr< ore::analytics::Scenario > > & historicalScenarios ()
 Set historical scenarios.
 
const std::vector< boost::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< boost::shared_ptr< ore::analytics::Scenario > > historicalScenarios_
 
std::vector< QuantLib::Date > dates_
 

Detailed Description

Class for loading historical scenarios.

Constructor & Destructor Documentation

◆ HistoricalScenarioLoader()

HistoricalScenarioLoader ( const boost::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