public IParticleFactory <Aggregate> Build(ISizeDistribution <double> psd, INeighborslistFactory neighborslistFactory, IAggregateFormationConfig config, ILogger logger)
 {
     switch (config.AggregateFormationType)
     {
     case AggregateFormationType.ClusterClusterAggregation:
     default:
         return(new ClusterClusterAggregationFactory(psd, config, logger, neighborslistFactory, config.RandomGeneratorSeed));
     }
 }
Ejemplo n.º 2
0
 public ClusterClusterAggregationFactory(
     ISizeDistribution <double> primaryParticleSizeDistribution,
     IAggregateFormationConfig config,
     ILogger logger,
     INeighborslistFactory neighborslistFactory,
     int seed = -1)
 {
     _psd    = primaryParticleSizeDistribution;
     _config = config;
     _logger = logger;
     _seed   = seed;
     _neighborslistFactory = neighborslistFactory;
 }
Ejemplo n.º 3
0
 public ParticleClusterAggregationFactory(
     ISizeDistribution <double> psd,
     Random rndGen,
     IAggregateFormationConfig config,
     INeighborslistFactory neighborslistFactory,
     ILogger logger)
 {
     _psd    = psd;
     _rndGen = rndGen;
     _config = config;
     _logger = logger;
     _neighborslistFactory = neighborslistFactory;
 }
Ejemplo n.º 4
0
 internal AggregateFormationService
 (
     ISizeDistribution <int> aggregateSizeDistribution,
     ISizeDistribution <double> primaryParticleSizeDistribution,
     IAggregateFormationConfig config,
     IParticleFactory <Aggregate> particleFactory,
     ILogger logger,
     int seed = -1
 )
 {
     _seed = seed;
     _aggregateSizeDistribution       = aggregateSizeDistribution;
     _primaryParticleSizeDistribution = primaryParticleSizeDistribution;
     _config          = config;
     _logger          = logger;
     _particleFactory = particleFactory;
 }
Ejemplo n.º 5
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);
        }