-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAdDemand.h
31 lines (26 loc) · 886 Bytes
/
AdDemand.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
//
// Created by linpingta.
//
#ifndef SHALE__ADDEMAND_H_
#define SHALE__ADDEMAND_H_
#include <iostream>
#include <unordered_map>
#include <fstream>
#include <vector>
class AdDemand {
public:
AdDemand() {}
void loadDemand(const std::string& file, std::unordered_map<std::string, std::vector<std::string>>& satisfyDemand);
int getDemandBudget(const std::string& demandID);
double getPenalty(const std::string& demandID);
std::vector<std::string> getDemandKeys();
std::vector<std::string> getTargetSupply(const std::string& demandID);
void print();
public:
double getV(const std::string& j) { return 1.0; } // for simple assumption
private:
std::unordered_map<std::string, int> demandBudgetPair;
std::unordered_map<std::string, double> demandPenaltyPair;
std::unordered_map<std::string, std::vector<std::string>> targetSupply;
};
#endif //SHALE__ADDEMAND_H_