25#include <boost/algorithm/string.hpp>
26#include <boost/algorithm/string/case_conv.hpp>
27#include <boost/algorithm/string/trim.hpp>
28#include <boost/lexical_cast.hpp>
29#include <boost/tokenizer.hpp>
41QuantLib::ext::shared_ptr<ScenarioGenerator>
43 QuantLib::ext::shared_ptr<ScenarioFactory> scenarioFactory,
44 QuantLib::ext::shared_ptr<ScenarioSimMarketParameters> marketConfig, Date
asof,
45 QuantLib::ext::shared_ptr<ore::data::Market> initMarket,
const std::string& configuration,
46 const QuantLib::ext::shared_ptr<PathGeneratorFactory>& pf) {
48 LOG(
"ScenarioGeneratorBuilder::build() called");
50 QL_REQUIRE(initMarket != NULL,
"ScenarioGeneratorBuilder: initMarket is null");
53 auto process = model->stateProcess();
54 if (
auto tmp = QuantLib::ext::dynamic_pointer_cast<CrossAssetStateProcess>(process)) {
55 tmp->resetCache(
data_->getGrid()->timeGrid().size() - 1);
58 auto pathGen = pf->build(
data_->sequenceType(), process,
data_->getGrid()->timeGrid(),
data_->seed(),
59 data_->ordering(),
data_->directionIntegers());
61 return QuantLib::ext::make_shared<CrossAssetModelScenarioGenerator>(model, pathGen, scenarioFactory, marketConfig,
asof,
62 data_->getGrid(), initMarket, configuration);
QuantLib::ext::shared_ptr< ScenarioGeneratorData > data_
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.
Build a scenariogenerator.
factory classes for simple scenarios