#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; using System.Collections.Generic; using HeuristicLab.Algorithms.MemPR.Binary; using HeuristicLab.Core; using HeuristicLab.Encodings.BinaryVectorEncoding; /************************************************* * ********************************************* * * DATA * * ********************************************* * *************************************************/ namespace HeuristicLab.Optimization.SolutionModel { public interface ISolutionModel : IItem { TSolution Sample(); } } namespace HeuristicLab.Optimization { public interface ISolutionSubspace : IItem { } } /************************************************* * ********************************************* * * OPERATORS * * ********************************************* * *************************************************/ namespace HeuristicLab.Optimization.SolutionModel { public interface ISolutionModelTrainer : IOperator where TSolution : class, IItem { IScopeTreeLookupParameter SolutionParameter { get; } ILookupParameter> SamplingModelParameter { get; } } public interface ISolutionModelTrainer : ISolutionModelTrainer where TSolution : class, IItem where TContext : ISolutionModelContext { void TrainModel(TContext context); } public interface IBinarySolutionModelTrainer : ISolutionModelTrainer where TContext : ISolutionModelContext { } } namespace HeuristicLab.Optimization.LocalSearch { public interface ILocalSearch : IOperator where TSolution : class, IItem { ILookupParameter SolutionParameter { get; } Func EvaluateFunc { get; set; } } public interface ILocalSearch : ILocalSearch where TSolution : class, IItem { void Optimize(TContext context); } public interface IBinaryLocalSearch : ILocalSearch { } } /************************************************* * ********************************************* * * CONTEXTS * * ********************************************* * *************************************************/ namespace HeuristicLab.Optimization { public interface IStochasticContext : IExecutionContext { IRandom Random { get; } } public interface IMaximizationContext : IExecutionContext { bool Maximization { get; } } public interface IEvaluatedSolutionsContext : IExecutionContext { int EvaluatedSolutions { get; set; } } public interface IBestQualityContext : IExecutionContext { double BestQuality { get; set; } } public interface IBestSolutionContext : IExecutionContext { TSolution BestSolution { get; set; } } public interface IIterationsContext : IExecutionContext { int Iterations { get; } } public interface IIterationsManipulationContext : IIterationsContext { new int Iterations { get; set; } } public interface IPopulationContext : IExecutionContext { IEnumerable Population { get; } } public interface IPopulationContext : IPopulationContext { new IEnumerable> Population { get; } } public interface ISingleObjectivePopulationContext : IPopulationContext { new IEnumerable> Population { get; } } public interface ISolutionContext : IExecutionContext { IScope Solution { get; } } public interface ISolutionContext : ISolutionContext { new ISolutionScope Solution { get; } } public interface ISingleObjectiveSolutionContext : ISolutionContext { new ISingleObjectiveSolutionScope Solution { get; } } /* Probably a setter is not needed anyway, since there is Adopt() also public interface ISolutionManipulationContext : ISolutionContext { new IScope Solution { get; set; } } public interface ISolutionManipulationContext : ISolutionManipulationContext, ISolutionContext { new ISolutionScope Solution { get; set; } } public interface ISingleObjectiveSolutionManipulationContext : ISolutionManipulationContext, ISingleObjectiveSolutionContext { new ISingleObjectiveSolutionScope Solution { get; set; } } */ public interface ISolutionSubspaceContext : IExecutionContext { ISolutionSubspace Subspace { get; } } public interface IBinarySolutionSubspaceContext : ISolutionSubspaceContext { new BinarySolutionSubspace Subspace { get; } } } namespace HeuristicLab.Optimization.SolutionModel { public interface ISolutionModelContext : IExecutionContext { ISolutionModel Model { get; set; } } } /************************************************* * ********************************************* * * SCOPES * * ********************************************* * *************************************************/ namespace HeuristicLab.Core { public interface ISolutionScope : IScope { TSolution Solution { get; set; } void Adopt(ISolutionScope orphan); } public interface ISingleObjectiveSolutionScope : ISolutionScope { double Fitness { get; set; } void Adopt(ISingleObjectiveSolutionScope orphan); } }