Free cookie consent management tool by TermsFeed Policy Generator

source: branches/MPI/HeuristicLab.Operators.MPISupport/3.3/BinaryTransport/Permutation/PermutationTransfer.cs @ 12966

Last change on this file since 12966 was 7544, checked in by svonolfe, 13 years ago

Improved performance, added MPISolutionsCreator (#1542)

File size: 862 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using HeuristicLab.Core;
6using HeuristicLab.Data;
7using HeuristicLab.Encodings.PermutationEncoding;
8
9namespace HeuristicLab.Operators.MPISupport.BinaryTransport {
10  [Serializable]
11  class PermutationTransfer {
12    public PermutationTypes PermutationType { get; set; }
13
14    public int[] Elements { get; set; }
15
16    public static PermutationTransfer Convert(Permutation item) {
17      PermutationTransfer result = new PermutationTransfer();
18
19      result.PermutationType = item.PermutationType;
20      result.Elements = item.ToArray();
21
22      return result;
23    }
24
25    public static Permutation Convert(PermutationTransfer item) {
26      Permutation result = new Permutation(item.PermutationType, item.Elements);
27
28      return result;
29    }
30  }
31}
Note: See TracBrowser for help on using the repository browser.