Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/27/10 03:35:11 (15 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • worked on algorithms
Location:
trunk/sources/HeuristicLab.Optimization/3.3
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization/3.3/Algorithm.cs

    r2864 r2882  
    2222using System;
    2323using System.Drawing;
     24using HeuristicLab.Collections;
    2425using HeuristicLab.Common;
    2526using HeuristicLab.Core;
     
    5556      }
    5657    }
     58
     59    public abstract IObservableKeyedCollection<string, IVariable> Results { get; }
    5760
    5861    public abstract TimeSpan ExecutionTime { get; }
  • trunk/sources/HeuristicLab.Optimization/3.3/EngineAlgorithm.cs

    r2864 r2882  
    2121
    2222using System;
     23using HeuristicLab.Collections;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
     
    6869    }
    6970
     71    private ReadOnlyObservableKeyedCollection<string, IVariable> readOnlyResults;
     72    public override IObservableKeyedCollection<string, IVariable> Results {
     73      get {
     74        if (readOnlyResults == null)
     75          readOnlyResults = ((VariableCollection)globalScope.Variables["Results"].Value).AsReadOnly();
     76        return readOnlyResults;
     77      }
     78    }
     79
    7080    public override TimeSpan ExecutionTime {
    7181      get {
     
    8595      : base() {
    8696      globalScope = new Scope();
     97      globalScope.Variables.Add(new Variable("Results", new VariableCollection()));
    8798      OperatorGraph = new OperatorGraph();
    8899    }
     
    90101      : base(name) {
    91102      globalScope = new Scope();
     103      globalScope.Variables.Add(new Variable("Results", new VariableCollection()));
    92104      OperatorGraph = new OperatorGraph();
    93105    }
     
    95107      : base(name, parameters) {
    96108      globalScope = new Scope();
     109      globalScope.Variables.Add(new Variable("Results", new VariableCollection()));
    97110      OperatorGraph = new OperatorGraph();
    98111    }
     
    100113      : base(name, description) {
    101114      globalScope = new Scope();
     115      globalScope.Variables.Add(new Variable("Results", new VariableCollection()));
    102116      OperatorGraph = new OperatorGraph();
    103117    }
     
    105119      : base(name, description, parameters) {
    106120      globalScope = new Scope();
     121      globalScope.Variables.Add(new Variable("Results", new VariableCollection()));
    107122      OperatorGraph = new OperatorGraph();
    108123    }
     
    133148    protected override void OnPrepared() {
    134149      globalScope.Clear();
     150      globalScope.Variables.Add(new Variable("Results", new VariableCollection()));
     151      readOnlyResults = null;
     152
    135153      if (engine != null) {
    136154        ExecutionContext context = null;
  • trunk/sources/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj

    r2865 r2882  
    5252    <None Include="HeuristicLabOptimizationPlugin.cs.frame" />
    5353    <Compile Include="Algorithm.cs" />
     54    <Compile Include="Interfaces\IMultiObjectiveSelector.cs" />
     55    <Compile Include="Interfaces\ISingleObjectiveSelector.cs" />
     56    <Compile Include="Interfaces\IReducer.cs" />
     57    <Compile Include="Interfaces\ISelector.cs" />
    5458    <Compile Include="Interfaces\IMultiObjectiveProblem.cs" />
    5559    <Compile Include="Interfaces\IMultiObjectiveEvaluator.cs" />
  • trunk/sources/HeuristicLab.Optimization/3.3/Interfaces/IAlgorithm.cs

    r2864 r2882  
    2121
    2222using System;
     23using HeuristicLab.Collections;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
     
    3132    Type ProblemType { get; }
    3233    IProblem Problem { get; set; }
     34    IObservableKeyedCollection<string, IVariable> Results { get; }
    3335    TimeSpan ExecutionTime { get; }
    3436    bool Running { get; }
Note: See TracChangeset for help on using the changeset viewer.