28#include <ql/shared_ptr.hpp>
30#include <ql/time/date.hpp>
31#include <ql/time/daycounters/actualactual.hpp>
32#include <ql/timegrid.hpp>
36using QuantLib::TimeGrid;
48 virtual QuantLib::ext::shared_ptr<Scenario>
next(
const Date& d) = 0;
65 const vector<Date>& dates,
69 QL_REQUIRE(dates.size() > 0,
"empty date vector passed");
70 QL_REQUIRE(dates.front() > today,
"date grid must start in the future");
73 virtual QuantLib::ext::shared_ptr<Scenario>
next(
const Date& d)
override {
83 QL_REQUIRE(it !=
dates_.end(),
"invalid date " << d);
89 virtual std::vector<QuantLib::ext::shared_ptr<Scenario>>
nextPath() = 0;
96 std::vector<QuantLib::ext::shared_ptr<Scenario>>
path_;
105 QuantLib::ext::shared_ptr<ore::analytics::Scenario>
next(
const Date&)
override {
return s_; }
107 void setScenario(
const QuantLib::ext::shared_ptr<ore::analytics::Scenario>& s) {
s_ = s; }
110 QuantLib::ext::shared_ptr<ore::analytics::Scenario>
s_;
Scenario generator base class.
virtual void reset()=0
Reset the generator so calls to next() return the first scenario.
virtual ~ScenarioGenerator()
Default destructor.
virtual QuantLib::ext::shared_ptr< Scenario > next(const Date &d)=0
Return the next scenario for the given date.
Scenario generator that generates an entire path.
virtual std::vector< QuantLib::ext::shared_ptr< Scenario > > nextPath()=0
virtual QuantLib::ext::shared_ptr< Scenario > next(const Date &d) override
Return the next scenario for the given date.
ScenarioPathGenerator(Date today, const vector< Date > &dates, TimeGrid timeGrid)
Constructor.
std::vector< QuantLib::ext::shared_ptr< Scenario > > path_
void setScenario(const QuantLib::ext::shared_ptr< ore::analytics::Scenario > &s)
QuantLib::ext::shared_ptr< ore::analytics::Scenario > s_
QuantLib::ext::shared_ptr< ore::analytics::Scenario > next(const Date &) override
Return the next scenario for the given date.
StaticScenarioGenerator()
void reset() override
Reset the generator so calls to next() return the first scenario.