/// <summary> /// Constructor /// </summary> /// <param name="dataSet">The data set for this actor</param> /// <param name="hybridEstimatorFactory">Factory for creating estimators</param> /// <param name="bloomFilterFactory">Factory for creating Bloom filters</param> /// <param name="configuration">Bloom filter configuration to use</param> public Actor(IList <TestEntity> dataSet, IHybridEstimatorFactory hybridEstimatorFactory, IInvertibleBloomFilterFactory bloomFilterFactory, IInvertibleBloomFilterConfiguration <TestEntity, long, int, TCount> configuration) { _protobufModel = TypeModel.Create(); _protobufModel.UseImplicitZeroDefaults = true; _dataSet = dataSet; _hybridEstimatorFactory = hybridEstimatorFactory; _bloomFilterFactory = bloomFilterFactory; _configuration = configuration; }
/// <summary> /// Constructor /// </summary> /// <param name="dataSet">The data set for this actor</param> /// <param name="hybridEstimatorFactory">Factory for creating estimators</param> /// <param name="bloomFilterFactory">Factory for creating Bloom filters</param> /// <param name="configuration">Bloom filter configuration to use</param> public PrecalculatedActor(IList <TestEntity> dataSet, IHybridEstimatorFactory hybridEstimatorFactory, IInvertibleBloomFilterFactory bloomFilterFactory, IInvertibleBloomFilterConfiguration <TestEntity, long, int, TCount> configuration) { _protobufModel = TypeModel.Create(); _protobufModel.UseImplicitZeroDefaults = true; _hybridEstimatorFactory = hybridEstimatorFactory; _configuration = configuration; //terribly over size the estimator. _estimator = _hybridEstimatorFactory.Create(_configuration, 100000); foreach (var itm in dataSet) { _estimator.Add(itm); } //sized to number of differences it can handle, not to the size of the data. _filter = bloomFilterFactory.Create(_configuration, 5000, 0.001F, true); foreach (var item in dataSet) { _filter.Add(item); } }