Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PermutationFlowShopProblem/HeuristicLab.Problems.PermutationFlowShop/3.3/PermutationFlowShopProblem.cs @ 14710

Last change on this file since 14710 was 14020, checked in by rlongodo, 8 years ago

#2161: first commit of branch

File size: 1.4 KB
Line 
1using HeuristicLab.Common;
2using HeuristicLab.Core;
3using HeuristicLab.Encodings.PermutationEncoding;
4using HeuristicLab.Optimization;
5using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
6using System;
7using System.Collections.Generic;
8using System.Linq;
9using System.Text;
10using System.Threading.Tasks;
11
12namespace HeuristicLab.Problems.PermutationFlowShop {
13  [Item("One Max Problem", "Represents a problem whose objective is to maximize the number of true values.")]
14  [Creatable(CreatableAttribute.Categories.CombinatorialProblems, Priority = 210)]
15  [StorableClass]
16  public class PermutationFlowShopProblem : SingleObjectiveBasicProblem<PermutationEncoding> {
17
18    [StorableConstructor]
19    protected PermutationFlowShopProblem(bool deserializing) : base(deserializing) { }
20
21    protected PermutationFlowShopProblem(PermutationFlowShopProblem original, Cloner cloner)
22      : base(original, cloner) {
23
24    }
25
26    public PermutationFlowShopProblem() {
27
28    }
29
30    public override IDeepCloneable Clone(Cloner cloner) {
31      return new PermutationFlowShopProblem(this, cloner);
32    }
33
34    public override bool Maximization {
35      get { return false; }
36    }
37
38    public override double Evaluate(Individual individual, IRandom random) {
39      var permutation = individual.Permutation();
40
41      return random.NextDouble();
42    }
43  }
44}
Note: See TracBrowser for help on using the repository browser.