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)

Location:
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings
Files:
19 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  }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Creators/AlbaPermutationCreator.cs

    r3991 r4068  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Operators;
     23using HeuristicLab.Common;
    2724using HeuristicLab.Core;
    2825using HeuristicLab.Data;
     26using HeuristicLab.Encodings.PermutationEncoding;
     27using HeuristicLab.Optimization;
    2928using HeuristicLab.Parameters;
    30 using HeuristicLab.Encodings.PermutationEncoding;
    3129using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    32 using HeuristicLab.Common;
    33 using HeuristicLab.Optimization;
    3430
    3531namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    4642    }
    4743    #endregion
    48    
     44
    4945    public AlbaPermutationCreator()
    5046      : base() {
     
    6258    private void Initialize() {
    6359      CitiesParameter.ValueChanged += new EventHandler(CitiesParameter_ValueChanged);
    64       if(CitiesParameter.Value != null)
    65         CitiesParameter.Value.ValueChanged += new EventHandler(CitiesValue_ValueChanged); 
     60      if (CitiesParameter.Value != null)
     61        CitiesParameter.Value.ValueChanged += new EventHandler(CitiesValue_ValueChanged);
    6662    }
    6763
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Creators/AlbaPushForwardInsertionCreator.cs

    r3938 r4068  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Operators;
    2724using HeuristicLab.Core;
    2825using HeuristicLab.Data;
     26using HeuristicLab.Encodings.PermutationEncoding;
     27using HeuristicLab.Optimization;
    2928using HeuristicLab.Parameters;
    30 using HeuristicLab.Encodings.PermutationEncoding;
    3129using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    32 using HeuristicLab.Common;
    33 using HeuristicLab.Optimization;
    3430
    3531namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    195191      gamma = N(Gamma.Value.Value, Math.Sqrt(GammaVariance.Value.Value), RandomParameter.ActualValue);
    196192
    197       double x0 = CoordinatesParameter.ActualValue[0,0];
    198       double y0 = CoordinatesParameter.ActualValue[0,1];
     193      double x0 = CoordinatesParameter.ActualValue[0, 0];
     194      double y0 = CoordinatesParameter.ActualValue[0, 1];
    199195      double distance = 0;
    200196      double cost = 0;
     
    212208      for (int i = 1; i <= CitiesParameter.ActualValue.Value; i++) {
    213209        distance = Distance(i, 0);
    214         if (CoordinatesParameter.ActualValue[i,0] < x0) distance = -distance;
     210        if (CoordinatesParameter.ActualValue[i, 0] < x0) distance = -distance;
    215211        cost = -alpha * distance + // distance 0 <-> City[i]
    216212                 beta * (DueTimeParameter.ActualValue[i]) + // latest arrival time
    217                  gamma * (Math.Asin((CoordinatesParameter.ActualValue[i,1] - y0) / distance) / 360 * distance); // polar angle
     213                 gamma * (Math.Asin((CoordinatesParameter.ActualValue[i, 1] - y0) / distance) / 360 * distance); // polar angle
    218214
    219215        index = 0;
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Crossovers/AlbaPermutationCrossover.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.Persistence.Default.CompositeSerializers.Storable;
    2722using HeuristicLab.Core;
    2823using HeuristicLab.Encodings.PermutationEncoding;
    29 using HeuristicLab.Operators;
    3024using HeuristicLab.Parameters;
     25using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3126
    3227namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    4641      int cities = 0;
    4742
    48       for(int i = 0; i < ParentsParameter.ActualValue.Length; i++) {
    49          IVRPEncoding solution = ParentsParameter.ActualValue[i];
    50          cities = solution.Cities;
     43      for (int i = 0; i < ParentsParameter.ActualValue.Length; i++) {
     44        IVRPEncoding solution = ParentsParameter.ActualValue[i];
     45        cities = solution.Cities;
    5146        if (!(solution is AlbaEncoding)) {
    5247          ParentsParameter.ActualValue[i] = AlbaEncoding.ConvertFrom(solution);
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Interfaces/IAlbaTranslocationMoveOperator.cs

    r4047 r4068  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     22using HeuristicLab.Core;
     23using HeuristicLab.Encodings.PermutationEncoding;
    2624using HeuristicLab.Optimization;
    27 using HeuristicLab.Encodings.PermutationEncoding;
    28 using HeuristicLab.Core;
    2925
    3026namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Manipulators/AlbaPermutationManipulator.cs

    r3938 r4068  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    2622using HeuristicLab.Core;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2823using HeuristicLab.Encodings.PermutationEncoding;
    2924using HeuristicLab.Parameters;
     25using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3026
    3127namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/AlbaMoveMaker.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;
    27 using HeuristicLab.Optimization;
    2822using HeuristicLab.Core;
     23using HeuristicLab.Data;
     24using HeuristicLab.Parameters;
    2925using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    30 using HeuristicLab.Parameters;
    31 using HeuristicLab.Data;
    3226
    3327namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/AlbaMoveOperator.cs

    r3947 r4068  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    2622using HeuristicLab.Core;
     23using HeuristicLab.Encodings.PermutationEncoding;
    2724using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using HeuristicLab.Encodings.PermutationEncoding;
    29 using HeuristicLab.Parameters;
    3025
    3126namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    3530    [Storable]
    3631    protected abstract IPermutationMoveOperator PermutationMoveOperatorParameter { get; set; }
    37    
     32
    3833    public override IOperation Apply() {
    3934      IVRPEncoding solution = VRPSolutionParameter.ActualValue;
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveEvaluator.cs

    r3947 r4068  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     22using HeuristicLab.Core;
     23using HeuristicLab.Encodings.PermutationEncoding;
     24using HeuristicLab.Parameters;
    2625using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    27 using HeuristicLab.Core;
    28 using HeuristicLab.Parameters;
    29 using HeuristicLab.Encodings.PermutationEncoding;
    3026using HeuristicLab.Problems.VehicleRouting.Encodings.Alba;
    31 using HeuristicLab.Data;
    3227
    3328namespace HeuristicLab.Problems.VehicleRouting {
    3429  [Item("AlbaTranslocationMoveEvaluator", "Evaluates a translocation or insertion move (3-opt) for the VRP.")]
    3530  [StorableClass]
    36   public sealed class AlbaTranslocationMoveEvaluator: VRPMoveEvaluator {
     31  public sealed class AlbaTranslocationMoveEvaluator : VRPMoveEvaluator {
    3732    public ILookupParameter<TranslocationMove> TranslocationMoveParameter {
    3833      get { return (ILookupParameter<TranslocationMove>)Parameters["TranslocationMove"]; }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveGenerator.cs

    r4047 r4068  
    2020#endregion
    2121
    22 using System;
    2322using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     23using HeuristicLab.Core;
     24using HeuristicLab.Data;
    2625using HeuristicLab.Encodings.PermutationEncoding;
    2726using HeuristicLab.Optimization;
    28 using HeuristicLab.Core;
     27using HeuristicLab.Parameters;
    2928using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    30 using HeuristicLab.Parameters;
    31 using HeuristicLab.Data;
    3229
    3330namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    4138    protected override IPermutationMoveOperator PermutationMoveOperatorParameter {
    4239      get { return TranslocationMoveGeneratorParameter.Value; }
    43       set { 
     40      set {
    4441        TranslocationMoveGeneratorParameter.Value = value as TranslocationMoveGenerator;
    4542        if (TranslocationMoveGeneratorParameter.Value is IMultiMoveGenerator) {
     
    7168    }
    7269
    73     public AlbaTranslocationMoveGenerator(): base() {
    74       Parameters.Add(new ValueLookupParameter<TranslocationMoveGenerator>("TranslocationMoveGenerator", "The move generator.",
     70    public AlbaTranslocationMoveGenerator()
     71      : base() {
     72      Parameters.Add(new ValueLookupParameter<TranslocationMoveGenerator>("TranslocationMoveGenerator", "The move generator.",
    7573        new StochasticTranslocationMultiMoveGenerator()));
    7674      Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves to generate."));
     
    9391          if (move != null) {
    9492            bool criteria1 = true;
    95             if(move.Index1 - 1 >= 0 &&
    96               move.Index3 -1 >= 0)
     93            if (move.Index1 - 1 >= 0 &&
     94              move.Index3 - 1 >= 0)
    9795              criteria1 = (permutation[move.Index1] >= cities &&
    9896                permutation[move.Index1 - 1] >= cities &&
     
    107105                permutation[index3] >= cities);
    108106
    109             if(criteria1 && criteria2)
     107            if (criteria1 && criteria2)
    110108              toBeDeleted.Add(scope);
    111109          }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveHardTabuCriterion.cs

    r4047 r4068  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     22using HeuristicLab.Core;
     23using HeuristicLab.Data;
    2624using HeuristicLab.Encodings.PermutationEncoding;
    2725using HeuristicLab.Optimization;
    28 using HeuristicLab.Core;
    2926using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    30 using HeuristicLab.Parameters;
    31 using HeuristicLab.Data;
    3227
    3328namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveMaker.cs

    r4047 r4068  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     22using HeuristicLab.Core;
     23using HeuristicLab.Data;
    2624using HeuristicLab.Encodings.PermutationEncoding;
    2725using HeuristicLab.Optimization;
    28 using HeuristicLab.Core;
    2926using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    30 using HeuristicLab.Parameters;
    31 using HeuristicLab.Data;
    3227
    3328namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    5752    }
    5853
    59     public AlbaTranslocationMoveMaker(): base() {
     54    public AlbaTranslocationMoveMaker()
     55      : base() {
    6056      moveMaker = new TranslocationMoveMaker();
    6157    }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveSoftTabuCriterion.cs

    r4047 r4068  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     22using HeuristicLab.Core;
     23using HeuristicLab.Data;
    2624using HeuristicLab.Encodings.PermutationEncoding;
    2725using HeuristicLab.Optimization;
    28 using HeuristicLab.Core;
    2926using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    30 using HeuristicLab.Parameters;
    31 using HeuristicLab.Data;
    3227
    3328namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveTabuMaker.cs

    r4047 r4068  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     22using HeuristicLab.Core;
     23using HeuristicLab.Data;
    2624using HeuristicLab.Encodings.PermutationEncoding;
    2725using HeuristicLab.Optimization;
    28 using HeuristicLab.Core;
    2926using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    30 using HeuristicLab.Parameters;
    31 using HeuristicLab.Data;
    3227
    3328namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Tour.cs

    r3938 r4068  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     22using HeuristicLab.Core;
    2623using HeuristicLab.Data;
    27 using HeuristicLab.Core;
    2824
    2925namespace HeuristicLab.Problems.VehicleRouting.Encodings {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/VRPCreator.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.Operators;
    2722using HeuristicLab.Core;
    2823using HeuristicLab.Data;
     24using HeuristicLab.Operators;
    2925using HeuristicLab.Parameters;
    3026using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3632      get { return false; }
    3733    }
    38    
     34
    3935    #region IVRPCreator Members
    4036    public IValueLookupParameter<IntValue> CitiesParameter {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/VRPCrossover.cs

    r3938 r4068  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    2622using HeuristicLab.Core;
     23using HeuristicLab.Data;
    2724using HeuristicLab.Operators;
    2825using HeuristicLab.Parameters;
    29 using HeuristicLab.Data;
    3026
    3127namespace HeuristicLab.Problems.VehicleRouting.Encodings {
    32   public abstract class VRPCrossover: SingleSuccessorOperator, IVRPCrossover {
     28  public abstract class VRPCrossover : SingleSuccessorOperator, IVRPCrossover {
    3329    #region IVRPCrossover Members
    3430
     
    5046      ChildParameter.ActualName = "VRPSolution";
    5147      Parameters.Add(new ValueLookupParameter<IntValue>("Cities", "The city count."));
    52     } 
     48    }
    5349  }
    5450}
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/VRPManipulator.cs

    r3938 r4068  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    2622using HeuristicLab.Core;
    2723using HeuristicLab.Operators;
     
    2925
    3026namespace HeuristicLab.Problems.VehicleRouting.Encodings {
    31   public abstract class VRPManipulator: SingleSuccessorOperator, IVRPManipulator {
     27  public abstract class VRPManipulator : SingleSuccessorOperator, IVRPManipulator {
    3228    #region IVRPManipulator Members
    3329
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/VRPMoveOperator.cs

    r3938 r4068  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    2622using HeuristicLab.Core;
    2723using HeuristicLab.Operators;
     
    2925
    3026namespace HeuristicLab.Problems.VehicleRouting.Encodings {
    31   public abstract class VRPMoveOperator: SingleSuccessorOperator, IVRPMoveOperator {
     27  public abstract class VRPMoveOperator : SingleSuccessorOperator, IVRPMoveOperator {
    3228    #region IVRPManipulator Members
    3329
Note: See TracChangeset for help on using the changeset viewer.