#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System.Collections.Generic; using System.Threading; using HeuristicLab.Algorithms.MemPR.Binary; using HeuristicLab.Algorithms.MemPR.Grouping; using HeuristicLab.Algorithms.MemPR.Permutation; using HeuristicLab.Analysis.FitnessLandscape; using HeuristicLab.Core; using HeuristicLab.Encodings.BinaryVectorEncoding; using HeuristicLab.Optimization; namespace HeuristicLab.Algorithms.MemPR.Interfaces { /************************************************* * ********************************************* * * DATA * * ********************************************* * *************************************************/ public interface ISolutionSubspace : IItem { } /************************************************* * ********************************************* * * OPERATORS * * ********************************************* * *************************************************/ public interface ISolutionModelTrainer : IItem { bool Bias { get; } void TrainModel(TContext context); } public interface ILocalSearch : IItem { void Optimize(TContext context); } /************************************************* * ********************************************* * * CONTEXTS * * ********************************************* * *************************************************/ public interface IHeuristicAlgorithmContext : IExecutionContext where TProblem : class, ISingleObjectiveHeuristicOptimizationProblem { TProblem Problem { get; } bool Maximization { get; } IRandom Random { get; } int Iterations { get; set; } int EvaluatedSolutions { get; } void IncrementEvaluatedSolutions(int byEvaluations); double BestQuality { get; set; } TSolution BestSolution { get; set; } } public interface ILocalSearchPathContext : IExecutionContext where TSolution : class, IItem { DirectedPath LocalSearchPaths { get; } } public interface IEvaluationServiceContext : IExecutionContext { double Evaluate(TSolution solution, CancellationToken token); void Evaluate(ISingleObjectiveSolutionScope scope, CancellationToken token); } public interface IPopulationBasedHeuristicAlgorithmContext : IHeuristicAlgorithmContext where TProblem : class, ISingleObjectiveHeuristicOptimizationProblem { IEnumerable> Population { get; } int PopulationCount { get; } } public interface ISingleSolutionHeuristicAlgorithmContext : IHeuristicAlgorithmContext where TProblem : class, ISingleObjectiveHeuristicOptimizationProblem { ISingleObjectiveSolutionScope Solution { get; } } public interface ISolutionModelContext : IExecutionContext { ISolutionModel Model { get; set; } } public interface ISolutionSubspaceContext : IExecutionContext { ISolutionSubspace Subspace { get; } } public interface IBinaryVectorSubspaceContext : ISolutionSubspaceContext { new BinarySolutionSubspace Subspace { get; } } public interface IPermutationSubspaceContext : ISolutionSubspaceContext { new PermutationSolutionSubspace Subspace { get; } } public interface ILinearLinkageSubspaceContext : ISolutionSubspaceContext { new LinearLinkageSolutionSubspace Subspace { get; } } /************************************************* * ********************************************* * * SCOPES * * ********************************************* * *************************************************/ public interface ISingleObjectiveSolutionScope : IScope { TSolution Solution { get; set; } double Fitness { get; set; } void Adopt(ISingleObjectiveSolutionScope orphan); } }