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 | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using HeuristicLab.Core;
|
---|
6 | using HeuristicLab.Data;
|
---|
7 | using HeuristicLab.Encodings.PermutationEncoding;
|
---|
8 |
|
---|
9 | namespace 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.