Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function cutCoefs($c1, $c2)
- {
- //При подсчете кофов, Больший коф умножается на 0.93, если он больше 2.16. После чего идет ограничение:
- //
- //если до начала матча больше 4 часов, макс.коф = 3,505
- //От 2 до 4 часов до начала матча, макс коф = 3,837
- //меньше 2 часов макс коф 4.5
- //
- //И в любом случае, если у матча итераций меньше 36, то макс коф = 3,516
- //Также в любом случае, когда БО1 макс коф = 3.379
- $grater_coef_key = $this->getGraterCoefKey($c1, $c2);
- $hours_to_start = $this->getHoursToStart();
- if(!$grater_coef_key)return false;
- if($grater_coef_key == 1){
- $grater_coef = $c1;
- }elseif($grater_coef_key == 2){
- $grater_coef = $c2;
- }
- // if($grater_coef > 2.16){
- // $grater_coef = $grater_coef * 0.965;
- // if($grater_coef_key == 1){
- // $c1 = $grater_coef;
- // $c2 = 1/(1.11-(1/$c1));
- // }else if($grater_coef_key == 2){
- // $c2 = $grater_coef;
- // $c1 = 1/(1.11-(1/$c2));
- // }
- // }
- if(strtolower($this->type) == "bo1"){
- $max_grater_coef = 3.679;
- }else{
- $max_grater_coef = 4.6;
- }
- // else if($hours_to_start >= 4){
- // $max_grater_coef = 3.705;
- // }else if($hours_to_start < 4 && $hours_to_start >= 2){
- // $max_grater_coef = 4.237;
- // }else if($hours_to_start < 2){
- // $max_grater_coef = 4.6;
- // }else if($this->i <= 36){
- // $max_grater_coef = 3.616;
- // }
- $grater_coef_key = $this->getGraterCoefKey($c1, $c2);
- if($grater_coef_key == 1){
- if($c1 > $max_grater_coef){
- $c1 = $max_grater_coef;
- $c2 = 1/(1.11-(1/$c1));
- }
- }else if($grater_coef_key == 2){
- if($c2 > $max_grater_coef){
- $c2 = $max_grater_coef;
- $c1 = 1/(1.11-(1/$c2));
- }
- }
- return [
- 'c1' => $c1,
- 'c2' => $c2
- ];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement