Changeset 8053 for trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/TourEncoding.cs
- Timestamp:
- 06/19/12 13:17:29 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/TourEncoding.cs
r7906 r8053 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System.Collections.Generic; 23 using System.Drawing; 22 24 using HeuristicLab.Common; 23 25 using HeuristicLab.Core; 24 using HeuristicLab.Data;25 using HeuristicLab.Encodings.PermutationEncoding;26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using System.Drawing;28 using System.Collections.Generic;29 27 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 28 … … 36 34 get { return HeuristicLab.Common.Resources.VSImageLibrary.Class; } 37 35 } 38 36 39 37 #region IVRPEncoding Members 40 38 public virtual void Repair() { … … 53 51 54 52 Tours.Remove(tour); 55 } 53 } 56 54 } 57 55 58 public virtual List<Tour> GetTours() { 59 List<Tour> result = new List<Tour>();60 foreach (Tour tour in Tours)61 result.Add(tour.Clone() as Tour);56 public virtual List<Tour> GetTours() { 57 List<Tour> result = new List<Tour>(); 58 foreach (Tour tour in Tours) 59 result.Add(tour.Clone() as Tour); 62 60 63 return result;61 return result; 64 62 } 65 63 … … 82 80 83 81 public int Cities { 84 get 85 { 82 get { 86 83 int cities = 0; 87 84 … … 114 111 protected TourEncoding(TourEncoding original, Cloner cloner) 115 112 : base(original, cloner) { 116 117 118 119 120 113 this.Tours = (ItemList<Tour>)cloner.Clone(original.Tours); 114 if (original.ProblemInstance != null && cloner.ClonedObjectRegistered(original.ProblemInstance)) 115 this.ProblemInstance = (IVRPProblemInstance)cloner.Clone(original.ProblemInstance); 116 else 117 this.ProblemInstance = original.ProblemInstance; 121 118 } 122 119
Note: See TracChangeset
for help on using the changeset viewer.