Skip to content

Commit 001b0b7

Browse files
pcaspersjenkins
authored andcommitted
QPR-12028 make sure notifications from model handle come through to model parameter calculators
1 parent ea68511 commit 001b0b7

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

OREData/ored/scripting/models/gaussiancamcg.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,18 +215,19 @@ void GaussianCamCG::performCalculations() const {
215215

216216
// evolve the stochastic process, for now we only evolve IR LGM process #0 as a PoC (!)
217217

218-
auto p = cam_->stateProcess();
218+
auto cam(cam_);
219219

220220
for (Size i = 0; i < timeGrid_.size() - 1; ++i) {
221221
std::string id = "__diffusion_0_" + std::to_string(i);
222222
Real t = timeGrid_[i];
223223
Real dt = timeGrid_.dt(i);
224-
addModelParameter(id, [p, t, dt] { return p->diffusion(t, Array())(0, 0) * std::sqrt(dt); });
224+
addModelParameter(id,
225+
[cam, t, dt] { return cam->stateProcess()->diffusion(t, Array())(0, 0) * std::sqrt(dt); });
225226
}
226227

227228
std::string id = "__z_0";
228229
std::size_t irState;
229-
irState = addModelParameter(id, [p] { return p->initialValues()[0]; });
230+
irState = addModelParameter(id, [cam] { return cam->stateProcess()->initialValues()[0]; });
230231
irStates_[*effectiveSimulationDates_.begin()][0] = irState;
231232

232233
std::size_t dateIndex = 1;

0 commit comments

Comments
 (0)