Ignore:
Timestamp:
11/23/15 21:07:22 (4 years ago)
Author:
mkommend
Message:

#2521: Refactored single-objective programmable problem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/CompiledProblemDefinition.cs

    r13345 r13348  
    2121
    2222using System;
     23using System.Collections.Generic;
     24using System.Threading;
     25using HeuristicLab.Core;
    2326using HeuristicLab.Optimization;
    2427
     
    4548    }
    4649  }
     50
     51  public abstract class CompiledSingleObjectiveProblemDefinition<TEncoding, TSolution> : CompiledProblemDefinition<TEncoding, TSolution>, ISingleObjectiveProblemDefinition<TEncoding, TSolution>
     52    where TEncoding : class, IEncoding<TSolution>
     53    where TSolution : class, ISolution {
     54
     55    protected CompiledSingleObjectiveProblemDefinition() : base() { }
     56
     57    protected CompiledSingleObjectiveProblemDefinition(TEncoding encoding)
     58      : base(encoding) { }
     59
     60    #region ISingleObjectiveProblemDefinition<TEncoding,TSolution> Members
     61    public abstract bool Maximization { get; }
     62    public abstract double Evaluate(TSolution individual, IRandom random);
     63    public abstract void Analyze(TSolution[] individuals, double[] qualities, ResultCollection results, IRandom random);
     64    public abstract IEnumerable<TSolution> GetNeighbors(TSolution individual, IRandom random);
     65    #endregion
     66  }
     67
     68  public abstract class CompiledMultiObjectiveProblemDefinition<TEncoding, TSolution> : CompiledProblemDefinition<TEncoding, TSolution>, IMultiObjectiveProblemDefinition<TEncoding, TSolution>
     69    where TEncoding : class, IEncoding<TSolution>
     70    where TSolution : class, ISolution {
     71
     72    protected CompiledMultiObjectiveProblemDefinition() : base() { }
     73
     74    protected CompiledMultiObjectiveProblemDefinition(TEncoding encoding)
     75      : base(encoding) { }
     76
     77    #region ISingleObjectiveProblemDefinition<TEncoding,TSolution> Members
     78    public abstract bool[] Maximization { get; }
     79    public abstract double[] Evaluate(TSolution individual, IRandom random);
     80    public abstract void Analyze(TSolution[] individuals, double[][] qualities, ResultCollection results, IRandom random);
     81    public abstract IEnumerable<TSolution> GetNeighbors(TSolution individual, IRandom random);
     82    #endregion
     83  }
    4784}
Note: See TracChangeset for help on using the changeset viewer.