Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/06/11 14:57:26 (13 years ago)
Author:
svonolfe
Message:

Added adaptive constraint relaxation for all VRP variants (#1177)

Location:
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWProblemInstance.cs

    r6710 r6711  
    5050    }
    5151
     52    [Storable]
     53    private DoubleValue currentPickupViolationPenalty;
     54
    5255    public DoubleValue PickupViolationPenalty {
    53       get { return PickupViolationPenaltyParameter.Value; }
    54       set { PickupViolationPenaltyParameter.Value = value; }
     56      get {
     57        if (currentPickupViolationPenalty != null)
     58          return currentPickupViolationPenalty;
     59        else
     60          return PickupViolationPenaltyParameter.Value;
     61      }
     62      set { currentPickupViolationPenalty = value; }
    5563    }
    5664
     
    9098    protected CVRPPDTWProblemInstance(CVRPPDTWProblemInstance original, Cloner cloner)
    9199      : base(original, cloner) {
     100        currentPickupViolationPenalty = cloner.Clone(original.currentPickupViolationPenalty) as DoubleValue;
     101
    92102        AttachEventHandlers();
    93103    }
     
    100110    private void AttachEventHandlers() {
    101111      PickupDeliveryLocationParameter.ValueChanged += new EventHandler(PickupDeliveryLocationParameter_ValueChanged);
     112    }
     113
     114    public override void InitializeState() {
     115      base.InitializeState();
     116
     117      currentPickupViolationPenalty = null;
    102118    }
    103119
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWProblemInstance.cs

    r6710 r6711  
    7171      set { TimeFactorParameter.Value = value; }
    7272    }
     73
     74    [Storable]
     75    private DoubleValue currentTardinessPenalty;
     76
    7377    public DoubleValue TardinessPenalty {
    74       get { return TardinessPenaltyParameter.Value; }
    75       set { TardinessPenaltyParameter.Value = value; }
     78      get {
     79        if (currentTardinessPenalty != null)
     80          return currentTardinessPenalty;
     81        else
     82          return TardinessPenaltyParameter.Value;
     83      }
     84      set { currentTardinessPenalty = value; }
    7685    }
    7786
     
    113122    protected CVRPTWProblemInstance(CVRPTWProblemInstance original, Cloner cloner)
    114123      : base(original, cloner) {
     124        currentTardinessPenalty = cloner.Clone(original.currentTardinessPenalty) as DoubleValue;
     125
    115126        AttachEventHandlers();
    116127    }
     
    126137      TimeFactorParameter.ValueChanged += new EventHandler(TimeFactorParameter_ValueChanged);
    127138      TimeFactorParameter.Value.ValueChanged += new EventHandler(TimeFactor_ValueChanged);
     139    }
     140
     141    public override void InitializeState() {
     142      base.InitializeState();
     143
     144      currentTardinessPenalty = null;
    128145    }
    129146
Note: See TracChangeset for help on using the changeset viewer.