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/ProblemInstances/MultiDepotVRP/MultiDepotVRPProblemInstance.cs

    r6854 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
    22 using System;
    2322using System.Collections.Generic;
    2423using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Problems.VehicleRouting.Interfaces;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     24using HeuristicLab.Common;
    2825using HeuristicLab.Core;
    29 using HeuristicLab.Parameters;
    3026using HeuristicLab.Data;
    3127using HeuristicLab.Optimization;
     28using HeuristicLab.Parameters;
     29using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3230using HeuristicLab.PluginInfrastructure;
     31using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3332using HeuristicLab.Problems.VehicleRouting.Variants;
    34 using HeuristicLab.Common;
    3533
    3634namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    3735  [Item("MultiDepotVRPProblemInstance", "Represents a multi depot VRP instance.")]
    3836  [StorableClass]
    39   public class MultiDepotVRPProblemInstance: VRPProblemInstance, IMultiDepotProblemInstance {
     37  public class MultiDepotVRPProblemInstance : VRPProblemInstance, IMultiDepotProblemInstance {
    4038    protected IValueParameter<IntValue> DepotsParameter {
    4139      get { return (IValueParameter<IntValue>)Parameters["Depots"]; }
     
    6058      }
    6159    }
    62    
     60
    6361    protected override IEnumerable<IOperator> GetOperators() {
    6462      return ApplicationManager.Manager.GetInstances<IMultiDepotOperator>().Cast<IOperator>();
     
    9593    public override double[] GetCoordinates(int city) {
    9694      double[] coordinates;
    97      
     95
    9896      if (city == 0) {
    9997        //calculate centroid
     
    119117    public int GetDepot(int customer, IVRPEncoding solution) {
    120118      int depot = -1;
    121      
     119
    122120      Tour tour =
    123121          solution.GetTours().FirstOrDefault(t => t.Stops.Contains(customer));
     
    135133      if (start == 0 && end == 0)
    136134        return 0;
    137      
     135
    138136      if (start == 0) {
    139137        start = GetDepot(end, solution);
     
    146144        end += Depots.Value - 1;
    147145      }
    148      
     146
    149147      return base.GetDistance(start, end, solution);
    150148    }
    151149
    152     public override double GetInsertionDistance(int start, int customer, int end, IVRPEncoding solution, 
     150    public override double GetInsertionDistance(int start, int customer, int end, IVRPEncoding solution,
    153151      out double startDistance, out double endDistance) {
    154152      if (start == 0) {
     
    163161      }
    164162      customer += Depots.Value - 1;
    165      
     163
    166164      double distance = base.GetDistance(start, end, solution);
    167165
     
    173171      return newDistance - distance;
    174172    }
    175    
     173
    176174    [StorableConstructor]
    177175    protected MultiDepotVRPProblemInstance(bool deserializing) : base(deserializing) { }
Note: See TracChangeset for help on using the changeset viewer.