35 class SparkSpreadPrice :
public FdmInnerValueCalculator {
37 SparkSpreadPrice(
Real heatRate,
38 const std::vector<Real>& fuelPrices,
39 const std::vector<Real>& powerPrices)
44 Real innerValue(
const FdmLinearOpIterator&,
Time t)
override {
49 Real avgInnerValue(
const FdmLinearOpIterator& iter,
Time t)
override {
50 return innerValue(iter,
t);
60 class FuelPrice :
public FdmInnerValueCalculator {
62 explicit FuelPrice(
const std::vector<Real>& fuelPrices)
65 Real innerValue(
const FdmLinearOpIterator&,
Time t)
override {
70 Real avgInnerValue(
const FdmLinearOpIterator& iter,
Time t)
override {
71 return innerValue(iter,
t);
80 std::vector<Real> fuelPrices,
81 std::vector<Real> powerPrices,
83 ext::shared_ptr<YieldTermStructure> rTS)
85 fuelCostAddon_(fuelCostAddon),
rTS_(
std::move(rTS)) {}
88 const ext::shared_ptr<FdmInnerValueCalculator> fuelPrice(
90 const ext::shared_ptr<FdmInnerValueCalculator> sparkSpreadPrice(
95 const ext::shared_ptr<FdmMesher> mesher(
100 const ext::shared_ptr<FdmVPPStepCondition> stepCondition(
102 fuelPrice, sparkSpreadPrice));
104 Array state(mesher->layout()->dim()[0], 0.0);
106 stepCondition->applyTo(state, (
Time) j-1);
1-D array used in linear algebra.
const std::vector< Real > powerPrices_
void calculate() const override
const Real fuelCostAddon_
DynProgVPPIntrinsicValueEngine(std::vector< Real > fuelPrices, std::vector< Real > powerPrices, Real fuelCostAddon, ext::shared_ptr< YieldTermStructure > rTS)
const std::vector< Real > fuelPrices_
ext::shared_ptr< Fdm1dMesher > stateMesher() const
ext::shared_ptr< FdmVPPStepCondition > build(const FdmVPPStepConditionMesher &mesh, Real fuelCostAddon, const ext::shared_ptr< FdmInnerValueCalculator > &fuel, const ext::shared_ptr< FdmInnerValueCalculator > &spark) const
VanillaVPPOption::results results_
VanillaVPPOption::arguments arguments_
const std::vector< Real > & fuelPrices_
const std::vector< Real > & powerPrices_
intrinsic value engine using dynamic programming
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
const ext::shared_ptr< YieldTermStructure > rTS_
layer of abstraction to calculate the inner value
memory layout of a fdm linear operator
FdmMesher which is a composite of Fdm1dMesher.
factory for VPP step conditions for FD models
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
Interest-rate term structure.