From 2fa27f737093b186ceeb910f385f5d25e0d0d744 Mon Sep 17 00:00:00 2001 From: Daniel Langesten Date: Tue, 10 Mar 2015 14:47:32 +0100 Subject: added epsilon to conf --- cleaner.go | 3 +-- config.go | 1 + config.json | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cleaner.go b/cleaner.go index 74875d0..588dbec 100644 --- a/cleaner.go +++ b/cleaner.go @@ -14,7 +14,6 @@ const ( DATABASE_PASS = "nil" DATABASE_CONNECTION = "" //e.g. "tcp(localhost:55555) DATABASE_NAME = "netflow" - EPSILON = 1000 ) func cleanData(conf Config) (err error) { @@ -61,7 +60,7 @@ func cleanData(conf Config) (err error) { //Add noise for differential privacy for i := range cDat { - cDat[i].occurances = diffpriv(cDat[i].occurances, 1, EPSILON) + cDat[i].occurances = diffpriv(cDat[i].occurances, 1, conf.Epsilon) } //Begin transaction diff --git a/config.go b/config.go index fb023dd..af84071 100644 --- a/config.go +++ b/config.go @@ -9,6 +9,7 @@ import ( type Config struct { Volumes []VolumeInfo `json:volumes` Interval string `json:interval` + Epsilon float64 `json:epsilon` } type VolumeInfo struct { diff --git a/config.json b/config.json index 10519b7..645a760 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,6 @@ { "interval": "5min", + "epsilon": 10000, "volumes": [ { "size": "small", -- cgit v1.1