-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExtensions.cs
More file actions
21 lines (19 loc) · 899 Bytes
/
Extensions.cs
File metadata and controls
21 lines (19 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using Microsoft.Extensions.DependencyInjection;
using KnapsackProblem.Application.Factories;
using KnapsackProblem.Core.Abstractions;
using KnapsackProblem.Core.Abstractions.Factories;
namespace KnapsackProblem.Application;
public static class Extensions
{
public static IServiceCollection AddKnapsackProblemResolver(this IServiceCollection services)
{
services.AddSingleton<IEvaluatorFactory, EvaluatorFactory>();
services.AddSingleton<ICrossoverFactory, CrossoverFactory>();
services.AddSingleton<ISelectorFactory, SelectorFactory>();
services.AddSingleton<IMutatorFactory, MutatorFactory>();
services.AddSingleton<IBestChromosomeProvider, BestChromosomeProvider>();
services.AddSingleton<IIterationController, IterationController>();
services.AddSingleton<IProblemResolver, ProblemResolver>();
return services;
}
}