Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2701_MemPRAlgorithm/HeuristicLab.Algorithms.MemPR/3.3/Interfaces/Interfaces.cs @ 16811

Last change on this file since 16811 was 14563, checked in by abeham, 8 years ago

#2701:

  • Tagged unbiased models with property
  • Changed default configuration
  • Added solution distance to breeding, relinking and delinking performance models
  • Changed sampling model to base prediction on average distance in genotype space
  • Changed target for hillclimber and relinking to relative (quality improvement)
  • changed breeding to count cache hits per crossover
File size: 4.9 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21 
22using System.Collections.Generic;
23using System.Threading;
24using HeuristicLab.Algorithms.MemPR.Binary;
25using HeuristicLab.Algorithms.MemPR.Grouping;
26using HeuristicLab.Algorithms.MemPR.Permutation;
27using HeuristicLab.Core;
28using HeuristicLab.Encodings.BinaryVectorEncoding;
29using HeuristicLab.Optimization;
30
31namespace HeuristicLab.Algorithms.MemPR.Interfaces {
32
33  /*************************************************
34   * ********************************************* *
35   *                    DATA                       *
36   * ********************************************* *
37   *************************************************/
38
39  public interface ISolutionModel<TSolution> : IItem {
40    TSolution Sample();
41  }
42
43  public interface ISolutionSubspace<TSolution> : IItem { }
44
45  /*************************************************
46   * ********************************************* *
47   *                  OPERATORS                    *
48   * ********************************************* *
49   *************************************************/
50   
51  public interface ISolutionModelTrainer<TContext> : IItem {
52    bool Bias { get; }
53    void TrainModel(TContext context);
54  }
55
56  public interface ILocalSearch<TContext> : IItem {
57    void Optimize(TContext context);
58  }
59 
60  /*************************************************
61   * ********************************************* *
62   *                  CONTEXTS                     *
63   * ********************************************* *
64   *************************************************/
65
66  public interface IHeuristicAlgorithmContext<TProblem, TSolution> : IExecutionContext
67      where TProblem : class, ISingleObjectiveHeuristicOptimizationProblem {
68    TProblem Problem { get; }
69    bool Maximization { get; }
70    IRandom Random { get; }
71    int Iterations { get; set; }
72    int EvaluatedSolutions { get; }
73    void IncrementEvaluatedSolutions(int byEvaluations);
74    double BestQuality { get; set; }
75    TSolution BestSolution { get; set; }
76  }
77
78  public interface IEvaluationServiceContext<TSolution> : IExecutionContext {
79    double Evaluate(TSolution solution, CancellationToken token);
80    void Evaluate(ISingleObjectiveSolutionScope<TSolution> scope, CancellationToken token);
81  }
82
83  public interface IPopulationBasedHeuristicAlgorithmContext<TProblem, TSolution> : IHeuristicAlgorithmContext<TProblem, TSolution>
84      where TProblem : class, ISingleObjectiveHeuristicOptimizationProblem {
85    IEnumerable<ISingleObjectiveSolutionScope<TSolution>> Population { get; }
86  }
87
88  public interface ISingleSolutionHeuristicAlgorithmContext<TProblem, TSolution> : IHeuristicAlgorithmContext<TProblem, TSolution>
89      where TProblem : class, ISingleObjectiveHeuristicOptimizationProblem {
90    ISingleObjectiveSolutionScope<TSolution> Solution { get; }
91  }
92
93  public interface ISolutionModelContext<TSolution> : IExecutionContext {
94    ISolutionModel<TSolution> Model { get; set; }
95  }
96
97  public interface ISolutionSubspaceContext<TSolution> : IExecutionContext {
98    ISolutionSubspace<TSolution> Subspace { get; }
99  }
100  public interface IBinaryVectorSubspaceContext : ISolutionSubspaceContext<BinaryVector> {
101    new BinarySolutionSubspace Subspace { get; }
102  }
103  public interface IPermutationSubspaceContext : ISolutionSubspaceContext<Encodings.PermutationEncoding.Permutation> {
104    new PermutationSolutionSubspace Subspace { get; }
105  }
106  public interface ILinearLinkageSubspaceContext : ISolutionSubspaceContext<Encodings.LinearLinkageEncoding.LinearLinkage> {
107    new LinearLinkageSolutionSubspace Subspace { get; }
108  }
109
110
111  /*************************************************
112   * ********************************************* *
113   *                   SCOPES                      *
114   * ********************************************* *
115   *************************************************/
116
117  public interface ISingleObjectiveSolutionScope<TSolution> : IScope {
118    TSolution Solution { get; set; }
119    double Fitness { get; set; }
120
121    void Adopt(ISingleObjectiveSolutionScope<TSolution> orphan);
122  }
123}
Note: See TracBrowser for help on using the repository browser.