Пример #1
0
        public AggregateFormationService(
            IAggregateSizeDistributionFactory aggregateSizeDistributionFactory,
            IPrimaryParticleSizeDistributionFactory primaryParticleSizeDistributionFactory,
            IAggregateFormationFactory aggregateFormationFactory,
            INeighborslistFactory neighborslistFactory,
            IAggregateFormationConfig config,
            ILogger logger)
        {
            _aggregateSizeDistributionFactory       = aggregateSizeDistributionFactory ?? throw new ArgumentException(nameof(aggregateSizeDistributionFactory));
            _primaryParticleSizeDistributionFactory = primaryParticleSizeDistributionFactory ?? throw new ArgumentException(nameof(primaryParticleSizeDistributionFactory));
            _aggregateFormationFactory = aggregateFormationFactory ?? throw new ArgumentException(nameof(aggregateFormationFactory));
            _neighborslistFactory      = neighborslistFactory ?? throw new ArgumentException(nameof(neighborslistFactory));
            _config = config ?? throw new ArgumentException(nameof(config));
            _logger = logger ?? throw new ArgumentException(nameof(logger));

            var rndGen = new Random();

            _aggregateSizeDistribution       = aggregateSizeDistributionFactory.Build(rndGen, config);
            _primaryParticleSizeDistribution = primaryParticleSizeDistributionFactory.Build(rndGen, config);
            _particleFactory = _aggregateFormationFactory.Build(_primaryParticleSizeDistribution, _neighborslistFactory, _config, _logger);
        }