Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/22/10 00:44:01 (14 years ago)
Author:
swagner
Message:

Sorted usings and removed unused usings in entire solution (#1094)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/AlbaEncoding.cs

    r3938 r4068  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Encodings.PermutationEncoding;
     22using HeuristicLab.Common;
    2723using HeuristicLab.Core;
    2824using HeuristicLab.Data;
     25using HeuristicLab.Encodings.PermutationEncoding;
    2926using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    30 using HeuristicLab.Common;
    3127
    3228namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
    3329  [Item("AlbaEncoding", "Represents an alba encoding of VRP solutions.")]
    3430  [StorableClass]
    35   class AlbaEncoding: Permutation, IVRPEncoding {
     31  class AlbaEncoding : Permutation, IVRPEncoding {
    3632    #region IVRPEncoding Members
    3733    [Storable]
     
    4642    }
    4743
    48     public AlbaEncoding(Permutation permutation, int cities): base(PermutationTypes.RelativeDirected) {
     44    public AlbaEncoding(Permutation permutation, int cities)
     45      : base(PermutationTypes.RelativeDirected) {
    4946      this.array = new int[permutation.Length];
    5047      for (int i = 0; i < array.Length; i++)
     
    7673          } else {
    7774            tour.Add(new IntValue(this.array[i] + 1));
    78           }       
     75          }
    7976        }
    8077
     
    9592
    9693    public static AlbaEncoding ConvertFrom(IVRPEncoding encoding) {
    97         ItemList<Tour> tours = encoding.Tours;
     94      ItemList<Tour> tours = encoding.Tours;
    9895
    99         int cities = 0;
    100         foreach (Tour tour in tours) {
    101           cities += tour.Count;
     96      int cities = 0;
     97      foreach (Tour tour in tours) {
     98        cities += tour.Count;
     99      }
     100      int[] array = new int[cities + tours.Count - 2];
     101      int delimiter = cities;
     102      int arrayIndex = 0;
     103
     104      foreach (Tour tour in tours) {
     105        foreach (IntValue city in tour) {
     106          array[arrayIndex] = city.Value;
     107
     108          arrayIndex++;
    102109        }
    103         int[] array = new int[cities + tours.Count - 2];
    104         int delimiter = cities;
    105         int arrayIndex = 0;
    106110
    107         foreach (Tour tour in tours) {
    108           foreach(IntValue city in tour) {
    109             array[arrayIndex] = city.Value;
    110 
    111             arrayIndex++;
    112           }
    113 
    114           if (arrayIndex != array.Length) {
    115             array[arrayIndex] = delimiter;
    116             delimiter++;
    117             arrayIndex++;
    118           }
     111        if (arrayIndex != array.Length) {
     112          array[arrayIndex] = delimiter;
     113          delimiter++;
     114          arrayIndex++;
    119115        }
     116      }
    120117
    121118      AlbaEncoding solution = new AlbaEncoding(new Permutation(PermutationTypes.RelativeUndirected), cities);
     
    124121    }
    125122
    126    
     123
    127124
    128125  }
Note: See TracChangeset for help on using the changeset viewer.