74 const QuantLib::ext::shared_ptr<ScenarioSimMarketParameters>& parameters,
79 const bool cacheSimData =
false,
const bool allowPartialScenarios =
false,
82 const QuantLib::ext::shared_ptr<Scenario>& offSetScenario =
nullptr);
85 const QuantLib::ext::shared_ptr<ScenarioSimMarketParameters>& parameters,
86 const QuantLib::ext::shared_ptr<FixingManager>&
fixingManager,
91 const bool cacheSimData =
false,
const bool allowPartialScenarios =
false,
94 const QuantLib::ext::shared_ptr<Scenario>& offSetScenario =
nullptr);
107 virtual QuantLib::ext::shared_ptr<ScenarioFilter>&
filter() {
return filter_; }
109 virtual const QuantLib::ext::shared_ptr<ScenarioFilter>&
filter()
const {
return filter_; }
115 virtual void updateDate(
const Date&)
override;
116 virtual void postUpdate(
const Date& d,
bool withFixings)
override;
117 virtual void updateAsd(
const Date&)
override;
120 virtual void reset()
override;
142 void applyScenario(
const QuantLib::ext::shared_ptr<Scenario>& scenario);
149 const std::string& name,
const std::vector<std::vector<Real>>& coordinates);
151 void addYieldCurve(
const QuantLib::ext::shared_ptr<Market>& initMarket,
const std::string& configuration,
153 bool& simDataWritten,
bool simulate =
true,
bool spreaded =
false);
159 QuantLib::Handle<QuantLib::YieldTermStructure>
161 const std::string& configuration,
const QuantLib::ext::shared_ptr<ore::data::Market>& market =
nullptr)
const;
164 bool addSwapIndexToSsm(
const std::string& indexName,
const bool continueOnError);
166 const QuantLib::ext::shared_ptr<ScenarioSimMarketParameters>
parameters_;
168 QuantLib::ext::shared_ptr<AggregationScenarioData>
asd_;
170 QuantLib::ext::shared_ptr<ScenarioFilter>
filter_;
172 std::map<RiskFactorKey, QuantLib::ext::shared_ptr<SimpleQuote>>
simData_;
188 std::set<std::tuple<RiskFactorKey::KeyType, std::string, std::vector<std::vector<Real>>>>
coordinatesData_;
Data types stored in the scenario class.
KeyType
Risk Factor types.
A scenario filter can exclude certain key from updating the scenario.
virtual ~ScenarioFilter()
virtual bool allow(const RiskFactorKey &key) const
Allow this key to be updated.
Simulation Market updated with discrete scenarios.
std::set< RiskFactorKey::KeyType > nonSimulatedFactors_
std::map< RiskFactorKey, QuantLib::ext::shared_ptr< SimpleQuote > > simData_
virtual QuantLib::ext::shared_ptr< ScenarioGenerator > & scenarioGenerator()
Set scenario generator.
QuantLib::ext::shared_ptr< ScenarioFilter > filter_
bool addSwapIndexToSsm(const std::string &indexName, const bool continueOnError)
QuantLib::ext::shared_ptr< FixingManager > fixingManager_
QuantLib::Handle< QuantLib::YieldTermStructure > getYieldCurve(const std::string &yieldSpecId, const ore::data::TodaysMarketParameters &todaysMarketParams, const std::string &configuration, const QuantLib::ext::shared_ptr< ore::data::Market > &market=nullptr) const
void applyScenario(const QuantLib::ext::shared_ptr< Scenario > &scenario)
virtual const QuantLib::ext::shared_ptr< ScenarioFilter > & filter() const
Get scenarioFilter.
QuantLib::ext::shared_ptr< Scenario > currentScenario_
std::vector< QuantLib::ext::shared_ptr< SimpleQuote > > cachedSimData_
QuantLib::ext::shared_ptr< ScenarioGenerator > scenarioGenerator_
virtual const QuantLib::ext::shared_ptr< ScenarioGenerator > & scenarioGenerator() const
Get scenario generator.
bool useSpreadedTermStructures_
std::set< ore::analytics::RiskFactorKey > diffToBaseKeys_
virtual void updateScenario(const Date &) override
Retrieve next market scenario and apply this, but don't update date.
QuantLib::ext::shared_ptr< Scenario > baseScenario_
std::size_t cachedSimDataKeysHash_
const QuantLib::ext::shared_ptr< ScenarioSimMarketParameters > parameters_
QuantLib::ext::shared_ptr< Scenario > baseScenarioAbsolute_
virtual void postUpdate(const Date &d, bool withFixings) override
Observable reset depending on selected mode, instrument updates.
void addYieldCurve(const QuantLib::ext::shared_ptr< Market > &initMarket, const std::string &configuration, const RiskFactorKey::KeyType rf, const string &key, const vector< Period > &tenors, bool &simDataWritten, bool simulate=true, bool spreaded=false)
bool allowPartialScenarios_
virtual QuantLib::ext::shared_ptr< Scenario > baseScenario() const
virtual bool isSimulated(const RiskFactorKey::KeyType &factor) const
is risk factor key simulated by this sim market instance?
virtual QuantLib::ext::shared_ptr< Scenario > baseScenarioAbsolute() const
virtual void preUpdate() override
Update.
virtual QuantLib::ext::shared_ptr< AggregationScenarioData > & aggregationScenarioData()
Set aggregation data.
ScenarioSimMarket(const bool handlePseudoCurrencies)
Constructor.
QuantLib::ext::shared_ptr< Scenario > offsetScenario_
const QuantLib::ext::shared_ptr< FixingManager > & fixingManager() const override
Return the fixing manager.
std::set< std::tuple< RiskFactorKey::KeyType, std::string, std::vector< std::vector< Real > > > > coordinatesData_
virtual void updateDate(const Date &) override
Update to the given date.
IborFallbackConfig iborFallbackConfig_
std::map< RiskFactorKey, Real > absoluteSimData_
virtual QuantLib::ext::shared_ptr< ScenarioFilter > & filter()
Set scenarioFilter.
bool useSpreadedTermStructures() const
virtual const QuantLib::ext::shared_ptr< AggregationScenarioData > & aggregationScenarioData() const
Get aggregation data.
virtual void reset() override
Reset sim market to initial state.
virtual void updateAsd(const Date &) override
Update aggregation scenario data.
QuantLib::ext::shared_ptr< AggregationScenarioData > asd_
void writeSimData(std::map< RiskFactorKey, QuantLib::ext::shared_ptr< SimpleQuote > > &simDataTmp, std::map< RiskFactorKey, Real > &absoluteSimDataTmp, const RiskFactorKey::KeyType keyType, const std::string &name, const std::vector< std::vector< Real > > &coordinates)
std::vector< bool > cachedSimDataActive_
static IborFallbackConfig defaultConfig()
static const string defaultConfiguration
bool handlePseudoCurrencies() const
RiskFactorKey::KeyType yieldCurveRiskFactor(const ore::data::YieldCurveType y)
Map a yield curve type to a risk factor key type.
Scenario generator base classes.
A class to hold Scenario parameters for scenarioSimMarket.
A Market class that can be Simulated.