Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/07/13 01:20:12 (11 years ago)
Author:
jhelm
Message:

#1966: More refactoring; Added more sophisticated structures for packing-plan and bin-packing representation; Transferred parts of the decoding-algorithms to these structures; Did some more refactoring and cleanup;

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/MultiComponentVectorEncoding.cs

    r9563 r9596  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using System.Text;
    2425using HeuristicLab.Collections;
     
    6465      : base() {
    6566        PackingInformations = new ObservableDictionary<int, ItemList<PackingInformation>>();
    66     }       
     67    }
     68
     69    public List<List<int>> GenerateSequenceMatrix() {
     70      List<List<int>> result = new List<List<int>>();
     71      foreach (var bi in PackingInformations) {
     72        var temp = new List<int>();
     73        foreach (var piEntry in bi.Value) {
     74          temp.Add(piEntry.ItemID);
     75        }
     76        result.Add(temp);
     77      }
     78      return result;
     79    }
     80    public Dictionary<int, bool> GenerateRotationArray() {
     81      Dictionary<int, bool> result = new Dictionary<int, bool>();
     82      foreach (var bi in PackingInformations)
     83        foreach (var pi in bi.Value)
     84          result[pi.ItemID] = pi.Rotated;
     85      return result;
     86    }
     87
     88
    6789
    6890    public override string ToString() {
Note: See TracChangeset for help on using the changeset viewer.