-
Notifications
You must be signed in to change notification settings - Fork 0
/
Authority.h
40 lines (31 loc) · 1012 Bytes
/
Authority.h
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
#ifndef AUTHORITY_H_
#define AUTHORITY_H_
#include <limits>
#include <vector>
#include "Principal.h"
class Simulator;
class Producer;
class Consumer;
class Profile;
class Authority : public Principal {
public:
Authority(Simulator *sim, double fee_rate = 0);
Authority(Simulator *sim, double capital, double fee_rate = 0);
//Authority(Simulator *sim, double capital, double barrier = std::numeric_limits<double>::max());
void setLowestCapital(double lowestCapital);
double getLowestCapital();
void setFeeRate(double fee_rate);
double getFeeRate();
void setBarrier(double barrier);
double getBarrier();
double getPremium(Producer *producer, Consumer *consumer);
bool sellPolicy(Producer *producer, Consumer *consumer);
private:
double lowestCapital;
double fee_rate;
double barrier;
double getPremium(Producer *producer, Consumer *consumer, double rate);
double calculatePremiumExponential(Producer *producer, Consumer *consumer);
double getWeight(int step);
};
#endif