-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathnpvobjective.h
More file actions
124 lines (103 loc) · 2.73 KB
/
npvobjective.h
File metadata and controls
124 lines (103 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*
* This file is part of the ResOpt project.
*
* Copyright (C) 2011-2012 Aleksander O. Juell <aleksander.juell@ntnu.no>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef NPVOBJECTIVE_H
#define NPVOBJECTIVE_H
#include "objective.h"
namespace ResOpt
{
/**
* @brief Class for objectives that maximize net present value
*
*/
class NpvObjective : public Objective
{
private:
double m_dcf; // discount factor /**< TODO */
double m_price_oil; // oil price /**< TODO */
double m_price_gas; // gas price /**< TODO */
double m_price_water; // water price /**< TODO */
public:
/**
* @brief
*
*/
NpvObjective();
virtual Objective* clone() {return new NpvObjective(*this);}
virtual QString description() const;
// set functions
/**
* @brief Set the discount factor
*
* @param d
*/
void setDcf(double d) {m_dcf = d;}
/**
* @brief Sets the oil price
*
* @param p
*/
void setOilPrice(double p) {m_price_oil = p;}
/**
* @brief Sets the gas price
*
* @param p
*/
void setGasPrice(double p) {m_price_gas = p;}
/**
* @brief Sets the water price
*
* @param p
*/
void setWaterPrice(double p) {m_price_water = p;}
// get functions
/**
* @brief Returns the discount factor
*
* @return double
*/
double dcf() const {return m_dcf;}
/**
* @brief Returns the oil price
*
* @return double
*/
double oilPrice() const {return m_price_oil;}
/**
* @brief Returns the gas price
*
* @return double
*/
double gasPrice() const {return m_price_gas;}
/**
* @brief Returns the water price
*
* @return double
*/
double waterPrice() const {return m_price_water;}
// virtuals
/**
* @brief Calculates the NPV based on the input streams, the discount factor, and the product prices
*
* @param s
*/
virtual void calculateValue(QVector<Stream*> s, QVector<Cost*> c);
};
} // namespace ResOpt
#endif // NPVOBJECTIVE_H