-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprobability_wrapper.h
More file actions
72 lines (56 loc) · 2.58 KB
/
probability_wrapper.h
File metadata and controls
72 lines (56 loc) · 2.58 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
#ifndef PROBABILITY_WRAPPER_H
#define PROBABILITY_WRAPPER_H
class ProbabilityWrapper {
private:
// The probability of getting a star 6 operator in one pull
// without pity system comming into effect
double base_star6_rate;
// The conditional probability of up star 6 operator among all
// star 6 operators,
// i.e. Pr(get a on-banner star 6 operator | get a satr 6 operator)
double on_banner_star6_conditional_rate;
// The change amount of the probability of getting a star6 operator
// after the pity system starting to take into effect
double delta_base_star6_rate;
// the number of on-banner operators
unsigned int banner_operator_num;
public:
ProbabilityWrapper(double _base_star6_rate,
double _on_banner_star6_conditional_rate,
double _delta_base_star6_rate,
unsigned int _banner_operator_num)
: base_star6_rate(_base_star6_rate),
on_banner_star6_conditional_rate(_on_banner_star6_conditional_rate),
delta_base_star6_rate(_delta_base_star6_rate),
banner_operator_num(_banner_operator_num){};
// Getters
const double get_base_star6_rate() const;
const double get_on_banner_star6_conditional_rate() const;
const double get_delta_star6_base_rate() const;
const unsigned int get_banner_operator_num() const;
// Setters
void set_on_banner_star6_conditional_rate(
double _on_banner_star6_conditoinal_rate);
void set_banner_operator_num(unsigned int _banner_operator_num);
// Calculate the initial threshold of getting a any star 6 operator
// based on the range of uniform int distribution
unsigned long long int calc_init_star6_threshold(
const unsigned int dist_left_border,
const unsigned int dist_right_border);
// Calculate the initial threshold of getting a specific star 6 operator
// based on the range of uniform int distribution
unsigned long long int calc_init_target_star6_threshold(
const unsigned int dist_left_border,
const unsigned int dist_right_border);
// calculate the change step of the threshold of getting a any star 6 operator
// after the pity system comming into effect
unsigned int calc_star6_threshold_change_step(
const unsigned int dist_left_border,
const unsigned int dist_right_border);
// Calculate the change step of the threshold of getting the target star 6
// operator after the pity system comming into effect
unsigned int calc_target_star6_threshold_change_step(
const unsigned int dist_left_border,
const unsigned int dist_right_border);
};
#endif // PROBABILITY_WRAPPER_H