Changeset 11303


Ignore:
Timestamp:
08/26/14 13:05:22 (5 years ago)
Author:
pfleck
Message:

#2208 merged changes from trunk

Location:
branches/HeuristicLab.Problems.Orienteering
Files:
2 deleted
47 edited
7 copied

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.Orienteering

  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchImprovementOperator.cs

    r11185 r11303  
    3838  [Item("LocalSearchImprovementOperator", "A local search improvement operator.")]
    3939  [StorableClass]
    40   public sealed class LocalSearchImprovementOperator : SingleSuccessorOperator, ILocalImprovementOperator, IStochasticOperator {
     40  public sealed class LocalSearchImprovementOperator : SingleSuccessorOperator, ILocalImprovementAlgorithmOperator, IStochasticOperator {
    4141    #region IGenericLocalImprovementOperator Properties
    4242    public Type ProblemType { get { return typeof(ISingleObjectiveHeuristicOptimizationProblem); } }
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealingImprovementOperator.cs

    r11185 r11303  
    3838  [Item("SimulatedAnnealingImprovementOperator", "A simulated annealing improvement operator.")]
    3939  [StorableClass]
    40   public sealed class SimulatedAnnealingImprovementOperator : SingleSuccessorOperator, ILocalImprovementOperator, IStochasticOperator {
     40  public sealed class SimulatedAnnealingImprovementOperator : SingleSuccessorOperator, ILocalImprovementAlgorithmOperator, IStochasticOperator {
    4141    #region IGenericLocalImprovementOperator Properties
    4242    public Type ProblemType { get { return typeof(ISingleObjectiveHeuristicOptimizationProblem); } }
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/VariableNeighborhoodSearch.cs

    r11247 r11303  
    283283    private void ParameterizeLocalImprovementOperators() {
    284284      foreach (ILocalImprovementOperator op in LocalImprovementParameter.ValidValues) {
    285         if (op != LocalImprovementParameter.Value) op.Problem = null;
    286285        op.MaximumIterationsParameter.Value = null;
    287286        op.MaximumIterationsParameter.ActualName = LocalImprovementMaximumIterationsParameter.Name;
    288       }
    289       if (LocalImprovementParameter.Value != null)
    290         LocalImprovementParameter.Value.Problem = Problem;
     287
     288        var algOp = op as ILocalImprovementAlgorithmOperator;
     289        if (algOp != null && algOp != LocalImprovementParameter.Value) algOp.Problem = null;
     290      }
     291      if (LocalImprovementParameter.Value is ILocalImprovementAlgorithmOperator)
     292        ((ILocalImprovementAlgorithmOperator)LocalImprovementParameter.Value).Problem = Problem;
    291293    }
    292294    private void InitializeLocalImprovementOperators() {
    293       if (Problem == null) {
    294         LocalImprovementParameter.ValidValues.Clear();
    295       } else {
    296         foreach (var entry in LocalImprovementParameter.ValidValues.ToList()) {
    297           if (!entry.ProblemType.IsAssignableFrom(Problem.GetType())) {
    298             LocalImprovementParameter.ValidValues.Remove(entry);
    299           }
    300         }
    301         foreach (var op in Problem.Operators.OfType<ILocalImprovementOperator>()) {
     295      LocalImprovementParameter.ValidValues.Clear();
     296      if (Problem != null) {
     297        // Regular ILocalImprovementOperators queried from Problem
     298        foreach (var op in Problem.Operators.OfType<ILocalImprovementOperator>().Where(x => !(x is ILocalImprovementAlgorithmOperator))) {
    302299          LocalImprovementParameter.ValidValues.Add(op);
    303300        }
    304         foreach (ILocalImprovementOperator op in ApplicationManager.Manager.GetInstances<ILocalImprovementOperator>().Where(x => x.ProblemType.IsAssignableFrom(Problem.GetType()))) {
    305           if (!LocalImprovementParameter.ValidValues.Any(x => x.GetType() == op.GetType()))
     301        // ILocalImprovementAlgorithmOperators queried from ApplicationManager
     302        var algOps = ApplicationManager.Manager.GetInstances<ILocalImprovementAlgorithmOperator>()
     303                                               .Where(x => x.ProblemType.IsInstanceOfType(Problem));
     304        foreach (var op in algOps) {
     305          if (LocalImprovementParameter.ValidValues.All(x => x.GetType() != op.GetType()))
    306306            LocalImprovementParameter.ValidValues.Add(op);
    307307        }
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core/3.3/Collections/DirectedGraph/Arc.cs

    r11241 r11303  
    2525
    2626namespace HeuristicLab.Core {
    27   /// <summary>
    28   /// An arc that can have a weight, a label, and a data object for holding additional info
    29   /// </summary>
     27  [Item("Arc", "A graph arc connecting two graph vertices, that can have a weight, label, and data object for holding additional info")]
    3028  [StorableClass]
    3129  public class Arc : Item, IArc {
     
    5957
    6058    [Storable]
    61     protected IDeepCloneable data;
    62     public IDeepCloneable Data {
     59    protected object data;
     60    public object Data {
    6361      get { return data; }
    6462      set {
     
    8381      label = original.Label;
    8482      weight = original.Weight;
    85       data = cloner.Clone(data);
     83      if (data is IDeepCloneable)
     84        data = cloner.Clone((IDeepCloneable)data);
     85      else data = original.Data;
    8686    }
    8787    public override IDeepCloneable Clone(Cloner cloner) { return new Arc(this, cloner); }
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core/3.3/Collections/DirectedGraph/DirectedGraph.cs

    r11241 r11303  
    5757      vertices = new HashSet<IVertex>(original.vertices.Select(cloner.Clone));
    5858      arcs = new HashSet<IArc>(original.arcs.Select(cloner.Clone));
     59
     60      // add the arcs to the newly cloned vertices
     61      foreach (var arc in arcs) {
     62        arc.Source.AddArc(arc);
     63        arc.Target.AddArc(arc);
     64      }
    5965    }
    6066
     
    7177    private void AfterDeserialization() {
    7278      foreach (var vertex in vertices) {
    73         vertex.ArcAdded += OnArcAdded;
    74         vertex.ArcRemoved += OnArcRemoved;
     79        vertex.ArcAdded += Vertex_ArcAdded;
     80        vertex.ArcRemoved += Vertex_ArcRemoved;
    7581      }
    7682
     
    8995
    9096    public virtual void AddVertex(IVertex vertex) {
    91       vertices.Add(vertex);
    92       // register event handlers
    93       vertex.ArcAdded += OnArcAdded;
    94       vertex.ArcRemoved += OnArcRemoved;
     97      if (!vertices.Contains(vertex) && vertex.Degree > 0)
     98        throw new ArgumentException("New vertices cannot have any arcs.");
     99
     100      if (vertices.Add(vertex)) {
     101        // register event handlers
     102        vertex.ArcAdded += Vertex_ArcAdded;
     103        vertex.ArcRemoved += Vertex_ArcRemoved;
     104        OnVertedAdded(this, new EventArgs<IVertex>(vertex));
     105      }
    95106    }
    96107
     
    102113        RemoveArc(arc);
    103114      // deregister event handlers
    104       vertex.ArcAdded -= OnArcAdded;
    105       vertex.ArcRemoved -= OnArcRemoved;
     115      vertex.ArcAdded -= Vertex_ArcAdded;
     116      vertex.ArcRemoved -= Vertex_ArcRemoved;
     117      OnVertexRemoved(this, new EventArgs<IVertex>(vertex));
    106118    }
    107119
     
    128140    }
    129141
    130     public event EventHandler ArcAdded;
    131     protected virtual void OnArcAdded(object sender, EventArgs<IArc> args) {
     142    protected virtual void Vertex_ArcAdded(object sender, EventArgs<IArc> args) {
     143      // the ArcAdded event is fired by a vertex when an arc from/to another vertex is added to its list of connections
     144      // because the arc is added in both directions by both the source and the target, this event will get fired twice here
    132145      var arc = args.Value;
    133       // the ArcAdded event is fired by a vertex when an arc from or towards another vertex is added to his list of connections
    134       // because the arc is added in both directions by both the source and the target, this event will get fired twice
    135       // here, we only want to add the arc once, so if its already contained, we return without complaining
    136       if (arcs.Contains(arc)) return;
    137       arcs.Add(arc);
     146      if (arcs.Add(arc)) OnArcAdded(this, new EventArgs<IArc>(arc));
    138147    }
    139148
    140 
    141     public event EventHandler ArcRemoved;
    142     protected virtual void OnArcRemoved(object sender, EventArgs<IArc> args) {
     149    protected virtual void Vertex_ArcRemoved(object sender, EventArgs<IArc> args) {
    143150      var arc = args.Value;
    144       if (!arcs.Contains(arc)) return; // the same rationale as above
    145       arcs.Remove(arc);
     151      if (arcs.Remove(arc)) OnArcRemoved(this, new EventArgs<IArc>(arc));
    146152    }
    147153
    148154    // events
    149     public event EventHandler VertexAdded;
    150     public event EventHandler VertexRemoved;
     155    public event EventHandler<EventArgs<IVertex>> VertexAdded;
     156    protected virtual void OnVertedAdded(object sender, EventArgs<IVertex> args) {
     157      var added = VertexAdded;
     158      if (added != null)
     159        added(sender, args);
     160    }
     161
     162    public event EventHandler<EventArgs<IVertex>> VertexRemoved;
     163    protected virtual void OnVertexRemoved(object sender, EventArgs<IVertex> args) {
     164      var removed = VertexRemoved;
     165      if (removed != null)
     166        removed(sender, args);
     167    }
     168
     169    public event EventHandler<EventArgs<IArc>> ArcAdded;
     170    protected virtual void OnArcAdded(object sender, EventArgs<IArc> args) {
     171      var added = ArcAdded;
     172      if (added != null)
     173        added(sender, args);
     174    }
     175
     176    public event EventHandler<EventArgs<IArc>> ArcRemoved;
     177    protected virtual void OnArcRemoved(object sender, EventArgs<IArc> args) {
     178      var removed = ArcRemoved;
     179      if (removed != null)
     180        removed(sender, args);
     181    }
    151182  }
    152183}
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core/3.3/Collections/DirectedGraph/Vertex.cs

    r11241 r11303  
    2727
    2828namespace HeuristicLab.Core {
     29  [Item("Vertex", "An object representing a vertex in the graph. It can have a text label, a weight, and an additional data object.")]
    2930  [StorableClass]
    3031  public class Vertex : Item, IVertex {
     
    9293      weight = original.Weight;
    9394
    94       inArcs = original.InArcs.Select(cloner.Clone).ToList();
    95       outArcs = original.OutArcs.Select(cloner.Clone).ToList();
     95      // we do not clone the arcs here (would cause too much recursion and ultimately a stack overflow)
    9696    }
    9797
     
    102102    public void AddArc(IArc arc) {
    103103      if (this != arc.Source && this != arc.Target)
    104         throw new InvalidOperationException("The current vertex must be either the arc source or the arc target.");
     104        throw new ArgumentException("The current vertex must be either the arc source or the arc target.");
     105
     106      if (arc.Source == arc.Target)
     107        throw new ArgumentException("Arc source and target must be different.");
    105108
    106109      if (this == arc.Source) {
     
    117120    public void RemoveArc(IArc arc) {
    118121      if (this != arc.Source && this != arc.Target)
    119         throw new InvalidOperationException("The current vertex must be either the arc source or the arc target.");
     122        throw new ArgumentException("The current vertex must be either the arc source or the arc target.");
    120123
    121124      if (this == arc.Source) {
     
    167170    }
    168171
     172    public Vertex(IDeepCloneable data)
     173      : base(data) {
     174    }
     175
    169176    public override IDeepCloneable Clone(Cloner cloner) {
    170177      return new Vertex<T>(this, cloner);
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core/3.3/HeuristicLab.Core-3.3.csproj

    r10291 r11303  
    116116    <Compile Include="Collections\CheckedItemCollection.cs" />
    117117    <Compile Include="Collections\CheckedItemList.cs" />
     118    <Compile Include="Collections\DirectedGraph\Arc.cs" />
     119    <Compile Include="Collections\DirectedGraph\DirectedGraph.cs" />
     120    <Compile Include="Collections\DirectedGraph\Vertex.cs" />
    118121    <Compile Include="Collections\ReadOnlyCheckedItemCollection.cs" />
    119122    <Compile Include="Collections\ReadOnlyCheckedItemList.cs">
     
    148151    <Compile Include="Constraints\IConstraint.cs" />
    149152    <Compile Include="Constraints\TypeCompatibilityConstraint.cs" />
     153    <Compile Include="Interfaces\DirectedGraph\IArc.cs" />
     154    <Compile Include="Interfaces\DirectedGraph\IDirectedGraph.cs" />
     155    <Compile Include="Interfaces\DirectedGraph\IVertex.cs" />
    150156    <Compile Include="Interfaces\ICheckedMultiOperator.cs" />
    151157    <Compile Include="Interfaces\IConstrainedValueParameter.cs" />
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core/3.3/Interfaces/DirectedGraph/IArc.cs

    r11241 r11303  
    2121
    2222using System;
    23 using HeuristicLab.Common;
    2423
    2524namespace HeuristicLab.Core {
     
    2928    string Label { get; set; }
    3029    double Weight { get; set; }
    31     IDeepCloneable Data { get; set; }
     30    object Data { get; set; }
    3231
    3332    event EventHandler Changed; // generic event for when the label, weight or data were changed
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core/3.3/Interfaces/DirectedGraph/IDirectedGraph.cs

    r11241 r11303  
    2222using System;
    2323using System.Collections.Generic;
     24using HeuristicLab.Common;
    2425
    2526namespace HeuristicLab.Core {
     
    3435    IEnumerable<IArc> Arcs { get; }
    3536
    36     event EventHandler VertexAdded;
    37     event EventHandler VertexRemoved;
    38     event EventHandler ArcAdded;
    39     event EventHandler ArcRemoved;
     37    event EventHandler<EventArgs<IVertex>> VertexAdded;
     38    event EventHandler<EventArgs<IVertex>> VertexRemoved;
     39    event EventHandler<EventArgs<IArc>> ArcAdded;
     40    event EventHandler<EventArgs<IArc>> ArcRemoved;
    4041  }
    4142}
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessorStarter.cs

    r11185 r11303  
    2121
    2222using System.Windows.Forms;
    23 using HeuristicLab.Core;
    24 using HeuristicLab.Core.Views;
    2523using HeuristicLab.MainForm;
    2624using HeuristicLab.Optimization;
    2725using HeuristicLab.Problems.DataAnalysis;
    2826using HeuristicLab.Problems.DataAnalysis.Views;
    29 using View = HeuristicLab.MainForm.WindowsForms.View;
    3027
    3128namespace HeuristicLab.DataPreprocessing.Views {
    3229  public class DataPreprocessorStarter : IDataPreprocessorStarter {
    3330
    34     public void Start(IDataAnalysisProblemData problemData, View currentView) {
     31    public void Start(IDataAnalysisProblemData problemData, IContentView currentView) {
    3532      IAlgorithm algorithm;
    3633      IDataAnalysisProblem problem;
    37       IItem parentItem = GetMostOuterContent(currentView, out algorithm, out problem);
     34      GetMostOuterContent(currentView as Control, out algorithm, out problem);
    3835      var context = new PreprocessingContext(problemData, algorithm, problem);
    3936      MainFormManager.MainForm.ShowContent(context);
    4037    }
    4138
    42     private IItem GetMostOuterContent(Control control, out IAlgorithm algorithm, out IDataAnalysisProblem problem) {
     39    private void GetMostOuterContent(Control control, out IAlgorithm algorithm, out IDataAnalysisProblem problem) {
    4340      algorithm = null;
    4441      problem = null;
    45       ItemView itemView = null;
    46       do {
     42
     43      while (control != null) {
     44        IContentView contentView = control as IContentView;
     45        if (contentView != null) {
     46          algorithm = contentView.Content as IAlgorithm;
     47          problem = contentView.Content as IDataAnalysisProblem;
     48        }
    4749        control = control.Parent;
    48         if (control is ItemView) {
    49           itemView = (ItemView)control;
    50           if (itemView.Content is IAlgorithm) {
    51             algorithm = (IAlgorithm)itemView.Content;
    52           }
    53           if (itemView.Content is IDataAnalysisProblem) {
    54             problem = (IDataAnalysisProblem)itemView.Content;
    55           }
    56         }
    57       } while (control != null);
    58 
    59       return itemView.Content;
     50      }
    6051    }
    6152  }
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.ExtLibs

  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.ExtLibs.sln

    r11127 r11303  
    303303    {F2F242B0-9996-4B49-828D-2BFC5925FDE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    304304    {F2F242B0-9996-4B49-828D-2BFC5925FDE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
    305     {F2F242B0-9996-4B49-828D-2BFC5925FDE0}.Debug|x64.ActiveCfg = Debug|Any CPU
    306     {F2F242B0-9996-4B49-828D-2BFC5925FDE0}.Debug|x86.ActiveCfg = Debug|Any CPU
     305    {F2F242B0-9996-4B49-828D-2BFC5925FDE0}.Debug|x64.ActiveCfg = Debug|x64
     306    {F2F242B0-9996-4B49-828D-2BFC5925FDE0}.Debug|x64.Build.0 = Debug|x64
     307    {F2F242B0-9996-4B49-828D-2BFC5925FDE0}.Debug|x86.ActiveCfg = Debug|x86
     308    {F2F242B0-9996-4B49-828D-2BFC5925FDE0}.Debug|x86.Build.0 = Debug|x86
    307309    {F2F242B0-9996-4B49-828D-2BFC5925FDE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
    308310    {F2F242B0-9996-4B49-828D-2BFC5925FDE0}.Release|Any CPU.Build.0 = Release|Any CPU
    309     {F2F242B0-9996-4B49-828D-2BFC5925FDE0}.Release|x64.ActiveCfg = Release|Any CPU
    310     {F2F242B0-9996-4B49-828D-2BFC5925FDE0}.Release|x86.ActiveCfg = Release|Any CPU
     311    {F2F242B0-9996-4B49-828D-2BFC5925FDE0}.Release|x64.ActiveCfg = Release|x64
     312    {F2F242B0-9996-4B49-828D-2BFC5925FDE0}.Release|x64.Build.0 = Release|x64
     313    {F2F242B0-9996-4B49-828D-2BFC5925FDE0}.Release|x86.ActiveCfg = Release|x86
     314    {F2F242B0-9996-4B49-828D-2BFC5925FDE0}.Release|x86.Build.0 = Release|x86
    311315    {52C66DEA-0250-477B-97F8-5CD2CD4B7332}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    312316    {52C66DEA-0250-477B-97F8-5CD2CD4B7332}.Debug|Any CPU.Build.0 = Debug|Any CPU
    313     {52C66DEA-0250-477B-97F8-5CD2CD4B7332}.Debug|x64.ActiveCfg = Debug|Any CPU
    314     {52C66DEA-0250-477B-97F8-5CD2CD4B7332}.Debug|x86.ActiveCfg = Debug|Any CPU
     317    {52C66DEA-0250-477B-97F8-5CD2CD4B7332}.Debug|x64.ActiveCfg = Debug|x64
     318    {52C66DEA-0250-477B-97F8-5CD2CD4B7332}.Debug|x64.Build.0 = Debug|x64
     319    {52C66DEA-0250-477B-97F8-5CD2CD4B7332}.Debug|x86.ActiveCfg = Debug|x86
     320    {52C66DEA-0250-477B-97F8-5CD2CD4B7332}.Debug|x86.Build.0 = Debug|x86
    315321    {52C66DEA-0250-477B-97F8-5CD2CD4B7332}.Release|Any CPU.ActiveCfg = Release|Any CPU
    316322    {52C66DEA-0250-477B-97F8-5CD2CD4B7332}.Release|Any CPU.Build.0 = Release|Any CPU
    317     {52C66DEA-0250-477B-97F8-5CD2CD4B7332}.Release|x64.ActiveCfg = Release|Any CPU
    318     {52C66DEA-0250-477B-97F8-5CD2CD4B7332}.Release|x86.ActiveCfg = Release|Any CPU
     323    {52C66DEA-0250-477B-97F8-5CD2CD4B7332}.Release|x64.ActiveCfg = Release|x64
     324    {52C66DEA-0250-477B-97F8-5CD2CD4B7332}.Release|x64.Build.0 = Release|x64
     325    {52C66DEA-0250-477B-97F8-5CD2CD4B7332}.Release|x86.ActiveCfg = Release|x86
     326    {52C66DEA-0250-477B-97F8-5CD2CD4B7332}.Release|x86.Build.0 = Release|x86
    319327  EndGlobalSection
    320328  GlobalSection(SolutionProperties) = preSolution
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.ExtLibs/HeuristicLab.DotNetScilab/1.0/HeuristicLab.DotNetScilab-1.0/HeuristicLab.DotNetScilab-1.0.csproj

    r11075 r11303  
    3636    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
    3737  </PropertyGroup>
     38  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
     39    <DebugSymbols>true</DebugSymbols>
     40    <OutputPath>..\..\..\..\bin\</OutputPath>
     41    <DefineConstants>DEBUG;TRACE</DefineConstants>
     42    <DebugType>full</DebugType>
     43    <PlatformTarget>x64</PlatformTarget>
     44    <ErrorReport>prompt</ErrorReport>
     45    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     46  </PropertyGroup>
     47  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
     48    <OutputPath>..\..\..\..\bin\</OutputPath>
     49    <DefineConstants>TRACE</DefineConstants>
     50    <Optimize>true</Optimize>
     51    <DebugType>pdbonly</DebugType>
     52    <PlatformTarget>x64</PlatformTarget>
     53    <ErrorReport>prompt</ErrorReport>
     54    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     55  </PropertyGroup>
     56  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
     57    <DebugSymbols>true</DebugSymbols>
     58    <OutputPath>..\..\..\..\bin\</OutputPath>
     59    <DefineConstants>DEBUG;TRACE</DefineConstants>
     60    <DebugType>full</DebugType>
     61    <PlatformTarget>x86</PlatformTarget>
     62    <ErrorReport>prompt</ErrorReport>
     63    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     64  </PropertyGroup>
     65  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
     66    <OutputPath>..\..\..\..\bin\</OutputPath>
     67    <DefineConstants>TRACE</DefineConstants>
     68    <Optimize>true</Optimize>
     69    <DebugType>pdbonly</DebugType>
     70    <PlatformTarget>x86</PlatformTarget>
     71    <ErrorReport>prompt</ErrorReport>
     72    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     73  </PropertyGroup>
    3874  <ItemGroup>
    3975    <Reference Include="System" />
     
    71107  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    72108  <PropertyGroup>
    73     <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
     109    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
    74110set ProjectDir=$(ProjectDir)
    75111set SolutionDir=$(SolutionDir)
    76112set Outdir=$(Outdir)
    77113
    78 call PreBuildEvent.cmd</PreBuildEvent>
     114call PreBuildEvent.cmd
     115    </PreBuildEvent>
     116    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
     117export ProjectDir=$(ProjectDir)
     118export SolutionDir=$(SolutionDir)
     119
     120$SolutionDir/PreBuildEvent.sh
     121    </PreBuildEvent>
    79122  </PropertyGroup>
    80123  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.ExtLibs/HeuristicLab.MatlabConnector/1.0/HeuristicLab.MatlabConnector-1.0/HeuristicLab.MatlabConnector-1.0.csproj

    r11128 r11303  
    3535  <PropertyGroup>
    3636    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
     37  </PropertyGroup>
     38  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
     39    <DebugSymbols>true</DebugSymbols>
     40    <OutputPath>..\..\..\..\bin\</OutputPath>
     41    <DefineConstants>DEBUG;TRACE</DefineConstants>
     42    <DebugType>full</DebugType>
     43    <PlatformTarget>x64</PlatformTarget>
     44    <ErrorReport>prompt</ErrorReport>
     45    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     46  </PropertyGroup>
     47  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
     48    <OutputPath>..\..\..\..\bin\</OutputPath>
     49    <DefineConstants>TRACE</DefineConstants>
     50    <Optimize>true</Optimize>
     51    <DebugType>pdbonly</DebugType>
     52    <PlatformTarget>x64</PlatformTarget>
     53    <ErrorReport>prompt</ErrorReport>
     54    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     55  </PropertyGroup>
     56  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
     57    <DebugSymbols>true</DebugSymbols>
     58    <OutputPath>..\..\..\..\bin\</OutputPath>
     59    <DefineConstants>DEBUG;TRACE</DefineConstants>
     60    <DebugType>full</DebugType>
     61    <PlatformTarget>x86</PlatformTarget>
     62    <ErrorReport>prompt</ErrorReport>
     63    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     64  </PropertyGroup>
     65  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
     66    <OutputPath>..\..\..\..\bin\</OutputPath>
     67    <DefineConstants>TRACE</DefineConstants>
     68    <Optimize>true</Optimize>
     69    <DebugType>pdbonly</DebugType>
     70    <PlatformTarget>x86</PlatformTarget>
     71    <ErrorReport>prompt</ErrorReport>
     72    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
    3773  </PropertyGroup>
    3874  <ItemGroup>
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj

    r9438 r11303  
    114114  </ItemGroup>
    115115  <ItemGroup>
     116    <Compile Include="Interfaces\ILocalImprovementAlgorithmOperator.cs" />
    116117    <Compile Include="Interfaces\ISingleObjectivePathRelinker.cs" />
    117118    <Compile Include="Interfaces\ISingleObjectiveImprovementOperator.cs" />
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Optimization/3.3/Interfaces/ILocalImprovementOperator.cs

    r11185 r11303  
    2020#endregion
    2121
    22 using System;
    2322using HeuristicLab.Core;
    2423using HeuristicLab.Data;
     
    2625namespace HeuristicLab.Optimization {
    2726  public interface ILocalImprovementOperator : IOperator {
    28     Type ProblemType { get; }
    29     IProblem Problem { get; set; }
    3027    IValueLookupParameter<IntValue> MaximumIterationsParameter { get; }
    3128    ILookupParameter<IntValue> EvaluatedSolutionsParameter { get; }
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Trading/3.4/InstanceProviders/CsvProblemInstanceProvider.cs

    r11185 r11303  
    2121
    2222using System;
    23 using System.Collections;
    2423using System.Collections.Generic;
    2524using System.IO;
     
    4039    }
    4140    public override Uri WebLink {
    42       get { return new Uri("http://dev.heuristiclab.com/trac/hl/core/wiki/UsersFAQ#DataAnalysisImportFileFormat"); }
     41      get { return new Uri("http://dev.heuristiclab.com/trac.fcgi/wiki/Documentation/FAQ#DataAnalysisImportFileFormat"); }
    4342    }
    4443    public override string ReferencePublication {
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Views

  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.DataAnalysis.Views/3.4/Interfaces/IDataPreprocessorStarter.cs

    r11185 r11303  
    2020#endregion
    2121
    22 using HeuristicLab.MainForm.WindowsForms;
     22using HeuristicLab.MainForm;
    2323
    2424namespace HeuristicLab.Problems.DataAnalysis.Views {
    2525  public interface IDataPreprocessorStarter {
    26     void Start(IDataAnalysisProblemData problemData, View currentView);
     26    void Start(IDataAnalysisProblemData problemData, IContentView currentView);
    2727  }
    2828}
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances.DataAnalysis

  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/CSV/ClassifiactionCSVInstanceProvider.cs

    r11185 r11303  
    3939    }
    4040    public override Uri WebLink {
    41       get { return new Uri("http://dev.heuristiclab.com/trac/hl/core/wiki/UsersFAQ#DataAnalysisImportFileFormat"); }
     41      get { return new Uri("http://dev.heuristiclab.com/trac.fcgi/wiki/Documentation/FAQ#DataAnalysisImportFileFormat"); }
    4242    }
    4343    public override string ReferencePublication {
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Clustering/CSV/ClusteringCSVInstanceProvider.cs

    r11185 r11303  
    3939    }
    4040    public override Uri WebLink {
    41       get { return new Uri("http://dev.heuristiclab.com/trac/hl/core/wiki/UsersFAQ#DataAnalysisImportFileFormat"); }
     41      get { return new Uri("http://dev.heuristiclab.com/trac.fcgi/wiki/Documentation/FAQ#DataAnalysisImportFileFormat"); }
    4242    }
    4343    public override string ReferencePublication {
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/CSV/RegressionCSVInstanceProvider.cs

    r11185 r11303  
    3939    }
    4040    public override Uri WebLink {
    41       get { return new Uri("http://dev.heuristiclab.com/trac/hl/core/wiki/UsersFAQ#DataAnalysisImportFileFormat"); }
     41      get { return new Uri("http://dev.heuristiclab.com/trac.fcgi/wiki/Documentation/FAQ#DataAnalysisImportFileFormat"); }
    4242    }
    4343    public override string ReferencePublication {
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TableFileParser.cs

    r11185 r11303  
    169169      //create columns
    170170      for (int col = 0; col < columns; col++) {
    171         var types = rowValues.Select(r => r[col]).Where(v => v != null && v as string != string.Empty).Take(10).Select(v => v.GetType());
     171        var types = rowValues.Select(r => r[col]).Where(v => v != null && v as string != string.Empty).Take(100).Select(v => v.GetType());
    172172        if (!types.Any()) {
    173173          values.Add(new List<string>());
     
    193193            values[columnIndex].Add(DateTime.MinValue);
    194194          else if (values[columnIndex] is List<string> && !(element is string))
    195             values[columnIndex].Add(string.Empty);
     195            values[columnIndex].Add(element.ToString());
    196196          else
    197197            values[columnIndex].Add(element);
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/CSV/TimeSeriesPrognosisCSVInstanceProvider.cs

    r11185 r11303  
    3939    }
    4040    public override Uri WebLink {
    41       get { return new Uri("http://dev.heuristiclab.com/trac/hl/core/wiki/UsersFAQ#DataAnalysisImportFileFormat"); }
     41      get { return new Uri("http://dev.heuristiclab.com/trac.fcgi/wiki/Documentation/FAQ#DataAnalysisImportFileFormat"); }
    4242    }
    4343    public override string ReferencePublication {
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances.VehicleRouting/3.4/CordeauFormat/CordeauFormatInstanceProvider.cs

    r11289 r11303  
    2323
    2424namespace HeuristicLab.Problems.Instances.VehicleRouting {
    25   public abstract class CordeauFormatInstanceProvider : VRPInstanceProvider<MDCVRPTWData> {
    26     protected override MDCVRPTWData LoadData(Stream stream) {
     25  public abstract class CordeauFormatInstanceProvider<T> : VRPInstanceProvider<T> where T : MDCVRPData {
     26    protected override T LoadData(Stream stream) {
    2727      return LoadInstance(new CordeauParser(stream));
    2828    }
     
    3131      get { return true; }
    3232    }
    33     public override MDCVRPTWData ImportData(string path) {
     33    public override T ImportData(string path) {
    3434      return LoadInstance(new CordeauParser(path));
    3535    }
    3636
    37     private MDCVRPTWData LoadInstance(CordeauParser parser) {
    38       parser.Parse();
    39 
    40       var instance = new MDCVRPTWData();
    41       instance.Dimension = parser.Cities + 1;
    42       instance.Depots = parser.Depots;
    43       instance.Coordinates = parser.Coordinates;
    44       instance.Capacity = parser.Capacity;
    45       instance.Demands = parser.Demands;
    46       instance.DistanceMeasure = DistanceMeasure.Euclidean;
    47       instance.ReadyTimes = parser.Readytimes;
    48       instance.ServiceTimes = parser.Servicetimes;
    49       instance.DueTimes = parser.Duetimes;
    50       instance.MaximumVehicles = parser.Vehicles;
    51 
    52       int depots = parser.Depots;
    53       int vehicles = parser.Vehicles / parser.Depots;
    54       instance.VehicleDepotAssignment = new int[depots * vehicles];
    55       int index = 0;
    56 
    57       for (int i = 0; i < depots; i++)
    58         for (int j = 0; j < vehicles; j++) {
    59           instance.VehicleDepotAssignment[index] = i;
    60           index++;
    61         }
    62 
    63       instance.Name = parser.ProblemName;
    64 
    65       return instance;
    66     }
     37    internal abstract T LoadInstance(CordeauParser parser);
    6738  }
    6839}
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances.VehicleRouting/3.4/HeuristicLab.Problems.Instances.VehicleRouting-3.4.csproj

    r8624 r11303  
    103103  <ItemGroup>
    104104    <Reference Include="ICSharpCode.SharpZipLib">
    105     <HintPath>..\..\HeuristicLab.PluginInfrastructure\3.3\ICSharpCode.SharpZipLib.dll</HintPath>
    106     <Private>False</Private>
    107   </Reference>
     105      <HintPath>..\..\HeuristicLab.PluginInfrastructure\3.3\ICSharpCode.SharpZipLib.dll</HintPath>
     106      <Private>False</Private>
     107    </Reference>
    108108    <Reference Include="System" />
    109109    <Reference Include="System.Core" />
     
    111111  </ItemGroup>
    112112  <ItemGroup>
     113    <Compile Include="CordeauFormat\CordeauMDTWInstanceProvider.cs" />
    113114    <Compile Include="GoldenFormat\ChristofidesInstanceProvider.cs" />
    114115    <Compile Include="GoldenFormat\KytojokiInstanceProvider.cs" />
     
    122123    <Compile Include="TSPLibFormat\AugeratInstanceProvider.cs" />
    123124    <Compile Include="TSPLibFormat\ChristofidesEilonInstanceProvider.cs" />
    124     <Compile Include="CordeauFormat\CordeauInstanceProvider.cs" />
     125    <Compile Include="CordeauFormat\CordeauMDInstanceProvider.cs" />
    125126    <Compile Include="CordeauFormat\CordeauFormatInstanceProvider.cs" />
    126127    <Compile Include="LiLimFormat\LiLimInstanceProvider.cs" />
     
    142143    <EmbeddedResource Include="Data\Homberger.zip" />
    143144    <EmbeddedResource Include="Data\LiLim.zip" />
    144     <EmbeddedResource Include="Data\Cordeau.zip" />
    145145    <EmbeddedResource Include="Data\Golden.zip" />
    146146    <EmbeddedResource Include="Data\Christofides.zip" />
     
    148148    <EmbeddedResource Include="Data\Taillard.opt.zip" />
    149149    <EmbeddedResource Include="Data\Taillard.zip" />
     150    <EmbeddedResource Include="Data\CordeauMD.zip" />
     151    <EmbeddedResource Include="Data\CordeauMDTW.zip" />
    150152    <None Include="Plugin.cs.frame" />
    151153    <Compile Include="Plugin.cs" />
     
    180182  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    181183  <PropertyGroup>
    182    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
     184    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
    183185set ProjectDir=$(ProjectDir)
    184186set SolutionDir=$(SolutionDir)
     
    186188
    187189call PreBuildEvent.cmd</PreBuildEvent>
    188 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
     190    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
    189191export ProjectDir=$(ProjectDir)
    190192export SolutionDir=$(SolutionDir)
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances.VehicleRouting/3.4/LiLimFormat/LiLimInstanceProvider.cs

    r11185 r11303  
    3737      get { return "LiLim test set"; }
    3838    }
    39    
     39
    4040    public override Uri WebLink {
    41       get { return new Uri(@"http://www.sintef.no/Projectweb/TOP/Problems/PDPTW/Li--Lim-benchmark/"); }
     41      get { return new Uri(@"http://www.sintef.no/Projectweb/TOP/PDPTW/Li--Lim-benchmark/"); }
    4242    }
    4343
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances.VehicleRouting/3.4/SolomonFormat/HombergerInstanceProvider.cs

    r11185 r11303  
    3737      get { return "Homberger test set"; }
    3838    }
    39    
     39
    4040    public override Uri WebLink {
    41       get { return new Uri(@"http://www.fernuni-hagen.de/WINF/touren/inhalte/probinst.htm"); }
     41      get { return new Uri(@"http://www.sintef.no/Projectweb/TOP/VRPTW/Homberger-benchmark/"); }
    4242    }
    4343
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances.VehicleRouting/3.4/VRPInstanceProvider.cs

    r11289 r11303  
    9393            routes.Add(route);
    9494          }
     95
     96          if (line.StartsWith("Solution")) {
     97            if (routes.Any()) {
     98              // Skip remaining solutions since only one "best solution" is stored
     99              break;
     100            }
     101          }
    95102        }
    96103      }
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Improvers/OrienteeringLocalImprovementOperator.cs

    r11245 r11303  
    3838  [StorableClass]
    3939  public class OrienteeringLocalImprovementOperator : SingleSuccessorOperator, ILocalImprovementOperator {
    40     #region IGenericLocalImprovementOperator Properties
    41     public Type ProblemType { get { return typeof(OrienteeringProblem); } }
    42 
    43     public OrienteeringProblem Problem {
    44       get { return problem; }
    45       set { ((ILocalImprovementOperator)this).Problem = value; }
    46     }
    47     IProblem ILocalImprovementOperator.Problem {
    48       get { return problem; }
    49       set {
    50         if (problem != value) {
    51           if (value != null && !(value is OrienteeringProblem))
    52             throw new ArgumentException("Only problems of type " + ProblemType.ToString() + " can be assigned.");
    53           problem = (OrienteeringProblem)value;
    54         }
    55       }
    56     }
    57     #endregion
    58 
    59     [Storable]
    60     private OrienteeringProblem problem;
    6140
    6241    #region Parameter Properties
     
    11190    private OrienteeringLocalImprovementOperator(OrienteeringLocalImprovementOperator original, Cloner cloner)
    11291      : base(original, cloner) {
    113       this.problem = cloner.Clone(original.problem);
    11492    }
    11593    public OrienteeringLocalImprovementOperator()
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/OrienteeringProblem.cs

    r11284 r11303  
    269269      ParameterizeAnalyzer();
    270270
     271      Operators.Add(new OrienteeringLocalImprovementOperator());
    271272      Operators.Add(new OrienteeringShakingOperator());
    272273      ParameterizeOperators();
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.QuadraticAssignment

  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPExhaustiveInsertionLocalImprovement.cs

    r11185 r11303  
    3535  [StorableClass]
    3636  public class QAPExhaustiveInsertionLocalImprovement : SingleSuccessorOperator, ILocalImprovementOperator {
    37 
    38     public Type ProblemType {
    39       get { return typeof(QuadraticAssignmentProblem); }
    40     }
    41 
    42     [Storable]
    43     private QuadraticAssignmentProblem problem;
    44     public IProblem Problem {
    45       get { return problem; }
    46       set { problem = (QuadraticAssignmentProblem)value; }
    47     }
    4837
    4938    public ILookupParameter<IntValue> LocalIterationsParameter {
     
    8776    protected QAPExhaustiveInsertionLocalImprovement(QAPExhaustiveInsertionLocalImprovement original, Cloner cloner)
    8877      : base(original, cloner) {
    89       this.problem = cloner.Clone(original.problem);
    9078    }
    9179    public QAPExhaustiveInsertionLocalImprovement()
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPExhaustiveInversionLocalImprovement.cs

    r11185 r11303  
    3535  [StorableClass]
    3636  public class QAPExhaustiveInversionLocalImprovement : SingleSuccessorOperator, ILocalImprovementOperator {
    37 
    38     public Type ProblemType {
    39       get { return typeof(QuadraticAssignmentProblem); }
    40     }
    41 
    42     [Storable]
    43     private QuadraticAssignmentProblem problem;
    44     public IProblem Problem {
    45       get { return problem; }
    46       set { problem = (QuadraticAssignmentProblem)value; }
    47     }
    4837
    4938    public ILookupParameter<IntValue> LocalIterationsParameter {
     
    8776    protected QAPExhaustiveInversionLocalImprovement(QAPExhaustiveInversionLocalImprovement original, Cloner cloner)
    8877      : base(original, cloner) {
    89       this.problem = cloner.Clone(original.problem);
    9078    }
    9179    public QAPExhaustiveInversionLocalImprovement()
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPExhaustiveSwap2LocalImprovement.cs

    r11185 r11303  
    3535  [StorableClass]
    3636  public class QAPExhaustiveSwap2LocalImprovement : SingleSuccessorOperator, ILocalImprovementOperator {
    37 
    38     public Type ProblemType {
    39       get { return typeof(QuadraticAssignmentProblem); }
    40     }
    41 
    42     [Storable]
    43     private QuadraticAssignmentProblem problem;
    44     public IProblem Problem {
    45       get { return problem; }
    46       set { problem = (QuadraticAssignmentProblem)value; }
    47     }
    4837
    4938    public ILookupParameter<IntValue> LocalIterationsParameter {
     
    9180    protected QAPExhaustiveSwap2LocalImprovement(QAPExhaustiveSwap2LocalImprovement original, Cloner cloner)
    9281      : base(original, cloner) {
    93       this.problem = cloner.Clone(original.problem);
    9482    }
    9583    public QAPExhaustiveSwap2LocalImprovement()
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPStochasticScrambleLocalImprovement.cs

    r11185 r11303  
    3535  [StorableClass]
    3636  public class QAPStochasticScrambleLocalImprovement : SingleSuccessorOperator, ILocalImprovementOperator, IStochasticOperator {
    37 
    38     public Type ProblemType {
    39       get { return typeof(QuadraticAssignmentProblem); }
    40     }
    41 
    42     [Storable]
    43     private QuadraticAssignmentProblem problem;
    44     public IProblem Problem {
    45       get { return problem; }
    46       set { problem = (QuadraticAssignmentProblem)value; }
    47     }
    4837
    4938    public ILookupParameter<IntValue> LocalIterationsParameter {
     
    9584    protected QAPStochasticScrambleLocalImprovement(QAPStochasticScrambleLocalImprovement original, Cloner cloner)
    9685      : base(original, cloner) {
    97       this.problem = cloner.Clone(original.problem);
    9886    }
    9987    public QAPStochasticScrambleLocalImprovement()
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.QuadraticAssignment/3.3/QuadraticAssignmentProblem.cs

    r11185 r11303  
    302302      Operators.Add(new QAPAlleleFrequencyAnalyzer());
    303303      Operators.Add(new QAPPopulationDiversityAnalyzer());
     304
     305      Operators.Add(new QAPExhaustiveInsertionLocalImprovement());
     306      Operators.Add(new QAPExhaustiveInversionLocalImprovement());
     307      Operators.Add(new QAPStochasticScrambleLocalImprovement());
    304308      Operators.Add(new QAPExhaustiveSwap2LocalImprovement());
     309
    305310      Operators.Add(new QAPSimilarityCalculator());
    306311      ParameterizeAnalyzers();
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.TravelingSalesman.Views

  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.TravelingSalesman.Views/3.3/PathTSPTourView.cs

    r11185 r11303  
    111111                Point[] tour = new Point[permutation.Length];
    112112                for (int i = 0; i < permutation.Length; i++) {
    113                   tour[i] = points[permutation[i]];
     113                  if (permutation[i] >= 0 && permutation[i] < points.Length)
     114                    tour[i] = points[permutation[i]];
    114115                }
    115116                graphics.DrawPolygon(Pens.Black, tour);
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.VehicleRouting

  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/LocalImprovement/AlbaLambdaInterchangeLocalImprovementOperator.cs

    r11185 r11303  
    3737  [StorableClass]
    3838  public class AlbaLambdaInterchangeLocalImprovementOperator : VRPOperator, IStochasticOperator, ILocalImprovementOperator {
    39     public Type ProblemType {
    40       get { return typeof(VehicleRoutingProblem); }
    41     }
    42 
    43     [Storable]
    44     private VehicleRoutingProblem problem;
    45     public IProblem Problem {
    46       get { return problem; }
    47       set { problem = (VehicleRoutingProblem)value; }
    48     }
    4939
    5040    public IValueLookupParameter<IntValue> MaximumIterationsParameter {
     
    8474    protected AlbaLambdaInterchangeLocalImprovementOperator(AlbaLambdaInterchangeLocalImprovementOperator original, Cloner cloner)
    8575      : base(original, cloner) {
    86         this.problem = cloner.Clone(original.problem);
    8776    }
    8877    public AlbaLambdaInterchangeLocalImprovementOperator()
     
    10291    }
    10392
    104     public static void Apply(AlbaEncoding solution, int maxIterations, 
     93    public static void Apply(AlbaEncoding solution, int maxIterations,
    10594      int lambda, int samples, IRandom random, IVRPProblemInstance problemInstance, ref double quality, out int evaluatedSolutions) {
    10695      evaluatedSolutions = 0;
     
    120109          }
    121110        }
    122         if (bestMove != null) 
     111        if (bestMove != null)
    123112          AlbaLambdaInterchangeMoveMaker.Apply(solution, bestMove);
    124113      }
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs

    r11289 r11303  
    3333using HeuristicLab.PluginInfrastructure;
    3434using HeuristicLab.Problems.Instances;
     35using HeuristicLab.Problems.VehicleRouting.Encodings.Alba;
    3536using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3637using HeuristicLab.Problems.VehicleRouting.Interpreters;
     
    263264            defaultCreator = creator;
    264265        }
     266        Operators.Add(new AlbaLambdaInterchangeLocalImprovementOperator());
    265267        if (defaultCreator != null)
    266268          solutionCreatorParameter.Value = defaultCreator;
Note: See TracChangeset for help on using the changeset viewer.