40#include <boost/any.hpp>
50 typedef std::map<std::string, std::map<std::string, QuantLib::ext::shared_ptr<ore::data::InMemoryReport>>>
53 typedef std::map<std::string, std::map<std::string, QuantLib::ext::shared_ptr<NPVCube>>>
56 typedef std::map<std::string, std::map<std::string, QuantLib::ext::shared_ptr<AggregationScenarioData>>>
59 typedef std::map<std::string, std::map<std::string, QuantLib::ext::shared_ptr<StressTestScenarioData>>>
69 QuantLib::ext::shared_ptr<ore::analytics::ScenarioSimMarketParameters>
simMarketParams;
74 QuantLib::ext::shared_ptr<ore::data::EngineData>
engineData;
81 std::unique_ptr<Impl>
impl,
86 const QuantLib::ext::shared_ptr<InputParameters>&
inputs,
88 bool simulationConfig =
false,
90 bool sensitivityConfig =
false,
92 bool scenarioGeneratorConfig =
false,
94 bool crossAssetModelConfig =
false);
99 virtual void runAnalytic(
const QuantLib::ext::shared_ptr<ore::data::InMemoryLoader>&
loader,
100 const std::set<std::string>& runTypes = {});
106 virtual void buildMarket(
const QuantLib::ext::shared_ptr<ore::data::InMemoryLoader>&
loader,
107 const bool marketRequired =
true);
109 virtual void marketCalibration(
const QuantLib::ext::shared_ptr<MarketCalibrationReportBase>& mcr =
nullptr);
114 const std::string
label()
const;
116 const QuantLib::ext::shared_ptr<InputParameters>&
inputs()
const {
return inputs_; }
117 const QuantLib::ext::shared_ptr<ore::data::Market>&
market()
const {
return market_; };
119 QuantLib::ext::shared_ptr<MarketImpl>
getMarket()
const {
120 return QuantLib::ext::dynamic_pointer_cast<MarketImpl>(
market_);
126 std::vector<QuantLib::ext::shared_ptr<ore::data::TodaysMarketParameters>>
todaysMarketParams();
127 const QuantLib::ext::shared_ptr<ore::data::Loader>&
loader()
const {
return loader_; };
140 bool match(
const std::set<std::string>& runTypes);
142 const std::unique_ptr<Impl>&
impl() {
156 QuantLib::ext::shared_ptr<InputParameters>
inputs_;
159 QuantLib::ext::shared_ptr<ore::data::Market>
market_;
160 QuantLib::ext::shared_ptr<ore::data::Loader>
loader_;
181 const QuantLib::ext::shared_ptr<ore::data::InMemoryLoader>&
loader,
182 const std::set<std::string>& runTypes = {}) = 0;
187 virtual QuantLib::ext::shared_ptr<ore::data::EngineFactory>
engineFactory();
204 template <
class T> QuantLib::ext::shared_ptr<T>
dependentAnalytic(
const std::string& key)
const;
205 QuantLib::ext::shared_ptr<Analytic>
dependentAnalytic(
const std::string& key)
const;
216 QuantLib::ext::shared_ptr<InputParameters>
inputs_;
235 static constexpr const char*
LABEL =
"MARKETDATA";
240 void runAnalytic(
const QuantLib::ext::shared_ptr<ore::data::InMemoryLoader>& loader,
241 const std::set<std::string>& runTypes = {})
override;
254 QuantLib::ext::shared_ptr<T>
analytic = QuantLib::ext::dynamic_pointer_cast<T>(it->second);
255 QL_REQUIRE(
analytic,
"Could not cast analytic for key " << key);
260 const QuantLib::ext::shared_ptr<InputParameters>& params,
261 const QuantLib::ext::shared_ptr<ore::data::TodaysMarketParameters>&
todaysMarketParams,
262 const QuantLib::ext::shared_ptr<ore::data::Loader>&
loader,
263 const QuantLib::ext::shared_ptr<ore::data::CurveConfigurations>& curveConfigs,
264 const std::string& excludeRegex);
Analytic * analytic() const
bool hasDependentAnalytic(const std::string &key)
bool generateAdditionalResults() const
void setLabel(const string &label)
virtual std::vector< QuantLib::Date > additionalMarketDates() const
std::string label_
label for logging purposes primarily
void addDependentAnalytic(const std::string &key, const QuantLib::ext::shared_ptr< Analytic > &analytic)
const std::string & label() const
void setAnalytic(Analytic *analytic)
std::map< std::string, QuantLib::ext::shared_ptr< Analytic > > dependentAnalytics_
void setGenerateAdditionalResults(const bool generateAdditionalResults)
QuantLib::ext::shared_ptr< T > dependentAnalytic(const std::string &key) const
Impl(const QuantLib::ext::shared_ptr< InputParameters > &inputs)
virtual void setUpConfigurations()
void setInputs(const QuantLib::ext::shared_ptr< InputParameters > &inputs)
std::vector< QuantLib::ext::shared_ptr< Analytic > > allDependentAnalytics() const
const std::map< std::string, QuantLib::ext::shared_ptr< Analytic > > & dependentAnalytics() const
QuantLib::ext::shared_ptr< InputParameters > inputs_
virtual QuantLib::ext::shared_ptr< ore::data::EngineFactory > engineFactory()
build an engine factory
bool generateAdditionalResults_
virtual void runAnalytic(const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, const std::set< std::string > &runTypes={})=0
analytic_reports & reports()
Result reports.
void setWriteIntermediateReports(const bool flag)
std::set< QuantLib::Date > marketDates() const
std::map< std::string, std::map< std::string, QuantLib::ext::shared_ptr< AggregationScenarioData > > > analytic_mktcubes
analytic_npvcubes & npvCubes()
Configurations & configurations()
analytic_stresstests & stressTests()
void setPortfolio(const QuantLib::ext::shared_ptr< ore::data::Portfolio > &portfolio)
virtual void modifyPortfolio()
virtual void marketCalibration(const QuantLib::ext::shared_ptr< MarketCalibrationReportBase > &mcr=nullptr)
analytic_mktcubes mktCubes_
virtual void buildMarket(const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, const bool marketRequired=true)
virtual void runAnalytic(const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, const std::set< std::string > &runTypes={})
Run only those analytic types that are inclcuded in the runTypes vector, run all if the runType vecto...
const std::unique_ptr< Impl > & impl()
const std::string label() const
Inspectors.
const QuantLib::ext::shared_ptr< InputParameters > & inputs() const
std::unique_ptr< Impl > impl_
std::set< std::string > types_
list of analytic types run by this analytic
void setMarket(const QuantLib::ext::shared_ptr< ore::data::Market > &market)
QuantLib::ext::shared_ptr< ore::data::Portfolio > portfolio_
const QuantLib::ext::shared_ptr< ore::data::Portfolio > & portfolio() const
virtual void setUpConfigurations()
QuantLib::ext::shared_ptr< ore::data::Market > market_
const QuantLib::ext::shared_ptr< ore::data::Loader > & loader() const
virtual void replaceTrades()
const QuantLib::ext::shared_ptr< ore::data::Market > & market() const
analytic_npvcubes npvCubes_
void setInputs(const QuantLib::ext::shared_ptr< InputParameters > &inputs)
QuantLib::ext::shared_ptr< MarketImpl > getMarket() const
bool writeIntermediateReports_
std::vector< QuantLib::ext::shared_ptr< Analytic > > allDependentAnalytics() const
const bool getWriteIntermediateReports() const
std::map< std::string, std::map< std::string, QuantLib::ext::shared_ptr< ore::data::InMemoryReport > > > analytic_reports
std::map< std::string, std::map< std::string, QuantLib::ext::shared_ptr< StressTestScenarioData > > > analytic_stresstests
analytic_reports reports_
analytic_stresstests stressTests_
Configurations configurations_
const std::set< std::string > & analyticTypes() const
std::vector< QuantLib::ext::shared_ptr< ore::data::TodaysMarketParameters > > todaysMarketParams()
QuantLib::ext::shared_ptr< ore::data::Loader > loader_
QuantLib::ext::shared_ptr< InputParameters > inputs_
contains all the input parameters for the run
analytic_mktcubes & mktCubes()
bool match(const std::set< std::string > &runTypes)
Check whether any of the requested run types is covered by this analytic.
virtual void buildPortfolio()
std::map< std::string, std::map< std::string, QuantLib::ext::shared_ptr< NPVCube > > > analytic_npvcubes
virtual void buildConfigurations(const bool=false)
MarketDataAnalytic(const QuantLib::ext::shared_ptr< InputParameters > &inputs)
MarketDataAnalyticImpl(const QuantLib::ext::shared_ptr< InputParameters > &inputs)
void setUpConfigurations() override
void runAnalytic(const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, const std::set< std::string > &runTypes={}) override
static constexpr const char * LABEL
Collateral Account Balance (stored in base currency)
Collateral Exposure Helper Functions (stored in base currency)
class describing the layout of an npv cube and aggregation scenario data
QuantLib::ext::shared_ptr< Loader > implyBondSpreads(const Date &asof, const QuantLib::ext::shared_ptr< ore::analytics::InputParameters > ¶ms, const QuantLib::ext::shared_ptr< TodaysMarketParameters > &todaysMarketParams, const QuantLib::ext::shared_ptr< Loader > &loader, const QuantLib::ext::shared_ptr< CurveConfigurations > &curveConfigs, const std::string &excludeRegex)
Exposure aggregation and XVA calculation.
A class to hold Scenario parameters for scenarioSimMarket.
Class for streaming SensitivityRecords from a SensitivityCube.
bool sensitivityConfigRequired
QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioData > sensiScenarioData
QuantLib::ext::shared_ptr< ore::analytics::CrossAssetModelData > crossAssetModelData
bool crossAssetModelConfigRequired
QuantLib::ext::shared_ptr< ore::data::EngineData > engineData
QuantLib::ext::shared_ptr< CurveConfigurations > curveConfig
QuantLib::ext::shared_ptr< ore::data::TodaysMarketParameters > todaysMarketParams
bool simulationConfigRequired
Booleans to determine if these configs are needed.
bool scenarioGeneratorConfigRequired
QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > simMarketParams
QuantLib::ext::shared_ptr< ore::analytics::ScenarioGeneratorData > scenarioGeneratorData