[redistricter] r204 committed - fix kmppSendThreshold. better weighting

0 views
Skip to first unread message

redist...@googlecode.com

unread,
Mar 1, 2011, 8:05:41 AM3/1/11
to redistrict...@googlegroups.com
Revision: 204
Author: brian.olson
Date: Tue Mar 1 05:05:21 2011
Log: fix kmppSendThreshold. better weighting

http://code.google.com/p/redistricter/source/detail?r=204

Modified:
/trunk/analyze_submissions.py

=======================================
--- /trunk/analyze_submissions.py Mon Feb 28 22:40:36 2011
+++ /trunk/analyze_submissions.py Tue Mar 1 05:05:21 2011
@@ -349,8 +349,9 @@
totalruncount = sum(counts)
mincount = min(counts)
maxcount = max(counts)
+ maxweight = 10.0
def rweight(count):
- return 5.0 - (4.0 * (count - mincount) / (maxcount - mincount))
+ return maxweight - ((maxweight - 1.0) * (count - mincount) / (maxcount
- mincount))
cnames = self.config.keys()
cnames.sort()
for cname in cnames:
@@ -361,7 +362,7 @@
sendAnything = True
if sendAnything:
out.write('%s:sendAnything\n' % (cname,))
- out.write('%s:weight:5.0\n' % (cname,))
+ out.write('%s:weight:%f\n' % (cname, maxweight))
else:
data = bestconfigs[cname]
out.write('%s:sendAnything: False\n' % (cname,))
@@ -372,7 +373,7 @@
rows = list(rows)
if rows and (len(rows) == 10):
kmpplimit = float(rows[-1][0])
- out.write('%s:kmppSendThreshold:%f' % (cname, kmpplimit))
+ out.write('%s:kmppSendThreshold:%f\n' % (cname, kmpplimit))
else:
logging.warn('%s count=%s but fetched %s', cname,
bestconfigs[cname]['count'], len(rows))
# TODO: tweak spreadSendThreshold automatically ?

Reply all
Reply to author
Forward
0 new messages