Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
scenarioanalytic.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2023 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file orea/app/analytics/scenarioanalytic.hpp
20 \brief ORE Scenario Analytic
21*/
22#pragma once
23
24#include <orea/app/analytic.hpp>
25
26namespace ore {
27namespace analytics {
28
30public:
31 static constexpr const char* LABEL = "SCENARIO";
32
33 ScenarioAnalyticImpl(const QuantLib::ext::shared_ptr<InputParameters>& inputs) :
34 Analytic::Impl(inputs) {
36 }
37 void runAnalytic(const QuantLib::ext::shared_ptr<ore::data::InMemoryLoader>& loader,
38 const std::set<std::string>& runTypes = {}) override;
39 void setUpConfigurations() override;
40
41 const QuantLib::ext::shared_ptr<ore::analytics::Scenario>& scenario() const { return scenario_; };
42 void setScenario(const QuantLib::ext::shared_ptr<ore::analytics::Scenario>& scenario) { scenario_ = scenario; }
43 void setUseSpreadedTermStructures(const bool useSpreadedTermStructures) {
44 useSpreadedTermStructures_ = useSpreadedTermStructures;
45 }
46
47 const QuantLib::ext::shared_ptr<ore::analytics::ScenarioSimMarket>& scenarioSimMarket() const {
48 return scenarioSimMarket_;
49 };
50 void setScenarioSimMarket(const QuantLib::ext::shared_ptr<ore::analytics::ScenarioSimMarket>& ssm) {
52 }
53
54private:
55 QuantLib::ext::shared_ptr<ore::analytics::Scenario> scenario_;
56 QuantLib::ext::shared_ptr<ore::analytics::ScenarioSimMarket> scenarioSimMarket_;
58};
59
60class ScenarioAnalytic : public Analytic {
61public:
62 ScenarioAnalytic(const QuantLib::ext::shared_ptr<InputParameters>& inputs)
63 : Analytic(std::make_unique<ScenarioAnalyticImpl>(inputs), {"SCENARIO"}, inputs,
64 true, false, false, false) {}
65};
66
67} // namespace analytics
68} // namespace ore
ORE Analytics Manager.
void setLabel(const string &label)
Definition: analytic.hpp:189
const QuantLib::ext::shared_ptr< InputParameters > & inputs() const
Definition: analytic.hpp:116
ScenarioAnalytic(const QuantLib::ext::shared_ptr< InputParameters > &inputs)
const QuantLib::ext::shared_ptr< ore::analytics::Scenario > & scenario() const
ScenarioAnalyticImpl(const QuantLib::ext::shared_ptr< InputParameters > &inputs)
void runAnalytic(const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, const std::set< std::string > &runTypes={}) override
void setUseSpreadedTermStructures(const bool useSpreadedTermStructures)
const QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarket > & scenarioSimMarket() const
void setScenario(const QuantLib::ext::shared_ptr< ore::analytics::Scenario > &scenario)
QuantLib::ext::shared_ptr< ore::analytics::Scenario > scenario_
QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarket > scenarioSimMarket_
static constexpr const char * LABEL
void setScenarioSimMarket(const QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarket > &ssm)