Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/19/12 13:17:29 (12 years ago)
Author:
ascheibe
Message:

#1722 fixed more licensing information and source formatting

File:
1 edited

Legend:

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

    r7906 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2020#endregion
    2121
     22using System.Collections.Generic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    2526using HeuristicLab.Encodings.PermutationEncoding;
    2627using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    27 using System.Collections.Generic;
    2828using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
    30 using HeuristicLab.Problems.VehicleRouting.Variants;
    3130
    3231namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
    3332  [Item("AlbaEncoding", "Represents an Alba encoding of VRP solutions. It is implemented as described in Alba, E. and Dorronsoro, B. (2004). Solving the Vehicle Routing Problem by Using Cellular Genetic Algorithms.")]
    3433  [StorableClass]
    35   public class AlbaEncoding : PermutationEncoding  {   
     34  public class AlbaEncoding : PermutationEncoding {
    3635    #region IVRPEncoding Members
    3736    public override List<Tour> GetTours() {
     
    4039
    4140      int cities = ProblemInstance.Cities.Value;
    42      
     41
    4342      Tour tour = new Tour();
    4443      for (int i = 0; i < this.array.Length; i++) {
     
    7776            vehicleAssignment = this.array[i] - ProblemInstance.Cities.Value;
    7877          }
    79          
     78
    8079          i--;
    8180        }
    82       }
    83       else
     81      } else
    8482        vehicleAssignment = this[lastStopIndex + 1] - this.ProblemInstance.Cities.Value;
    8583
     
    123121    public static AlbaEncoding ConvertFrom(List<int> routeParam, IVRPProblemInstance instance) {
    124122      List<int> route = new List<int>(routeParam);
    125      
     123
    126124      int cities = instance.Cities.Value;
    127125
     
    153151      int delimiter = 0;
    154152      int arrayIndex = 0;
    155      
     153
    156154      foreach (Tour tour in tours) {
    157155        foreach (int city in tour.Stops) {
     
    162160        if (arrayIndex != array.Length) {
    163161          array[arrayIndex] = cities + encoding.GetVehicleAssignment(delimiter);
    164          
     162
    165163          delimiter++;
    166164          arrayIndex++;
Note: See TracChangeset for help on using the changeset viewer.