Free cookie consent management tool by TermsFeed Policy Generator

Changeset 15066 for stable


Ignore:
Timestamp:
06/26/17 15:19:25 (8 years ago)
Author:
pfleck
Message:

#2705 merged r14478, r14481, r14482, r14504 to stable

Location:
stable
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Problems.Instances.VehicleRouting/3.4/GoldenFormat/GoldenParser.cs

    r14186 r15066  
    366366
    367367          int index = int.Parse(tokens[0]);
    368           double value = double.Parse(tokens[1]);
     368          double value = double.Parse(tokens[1], System.Globalization.CultureInfo.InvariantCulture);
    369369
    370370          demands[index] = value;
  • stable/HeuristicLab.Problems.Instances.VehicleRouting/3.4/HeuristicLab.Problems.Instances.VehicleRouting-3.4.csproj

    r11932 r15066  
    158158    <EmbeddedResource Include="Data\CordeauMDTW.opt.zip" />
    159159    <EmbeddedResource Include="Data\Homberger.opt.zip" />
     160    <EmbeddedResource Include="Data\Solomon.opt.zip" />
    160161    <None Include="Plugin.cs.frame" />
    161162    <Compile Include="Plugin.cs" />
  • stable/HeuristicLab.Problems.Instances.VehicleRouting/3.4/LiLimFormat/LiLimParser.cs

    r14186 r15066  
    149149
    150150        vehicles = int.Parse(m[0].Value);
    151         capacity = double.Parse(m[1].Value);
     151        capacity = double.Parse(m[1].Value, System.Globalization.CultureInfo.InvariantCulture);
    152152
    153153        line = reader.ReadLine();
  • stable/HeuristicLab.Problems.Instances.VehicleRouting/3.4/SolomonFormat/SolomonFormatInstanceProvider.cs

    r14186 r15066  
    2121
    2222using System;
    23 using System.Collections.Generic;
     23using System.Globalization;
    2424using System.IO;
    2525using System.Linq;
     
    6464        string date = ExtractValue(reader.ReadLine());
    6565        string reference = ExtractValue(reader.ReadLine());
    66         reader.ReadLine(); // Solution
    67 
    68         var routesQuery =
    69           from line in reader.ReadAllLines()
    70           where !string.IsNullOrEmpty(line)
    71           let tokens = ExtractValue(line).Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
    72           let stops = tokens.Select(int.Parse).Select(s => s - 1)
    73           select stops;
    74 
    75         var routes = routesQuery.Select(s => s.ToArray()).ToArray();
    76 
    77         instance.BestKnownTour = routes;
     66        switch (reader.ReadLine().Trim()) { // "Solution" or "Distance"
     67          case "Solution":
     68            var routesQuery = from line in reader.ReadAllLines()
     69                              where !string.IsNullOrEmpty(line)
     70                              let tokens = ExtractValue(line).Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
     71                              let stops = tokens.Select(int.Parse).Select(s => s - 1)
     72                              select stops;
     73            var routes = routesQuery.Select(s => s.ToArray()).ToArray();
     74            instance.BestKnownTour = routes;
     75            break;
     76          case "Distance":
     77            double quality = double.Parse(reader.ReadLine(), CultureInfo.InvariantCulture);
     78            instance.BestKnownQuality = quality;
     79            break;
     80        }
    7881      }
    7982    }
  • stable/HeuristicLab.Problems.Instances.VehicleRouting/3.4/SolomonFormat/SolomonParser.cs

    r14186 r15066  
    143143
    144144        vehicles = int.Parse(m[0].Value);
    145         capacity = double.Parse(m[1].Value);
     145        capacity = double.Parse(m[1].Value, System.Globalization.CultureInfo.InvariantCulture);
    146146
    147147        for (int i = 0; i < 4; i++) {
  • stable/HeuristicLab.Problems.VehicleRouting

  • stable/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs

    r14186 r15066  
    190190    public virtual double GetDistance(int start, int end, IVRPEncoding solution) {
    191191      if (distanceMatrix == null && UseDistanceMatrix.Value) {
    192         if (DistanceMatrix == null) DistanceMatrix = CreateDistanceMatrix();
    193         distanceMatrix = DistanceMatrix;
     192        distanceMatrix = DistanceMatrix ?? CreateDistanceMatrix();
    194193      }
    195194
  • stable/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs

    r14186 r15066  
    198198        BestKnownQuality = new DoubleValue(ProblemInstance.Evaluate(BestKnownSolution.Solution).Quality);
    199199        BestKnownSolution.Quality = BestKnownQuality;
    200       } else {
    201         BestKnownQuality = null;
    202200      }
    203201    }
     
    208206
    209207    void ProblemInstance_EvaluationChanged(object sender, EventArgs e) {
     208      BestKnownQuality = null;
    210209      EvalBestKnownSolution();
    211210    }
Note: See TracChangeset for help on using the changeset viewer.