Line | |
---|
1 | using HeuristicLab.Common;
|
---|
2 | using HeuristicLab.Core;
|
---|
3 | using HeuristicLab.Encodings.PermutationEncoding;
|
---|
4 | using HeuristicLab.Optimization;
|
---|
5 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
6 | using System;
|
---|
7 | using System.Collections.Generic;
|
---|
8 | using System.Linq;
|
---|
9 | using System.Text;
|
---|
10 | using System.Threading.Tasks;
|
---|
11 |
|
---|
12 | namespace 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.