Coverage Report

Created: 2026-01-25 06:59

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/quantlib/ql/experimental/finitedifferences/vanillavppoption.hpp
Line
Count
Source
1
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3
/*
4
 Copyright (C) 2011 Klaus Spanderen
5
6
 This file is part of QuantLib, a free-software/open-source library
7
 for financial quantitative analysts and developers - http://quantlib.org/
8
9
 QuantLib is free software: you can redistribute it and/or modify it
10
 under the terms of the QuantLib license.  You should have received a
11
 copy of the license along with this program; if not, please email
12
 <quantlib-dev@lists.sf.net>. The license is also available online at
13
 <https://www.quantlib.org/license.shtml>.
14
15
 This program is distributed in the hope that it will be useful, but WITHOUT
16
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17
 FOR A PARTICULAR PURPOSE.  See the license for more details.
18
*/
19
20
/*! \file vanillavppoption.hpp
21
    \brief vanilla virtual power plant option
22
*/
23
24
#ifndef quantlib_vanilla_vpp_option_hpp
25
#define quantlib_vanilla_vpp_option_hpp
26
27
#include <ql/instruments/multiassetoption.hpp>
28
29
namespace QuantLib {
30
    class BasketPayoff;
31
    class SwingExercise;
32
33
    class VanillaVPPOption : public MultiAssetOption {
34
      public:
35
        class arguments;
36
        VanillaVPPOption(Real heatRate,
37
                         Real pMin, Real pMax,
38
                         Size tMinUp, Size tMinDown,
39
                         Real startUpFuel, Real startUpFixCost,
40
                         const ext::shared_ptr<SwingExercise>& exercise,
41
                         Size nStarts = Null<Size>(),
42
                         Size nRunningHours = Null<Size>());
43
44
        bool isExpired() const override;
45
        void setupArguments(PricingEngine::arguments*) const override;
46
47
      private:
48
        const Real heatRate_;
49
        const Real pMin_, pMax_;
50
        const Size tMinUp_, tMinDown_;
51
        const Real startUpFuel_, startUpFixCost_;
52
        const Size nStarts_, nRunningHours_;
53
    };
54
55
    class VanillaVPPOption::arguments
56
        : public virtual MultiAssetOption::arguments {
57
      public:
58
0
        arguments() = default;
59
        void validate() const override;
60
61
        Real heatRate;
62
        Real pMin, pMax;
63
        Size tMinUp, tMinDown;
64
        Real startUpFuel, startUpFixCost;
65
        Size nStarts, nRunningHours;
66
    };
67
}
68
69
#endif