Beispiel #1
0
 /// <summary>
 /// Initializes a new <see cref="PatientService"/> with it's dependencies.
 /// </summary>
 /// <param name="kernel">Current Ninject kernel that is active.</param>
 /// <param name="antFactory">Factory used to create <see cref="IAnt"/> instances.</param>
 public PatientService(
     IKernel kernel,
     IAntFactory antFactory)
 {
     this.kernel     = kernel;
     this.antFactory = antFactory;
 }
Beispiel #2
0
 /// <summary>
 /// Initializes a new <see cref="HospitalService"/> with it's dependencies.
 /// </summary>
 /// <param name="antFactory">Factory used to create <see cref="IAnt"/> instances.</param>
 /// <param name="scheduleService">Service used to get info from <see cref="IFusionProcess"/> instances.</param>
 public HospitalService(
     IAntFactory antFactory,
     IScheduleService scheduleService)
 {
     this.antFactory      = antFactory;
     this.scheduleService = scheduleService;
 }
 public StandartAlgorithm(IAntFactory antFactory, IDictionary<Type, ISelectRule> rules, IProber prober,
     IDictionary<Type, IIncrimentRule> updateRules, int maxIterationsNoChanges, int maxIterations)
 {
     AntFactory = antFactory;
     Rules = rules;
     Prober = prober;
     UpdateRules = updateRules;
     MaxIterationsNoChanges = maxIterationsNoChanges;
     MaxIterations = maxIterations;
 }
Beispiel #4
0
 public GreedyAlgorithm(IAntFactory antFactory, IProber prober,
     int maxIterationsNoChanges, int maxIterations, double evaporationRate, double defaultPheromone, double greedyRate, IGraph graph, int Q)
 {
     _antFactory = antFactory;
     _prober = prober;
     MaxIterationsNoChanges = maxIterationsNoChanges;
     MaxIterations = maxIterations;
     _evaporationRate = evaporationRate;
     _defaultPheromone = defaultPheromone;
     _greedyRate = greedyRate;
     _graph = graph;
     this.Q = Q;
 }
Beispiel #5
0
        /// <summary>
        /// Initializes a new <see cref="FusionCatalogue"/> with it's dependencies.
        /// </summary>
        /// <param name="configStore">Store used to retrieve configuration values.</param>
        /// <param name="antFactory">Factory to create <see cref="IAnt"/> instances.</param>
        /// <param name="directoryInfoFactory">Factory to create <see cref="IDirectoryInfo"/> instances.</param>
        public FusionCatalogue(
            IConfigStore configStore,
            IAntFactory antFactory,
            IDirectoryInfoFactory directoryInfoFactory)
        {
            this.configStore          = configStore;
            this.antFactory           = antFactory;
            this.directoryInfoFactory = directoryInfoFactory;

            rootDirectory = FormatRootDirectory(AppDomain.CurrentDomain.BaseDirectory);

            if (!Directory.Exists(rootDirectory))
            {
                Directory.CreateDirectory(rootDirectory);
            }
        }
Beispiel #6
0
        /// <summary>
        /// Initializes a new <see cref="OwinRestService"/>.
        /// </summary>
        /// <param name="kernel">Ninject kernel instance.</param>
        /// <param name="logService">Service used for logging.</param>
        /// <param name="configStore">Configuration storage instance.</param>
        /// <param name="antFactory">Factory used for instantiating <see cref="IAnt"/>.</param>
        /// <param name="assembliesResolverFactory">Factory used for instantiating <see cref="IAssembliesResolver"/>.</param>
        public OwinRestService(
            IKernel kernel,
            ILog logService,
            IConfigStore configStore,
            IAntFactory antFactory,
            IAssembliesResolverFactory assembliesResolverFactory)
        {
            hostKernel = new ChildKernel(kernel);

            this.logService  = logService;
            this.configStore = configStore;

            this.antFactory = antFactory;

            assembliesResolver = assembliesResolverFactory
                                 .CreateNew(typeof(OwinRestService).Assembly);
        }
Beispiel #7
0
        /// <summary>
        /// Initializes a new <see cref="FilePackService"/>.
        /// </summary>
        /// <param name="logService">Service for logging.</param>
        /// <param name="syncService">Service for synchronizing package information.</param>
        /// <param name="configStore">Store for loading <see cref="ZappConfig"/>.</param>
        /// <param name="antFactory">Factory for creating <see cref="IAnt"/> instances.</param>
        /// <param name="antDirectoryFactory">Factory for creating <see cref="IAntDirectory"/> instances.</param>
        /// <param name="packageFactory">Factory for creating <see cref="IPackage"/> instances.</param>
        public FilePackService(
            ILog logService,
            ISyncService syncService,
            IConfigStore configStore,
            IAntFactory antFactory,
            IAntDirectoryFactory antDirectoryFactory,
            IPackageFactory packageFactory)
        {
            this.logService = logService;

            this.syncService = syncService;
            this.configStore = configStore;

            this.antFactory          = antFactory;
            this.antDirectoryFactory = antDirectoryFactory;

            this.packageFactory = packageFactory;

            packageRootDir = configStore?.Value?.Pack?
                             .GetActualRootDirectory();
        }
Beispiel #8
0
        /// <summary>
        /// Initializes a new <see cref="FusionBuilder"/> with all it's dependencies.
        /// </summary>
        /// <param name="logService">Service used for logging.</param>
        /// <param name="antFactory">Factory used to create <see cref="IAnt"/> instances.</param>
        /// <param name="configStore">Store that resolved app-level configuration.</param>
        /// <param name="packService">Service that is used to get the packages from.</param>
        /// <param name="nuGetPackageResolver">Resolver that handles required NuGet packages.</param>
        /// <param name="frameworkPackageEntryFactory">Factory used for creating framework instances of <see cref="IPackageEntry"/>.</param>
        /// <param name="fusionFilters">A collection of filters used to filter instances of <see cref="IPackageEntry"/>.</param>
        /// <param name="fusionInterceptors">A collection of interceptors that intercept the creation of <see cref="IPackageEntry"/>.</param>
        public FusionBuilder(
            ILog logService,
            IAntFactory antFactory,
            IConfigStore configStore,
            IPackService packService,
            INuGetPackageResolver nuGetPackageResolver,
            IFrameworkPackageEntryFactory frameworkPackageEntryFactory,
            IEnumerable <IFusionFilter> fusionFilters,
            IEnumerable <IFusionInterceptor> fusionInterceptors)
        {
            this.logService                   = logService;
            this.configStore                  = configStore;
            this.packService                  = packService;
            this.nuGetPackageResolver         = nuGetPackageResolver;
            this.frameworkPackageEntryFactory = frameworkPackageEntryFactory;

            this.fusionFilters      = fusionFilters.StaleReadOnly();
            this.fusionInterceptors = fusionInterceptors.StaleReadOnly();

            entryFilter = antFactory
                          .CreateNew(configStore?.Value?.Fuse?.EntryPattern);

            dependencyFiles = GetDependencyFiles().StaleReadOnly();
        }