Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/07/17 12:51:24 (7 years ago)
Author:
abeham
Message:

#2696:

  • Added additional event handlers to detect change of problem instance data
  • Cleared best known solution if it cannot be evaluated anymore due to an exception, e.g. structural change
  • Cleared distance matrix in case coordinates change
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPPDTW/MDCVRPPDTWProblemInstance.cs

    r14185 r15168  
    117117
    118118    private void AttachEventHandlers() {
    119       PickupDeliveryLocationParameter.ValueChanged += new EventHandler(PickupDeliveryLocationParameter_ValueChanged);
     119      PickupDeliveryLocationParameter.ValueChanged += PickupDeliveryLocationParameter_ValueChanged;
     120      PickupDeliveryLocation.Reset += PickupDeliveryLocation_Changed;
     121      PickupDeliveryLocation.ItemChanged += PickupDeliveryLocation_Changed;
     122      PickupViolationPenaltyParameter.ValueChanged += PickupViolationPenaltyParameter_ValueChanged;
     123      PickupViolationPenalty.ValueChanged += PickupViolationPenalty_Changed;
    120124    }
    121125
     
    128132    #region Event handlers
    129133    void PickupDeliveryLocationParameter_ValueChanged(object sender, EventArgs e) {
    130       PickupDeliveryLocationParameter.Value.ItemChanged += new EventHandler<EventArgs<int>>(Value_ItemChanged);
     134      PickupDeliveryLocation.Reset += PickupDeliveryLocation_Changed;
     135      PickupDeliveryLocation.ItemChanged += PickupDeliveryLocation_Changed;
    131136      EvalBestKnownSolution();
    132137    }
    133 
    134     void Value_ItemChanged(object sender, EventArgs<int> e) {
     138    private void PickupDeliveryLocation_Changed(object sender, EventArgs e) {
     139      EvalBestKnownSolution();
     140    }
     141    private void PickupViolationPenaltyParameter_ValueChanged(object sender, EventArgs e) {
     142      PickupViolationPenalty.ValueChanged += PickupViolationPenalty_Changed;
     143      EvalBestKnownSolution();
     144    }
     145    private void PickupViolationPenalty_Changed(object sender, EventArgs e) {
    135146      EvalBestKnownSolution();
    136147    }
Note: See TracChangeset for help on using the changeset viewer.