Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ScenarioGeneratorBuilder Class Reference

Build a ScenarioGenerator. More...

#include <orea/scenario/scenariogeneratorbuilder.hpp>

+ Collaboration diagram for ScenarioGeneratorBuilder:

Public Member Functions

 ScenarioGeneratorBuilder ()
 Default constructor. More...
 
 ScenarioGeneratorBuilder (QuantLib::ext::shared_ptr< ScenarioGeneratorData > data)
 Constructor. More...
 
QuantLib::ext::shared_ptr< ScenarioGeneratorbuild (QuantLib::ext::shared_ptr< QuantExt::CrossAssetModel > model, QuantLib::ext::shared_ptr< ScenarioFactory > sf, QuantLib::ext::shared_ptr< ScenarioSimMarketParameters > marketConfig, Date asof, QuantLib::ext::shared_ptr< ore::data::Market > initMarket, const std::string &configuration=ore::data::Market::defaultConfiguration, const QuantLib::ext::shared_ptr< PathGeneratorFactory > &pf=QuantLib::ext::make_shared< MultiPathGeneratorFactory >())
 Build function. More...
 

Private Attributes

QuantLib::ext::shared_ptr< ScenarioGeneratorDatadata_
 
boost::optional< std::set< std::string > > currencies_
 

Detailed Description

Build a ScenarioGenerator.

ScenarioGeneratorBuilder builds a scenario generator based on the settings provided via the ScenarioGeneratorData object

Definition at line 54 of file scenariogeneratorbuilder.hpp.

Constructor & Destructor Documentation

◆ ScenarioGeneratorBuilder() [1/2]

Default constructor.

Definition at line 57 of file scenariogeneratorbuilder.hpp.

57{}

◆ ScenarioGeneratorBuilder() [2/2]

ScenarioGeneratorBuilder ( QuantLib::ext::shared_ptr< ScenarioGeneratorData data)

Constructor.

Definition at line 60 of file scenariogeneratorbuilder.hpp.

60: data_(data) {}
QuantLib::ext::shared_ptr< ScenarioGeneratorData > data_

Member Function Documentation

◆ build()

QuantLib::ext::shared_ptr< ScenarioGenerator > build ( QuantLib::ext::shared_ptr< QuantExt::CrossAssetModel model,
QuantLib::ext::shared_ptr< ScenarioFactory sf,
QuantLib::ext::shared_ptr< ScenarioSimMarketParameters marketConfig,
Date  asof,
QuantLib::ext::shared_ptr< ore::data::Market initMarket,
const std::string &  configuration = ore::data::Market::defaultConfiguration,
const QuantLib::ext::shared_ptr< PathGeneratorFactory > &  pf = QuantLib::ext::make_shared<MultiPathGeneratorFactory>() 
)

Build function.

Definition at line 42 of file scenariogeneratorbuilder.cpp.

46 {
47
48 LOG("ScenarioGeneratorBuilder::build() called");
49
50 QL_REQUIRE(initMarket != NULL, "ScenarioGeneratorBuilder: initMarket is null");
51
52 // enable cache
53 auto process = model->stateProcess();
54 if (auto tmp = QuantLib::ext::dynamic_pointer_cast<CrossAssetStateProcess>(process)) {
55 tmp->resetCache(data_->getGrid()->timeGrid().size() - 1);
56 }
57
58 auto pathGen = pf->build(data_->sequenceType(), process, data_->getGrid()->timeGrid(), data_->seed(),
59 data_->ordering(), data_->directionIntegers());
60
61 return QuantLib::ext::make_shared<CrossAssetModelScenarioGenerator>(model, pathGen, scenarioFactory, marketConfig, asof,
62 data_->getGrid(), initMarket, configuration);
63}
#define LOG(text)
Date asof(14, Jun, 2018)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ data_

QuantLib::ext::shared_ptr<ScenarioGeneratorData> data_
private

Definition at line 71 of file scenariogeneratorbuilder.hpp.

◆ currencies_

boost::optional<std::set<std::string> > currencies_
private

Definition at line 72 of file scenariogeneratorbuilder.hpp.