Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11285


Ignore:
Timestamp:
08/19/14 13:50:15 (10 years ago)
Author:
pfleck
Message:

#2225
The ProblemInstanceProvider is now contravariant. Therefore the ProblemInstanceManager discovers all derivations of InstanceProvider<IVRPData>.

Note that there was a problem with covariant InstanceConsumers with the ProblemInstanceProviderView in the past (#1981).
Due to the fixes from #2110 this problem should not occur anymore.

Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances/3.3/IProblemInstanceConsumer.cs

    r11171 r11285  
    2525  public interface IProblemInstanceConsumer : IContent { }
    2626
    27   public interface IProblemInstanceConsumer<TData> : IProblemInstanceConsumer {
     27  public interface IProblemInstanceConsumer<in TData> : IProblemInstanceConsumer {
    2828    /// <summary>
    2929    /// Loads the given instance data.
  • trunk/sources/HeuristicLab.Problems.Instances/3.3/Types/VRP/VRPData.cs

    r11171 r11285  
    2525  /// Describes instances of the Vehicle Routing Problem (VRP).
    2626  /// </summary>
    27   public abstract class VRPData: IVRPData {
     27  public class VRPData : IVRPData {
    2828    /// <summary>
    2929    /// The name of the instance
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs

    r11171 r11285  
    4242  [Creatable("Problems")]
    4343  [StorableClass]
    44   public sealed class VehicleRoutingProblem : Problem, ISingleObjectiveHeuristicOptimizationProblem, IStorableContent, IProblemInstanceConsumer<VRPData> {
     44  public sealed class VehicleRoutingProblem : Problem, ISingleObjectiveHeuristicOptimizationProblem, IStorableContent, IProblemInstanceConsumer<IVRPData> {
    4545    public string Filename { get; set; }
    4646
     
    390390    #region IProblemInstanceConsumer<VRPData> Members
    391391
    392     public void Load(VRPData data) {
     392    public void Load(IVRPData data) {
    393393      var interpreterDataType = data.GetType();
    394394      var interpreterType = typeof(IVRPDataInterpreter<>).MakeGenericType(interpreterDataType);
Note: See TracChangeset for help on using the changeset viewer.