//  The list of aggregate names the imported aggregates are being matched with.
        //private IList<Core.Model.Aggregate> _aggregates = null;
        public MatchingAlgorithm(ICoefficientAlgorithm coefficientAlgorithm, double coefficientLimit,
                                 IStringSimilarityAlgorithm similarityMatchAlgorithm, Double percentageLimit,
                                 IEditDistanceAlgorithm editDistanceAlgorithm, int editDistanceLimit,
                                 IAlgorithmPreProcess preProcessor)
        {
            if (coefficientAlgorithm == null)
                throw new ArgumentNullException("coefficientAlgorithm", "No valid Coefficient type algorithm supplied");
            if (similarityMatchAlgorithm == null)
                throw new ArgumentNullException("similarityMatchAlgorithm", "No valid Percentage type algorithm supplied");
            if (editDistanceAlgorithm == null)
                throw new ArgumentNullException("editDistanceAlgorithm", "No valid Edit Distance type algorithm supplied");
            if (preProcessor == null)
                throw new ArgumentNullException("preProcessor", "No valid pre-processor supplied");

            _coefficientAlgorithm = coefficientAlgorithm;
            _similarityAlgorithm = similarityMatchAlgorithm;
            _editDistanceAlgorithm = editDistanceAlgorithm;
            _preProcessor = preProcessor;

            _coefficientLimit = coefficientLimit;
            _percentageLimit = percentageLimit;
            _editDistanceLimit = editDistanceLimit;
        }
 public void Initialise()
 {
     //  Data Context and Repositories
     _db = new AggregateContext();
     _repository = new AggregateRepository(_db);
     _dataSourceRepository = new DataSourceRepository(_db);
     _dataTypeRepository = new DataTypeRepository(_db);     //  No parm, currently Enumeration
     //  DataSources and Resolver
     var renUkHelper = new RenUkHtmlHelper();
     _renUkDatasource = new RenUkDataSource(renUkHelper);
     var snhHelper = new SnhKmlHelper();
     _snhDataSource = new SnhDataSource(snhHelper);
     _dataSourceResolver = new DataSourceResolver(_snhDataSource, _renUkDatasource);
     //  Matching algorithm
     _coefficientAlgorithm = new DiceCoefficient();
     _similarityAlgorithm = new LcSubstr();
     _editDistanceAlgorithm = new LevenshteinEditDistance();
     _preProcess = new PreProcessor();
     _algorithm = new MatchingAlgorithm(_coefficientAlgorithm, 0.9f, _similarityAlgorithm, 0.9f,
                                        _editDistanceAlgorithm, 2, _preProcess);
     //  Mapper class
     _mapper = new ImportAggregateToAggregateMapper();
     //  Import Services and Resolver
     _renUkImportService = new RenUkImportService(_repository, _dataSourceRepository, _renUkDatasource, _algorithm, _mapper);
     _snhImportService = new SnhImportService(_repository, _dataSourceRepository, _snhDataSource, _algorithm,
         _mapper);
     _importServiceResolver = new ImportServiceResolver(_snhImportService, _renUkImportService);
 }
        public void Initialise()
        {
            _db = new AggregateContext();
            _repository = new AggregateRepository(_db);
            _dataSourceRepository = new DataSourceRepository(_db);

            var helper = new SnhKmlHelper();
            _datasource = new SnhDataSource(helper);

            _coefficientAlgorithm = new DiceCoefficient();
            _similarityAlgorithm = new LcSubstr();
            _editDistanceAlgorithm = new LevenshteinEditDistance();
            _preProcess = new PreProcessor();

            _algorithm = new MatchingAlgorithm(_coefficientAlgorithm, 0.9f, _similarityAlgorithm, 0.9f,
                                               _editDistanceAlgorithm, 2, _preProcess);

            _mapper = new ImportAggregateToAggregateMapper();

            _service = new SnhImportService(_repository, _dataSourceRepository, _datasource, _algorithm, _mapper);
        }
        public void Initialise()
        {
            //  Create new instance of the algorithms and pre-processor
            _coefficientAlgorithm = new DiceCoefficient();
            _similarityAlgorithm = new LcSubstr();
            _editDistanceAlgorithm = new LevenshteinEditDistance();
            _preProcessor = new PreProcessor();

            //  Instantiate the Aggregate Matching algorithm
            _algorithm = new MatchingAlgorithm(_coefficientAlgorithm, CoefficientLimit,
                                                _similarityAlgorithm, SimilarityLimit,
                                                _editDistanceAlgorithm, EditDistanceLimit,
                                                _preProcessor);

            //  Set up the test aggregates
            _aggregates = new List<Aggregate>()
                {
                    new Aggregate()
                        {
                            Id = 1,
                            Name = "Ardrossan",
                            LastUpdated = DateTime.Now,
                            Data = new Collection<AggregateData>()
                        },
                    new Aggregate()
                        {
                            Id=2,
                            Name = "Ardrossan Extension",
                            LastUpdated = DateTime.Now,
                            Data=new Collection<AggregateData>()
                        },
                    new Aggregate()
                        {
                            Id = 3,
                            Name = "10 x 50kW Windbank turbines at Tambowie Farm, Milngavie",
                            LastUpdated = DateTime.Now,
                            Data = new Collection<AggregateData>()
                        },
                    new Aggregate()
                        {
                            Id = 4,
                            Name = "Cathkin Braes",
                            LastUpdated = DateTime.Now,
                            Data = new Collection<AggregateData>()
                        },
                    new Aggregate()
                        {
                            Id = 5,
                            Name = "Achany Estate",
                            LastUpdated = DateTime.Now,
                            Data = new Collection<AggregateData>()
                        }
                };
        }