[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [sbws/master] Replace min by max in formulae and simplify



commit 5cc4c4ac66ad8d18e202c265248109fc69354f48
Author: juga0 <juga@xxxxxxxxxx>
Date:   Mon Oct 29 14:42:56 2018 +0000

    Replace min by max in formulae and simplify
---
 sbws/lib/v3bwfile.py | 57 ++++++++++++++++++----------------------------------
 1 file changed, 19 insertions(+), 38 deletions(-)

diff --git a/sbws/lib/v3bwfile.py b/sbws/lib/v3bwfile.py
index 72ab58c..3665ae4 100644
--- a/sbws/lib/v3bwfile.py
+++ b/sbws/lib/v3bwfile.py
@@ -740,44 +740,25 @@ class V3BWFile(object):
 
         .. math::
 
-            bwn_i &=
-                max\\left(
-                    \\frac{bw_i}{\\mu},
-                    \\frac{bwf_i}{\\mu_{bwf}}
-                    \\right)
-                \\times bwobs_i
-
-        .. math::
-
-             bwn_i &=
-                max\\left(
-                    \\frac{bw_i}{\\mu},
-                    min \\left(
-                        bw_i,
-                        bw_i \\times \\mu
-                        \\right)
-                            \\times
-                            \\frac{bw_i}{\\sum_{i=1}^{n}
-                            min \\left(bw_i,
-                                bw_i \\times \\mu
-                            \\right)}
-                    \\right)
-                \\times bwobs_i \\
-
-             &=
-                max\\left(
-                    \\frac{bw_i}{\\frac{\\sum_{i=1}^{n}bw_i}{n}},
-                    min \\left(
-                        bw_i,
-                        bw_i \\times \\frac{\\sum_{i=1}^{n}bw_i}{n}
-                        \\right)
-                            \\times
-                            \\frac{bw_i}{\\sum_{i=1}^{n}
-                            min \\left(bw_i,
-                                bw_i \\times \\frac{\\sum_{i=1}^{n}bw_i}{n}
-                            \\right)}
-                    \\right)
-                \\times bwobs_i
+           bwn_i =& min\\left(bwnew_i,
+                      \\sum_{i=1}^{n}bwnew_i \\times 0.05\\right) \\
+
+                 &= min\\left(
+                      \\left(bwobs_i \\times r_i\\right),
+                        \\sum_{i=1}^{n}\\left(bwobs_i \\times r_i\\right)
+                        \\times 0.05\\right)\\
+
+                 &= min\\left(
+                      \\left(bwobs_i \\times max\\left(rf_i, rs_i\\right)\\right),
+                        \\sum_{i=1}^{n}\\left(bwobs_i \\times
+                          max\\left(rf_i, rs_i\\right)\\right) \\times 0.05\\right)\\
+
+                 &= min\\left(
+                      \\left(bwobs_i \\times max\\left(\\frac{bwfilt_i}{bwfilt},
+                          \\frac{bw_i}{bwstrm}\\right)\\right),
+                        \\sum_{i=1}^{n}\\left(bwobs_i \\times
+                          max\\left(\\frac{bwfilt_i}{bwfilt},
+                            \\frac{bw_i}{bwstrm}\\right)\\right) \\times 0.05\\right)
 
         """
         log.info("Calculating relays' bandwidth using Torflow method.")

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits