#include <orea/scenario/clonedscenariogenerator.hpp>
Definition at line 31 of file clonedscenariogenerator.hpp.
◆ ClonedScenarioGenerator()
Definition at line 26 of file clonedscenariogenerator.cpp.
27 {
28 DLOG(
"Build cloned scenario generator for " << dates.size() <<
" dates and " << nSamples <<
" samples.");
29 for (size_t i = 0; i < dates.size(); ++i) {
31 }
33 scenarioGenerator->reset();
35 for (Size i = 0; i < nSamples; ++i) {
36 for (Size j = 0; j < dates.size(); ++j) {
37 scenarios_[i * dates.size() + j] = scenarioGenerator->next(dates[j])->clone();
38 }
39 }
40}
std::vector< QuantLib::ext::shared_ptr< Scenario > > scenarios_
std::map< Date, size_t > dates_
◆ next()
QuantLib::ext::shared_ptr< Scenario > next |
( |
const Date & |
d | ) |
|
|
overridevirtual |
Return the next scenario for the given date.
Implements ScenarioGenerator.
Definition at line 42 of file clonedscenariogenerator.cpp.
42 {
45 }
46 auto stepIdx =
dates_.find(d);
47 QL_REQUIRE(stepIdx !=
dates_.end(),
"ClonedScenarioGenerator::next(" << d <<
"): invalid date " << d);
48 size_t timePos = stepIdx->second;
49 size_t currentStep = (
nSim_ - 1) *
dates_.size() + timePos;
51 "ClonedScenarioGenerator::next(" << d << "): no more scenarios stored.");
53}
◆ reset()
◆ dates_
std::map<Date, size_t> dates_ |
|
private |
◆ firstDate_
◆ nSim_
◆ scenarios_
std::vector<QuantLib::ext::shared_ptr<Scenario> > scenarios_ |
|
private |