Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/10/11 17:25:35 (14 years ago)
Author:
jhelm
Message:

#1329: Implemented PriorityRulesVector based encoding and added new operators to the JSMEncoding. Added Gantt-Charts for visualization of schedules and problems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Analyzers/BestSchedulingSolutionAnalyzer.cs

    r6121 r6177  
    3636  [Item("BestSchedulingSolutionAnalyzer", "An operator for analyzing the best solution of Scheduling Problems given in schedule-representation.")]
    3737  [StorableClass]
    38   public sealed class BestSchedulingSolutionAnalyzer : SchedulingOperator, IAnalyzer, IStochasticOperator {
     38  public sealed class BestSchedulingSolutionAnalyzer : JSSPOperator, IAnalyzer, IStochasticOperator {
    3939    [StorableConstructor]
    4040    private BestSchedulingSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     
    6161      get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
    6262    }
    63     public LookupParameter<JSSPEncoding> BestSolutionParameter {
    64       get { return (LookupParameter<JSSPEncoding>)Parameters["BestSolution"]; }
     63    public LookupParameter<Schedule> BestSolutionParameter {
     64      get { return (LookupParameter<Schedule>)Parameters["BestSolution"]; }
    6565    }
    6666    public ValueLookupParameter<ResultCollection> ResultsParameter {
     
    7070      get { return (LookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
    7171    }
    72     public LookupParameter<JSSPEncoding> BestKnownSolutionParameter {
    73       get { return (LookupParameter<JSSPEncoding>)Parameters["BestKnownSolution"]; }
     72    public LookupParameter<Schedule> BestKnownSolutionParameter {
     73      get { return (LookupParameter<Schedule>)Parameters["BestKnownSolution"]; }
    7474    }
    75     public ScopeTreeLookupParameter<JSSPEncoding> SchedulingSolutionParameter {
    76       get { return (ScopeTreeLookupParameter<JSSPEncoding>)Parameters["SchedulingSolution"]; }
     75    public ScopeTreeLookupParameter<Schedule> SchedulingSolutionParameter {
     76      get { return (ScopeTreeLookupParameter<Schedule>)Parameters["DecodedSchedulingSolution"]; }
    7777    }
    7878
     
    8484      Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem."));
    8585      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the JSSP solutions which should be analyzed."));
    86       Parameters.Add(new ScopeTreeLookupParameter<JSSPEncoding>("SchedulingSolution", "The solutions from which the best solution has to be chosen from."));
    87       Parameters.Add(new LookupParameter<JSSPEncoding>("BestSolution", "The best JSSP solution."));
     86      Parameters.Add(new ScopeTreeLookupParameter<Schedule>("DecodedSchedulingSolution", "The solutions from which the best solution has to be chosen from."));
     87      Parameters.Add(new LookupParameter<Schedule>("BestSolution", "The best JSSP solution."));
    8888      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best JSSP solution should be stored."));
    8989      Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this JSSP instance."));
    90       Parameters.Add(new LookupParameter<JSSPEncoding>("BestKnownSolution", "The best known solution of this JSSP instance."));
     90      Parameters.Add(new LookupParameter<Schedule>("BestKnownSolution", "The best known solution of this JSSP instance."));
    9191    }
    9292
    9393
    9494    public override IOperation Apply() {
    95       IntValue nrOfResources = NrOfResources;
    9695      ItemList<JSSPJob> jobs = Jobs;
    9796      ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;
    98       ItemArray<JSSPEncoding> solutions = SchedulingSolutionParameter.ActualValue;
     97      ItemArray<Schedule> solutions = SchedulingSolutionParameter.ActualValue;
    9998      ResultCollection results = ResultsParameter.ActualValue;
    10099      bool max = MaximizationParameter.ActualValue.Value;
     
    110109          !max && qualities[i].Value < bestKnownQuality.Value) {
    111110        BestKnownQualityParameter.ActualValue = new DoubleValue(qualities[i].Value);
    112         BestKnownSolutionParameter.ActualValue = (JSSPEncoding)solutions[i].Clone();
     111        BestKnownSolutionParameter.ActualValue = (Schedule)solutions[i].Clone();
    113112      }
    114113
    115       JSSPEncoding bestSolution = BestSolutionParameter.ActualValue;
     114      Schedule bestSolution = BestSolutionParameter.ActualValue;
    116115      if (bestSolution == null) {
    117         bestSolution = (JSSPEncoding)solutions[i].Clone();
     116        bestSolution = (Schedule)solutions[i].Clone();
    118117        bestSolution.Quality.Value = qualities [i].Value;
    119118        BestSolutionParameter.ActualValue = bestSolution;
     
    122121        if (max && bestSolution.Quality.Value < qualities[i].Value ||
    123122          !max && bestSolution.Quality.Value > qualities[i].Value) {
    124             bestSolution = (JSSPEncoding)solutions[i].Clone();
     123            bestSolution = (Schedule)solutions[i].Clone();
    125124          bestSolution.Quality.Value = qualities[i].Value;
    126125        }
Note: See TracChangeset for help on using the changeset viewer.