Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/12/17 21:07:36 (7 years ago)
Author:
abeham
Message:

#2696, #2790: merged revisions 15072, 15083, 15168 to stable

Location:
stable
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Problems.VehicleRouting

  • stable/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPProblemInstance.cs

    r14186 r15219  
    110110
    111111    private void AttachEventHandlers() {
    112       CapacityParameter.ValueChanged += new EventHandler(CapacityParameter_ValueChanged);
    113       OverloadPenaltyParameter.ValueChanged += new EventHandler(OverloadPenaltyParameter_ValueChanged);
    114       OverloadPenaltyParameter.Value.ValueChanged += new EventHandler(OverloadPenalty_ValueChanged);
     112      CapacityParameter.ValueChanged += CapacityParameter_ValueChanged;
     113      Capacity.Reset += Capacity_Changed;
     114      Capacity.ItemChanged += Capacity_Changed;
     115      OverloadPenaltyParameter.ValueChanged += OverloadPenaltyParameter_ValueChanged;
     116      OverloadPenalty.ValueChanged += OverloadPenalty_ValueChanged;
    115117    }
    116118
     
    123125    #region Event handlers
    124126    void CapacityParameter_ValueChanged(object sender, EventArgs e) {
     127      Capacity.Reset += Capacity_Changed;
     128      Capacity.ItemChanged += Capacity_Changed;
     129      EvalBestKnownSolution();
     130    }
     131    private void Capacity_Changed(object sender, EventArgs e) {
    125132      EvalBestKnownSolution();
    126133    }
    127134    void OverloadPenaltyParameter_ValueChanged(object sender, EventArgs e) {
    128       OverloadPenaltyParameter.Value.ValueChanged += new EventHandler(OverloadPenalty_ValueChanged);
     135      OverloadPenalty.ValueChanged += OverloadPenalty_ValueChanged;
    129136      EvalBestKnownSolution();
    130137    }
  • stable/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPPDTW/MDCVRPPDTWProblemInstance.cs

    r14186 r15219  
    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    }
  • stable/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPTWProblemInstance.cs

    r14186 r15219  
    136136
    137137    private void AttachEventHandlers() {
    138       TardinessPenaltyParameter.ValueChanged += new EventHandler(TardinessPenaltyParameter_ValueChanged);
    139       TardinessPenaltyParameter.Value.ValueChanged += new EventHandler(TardinessPenalty_ValueChanged);
    140       TimeFactorParameter.ValueChanged += new EventHandler(TimeFactorParameter_ValueChanged);
    141       TimeFactorParameter.Value.ValueChanged += new EventHandler(TimeFactor_ValueChanged);
     138      ReadyTimeParameter.ValueChanged += ReadyTimeParameter_ValueChanged;
     139      ReadyTime.Reset += ReadyTime_Changed;
     140      ReadyTime.ItemChanged += ReadyTime_Changed;
     141      DueTimeParameter.ValueChanged += DueTimeParameter_ValueChanged;
     142      DueTime.Reset += DueTime_Changed;
     143      DueTime.ItemChanged += DueTime_Changed;
     144      ServiceTimeParameter.ValueChanged += ServiceTimeParameter_ValueChanged;
     145      ServiceTime.Reset += ServiceTime_Changed;
     146      ServiceTime.ItemChanged += ServiceTime_Changed;
     147      TardinessPenaltyParameter.ValueChanged += TardinessPenaltyParameter_ValueChanged;
     148      TardinessPenalty.ValueChanged += TardinessPenalty_ValueChanged;
     149      TimeFactorParameter.ValueChanged += TimeFactorParameter_ValueChanged;
     150      TimeFactor.ValueChanged += TimeFactor_ValueChanged;
    142151    }
    143152
     
    149158
    150159    #region Event handlers
    151     void TardinessPenaltyParameter_ValueChanged(object sender, EventArgs e) {
    152       TardinessPenaltyParameter.Value.ValueChanged += new EventHandler(TardinessPenalty_ValueChanged);
    153       EvalBestKnownSolution();
    154     }
    155     void TardinessPenalty_ValueChanged(object sender, EventArgs e) {
    156       EvalBestKnownSolution();
    157     }
    158     void TimeFactorParameter_ValueChanged(object sender, EventArgs e) {
    159       TimeFactorParameter.Value.ValueChanged += new EventHandler(TimeFactor_ValueChanged);
    160       EvalBestKnownSolution();
    161     }
    162     void TimeFactor_ValueChanged(object sender, EventArgs e) {
     160    private void ReadyTimeParameter_ValueChanged(object sender, EventArgs e) {
     161      ReadyTime.Reset += ReadyTime_Changed;
     162      ReadyTime.ItemChanged += ReadyTime_Changed;
     163      EvalBestKnownSolution();
     164    }
     165    private void ReadyTime_Changed(object sender, EventArgs e) {
     166      EvalBestKnownSolution();
     167    }
     168    private void DueTimeParameter_ValueChanged(object sender, EventArgs e) {
     169      DueTime.Reset += DueTime_Changed;
     170      DueTime.ItemChanged += DueTime_Changed;
     171      EvalBestKnownSolution();
     172    }
     173    private void DueTime_Changed(object sender, EventArgs e) {
     174      EvalBestKnownSolution();
     175    }
     176    private void ServiceTimeParameter_ValueChanged(object sender, EventArgs e) {
     177      ServiceTime.Reset += ServiceTime_Changed;
     178      ServiceTime.ItemChanged += ServiceTime_Changed;
     179      EvalBestKnownSolution();
     180    }
     181    private void ServiceTime_Changed(object sender, EventArgs e) {
     182      EvalBestKnownSolution();
     183    }
     184    private void TardinessPenaltyParameter_ValueChanged(object sender, EventArgs e) {
     185      TardinessPenalty.ValueChanged += TardinessPenalty_ValueChanged;
     186      EvalBestKnownSolution();
     187    }
     188    private void TardinessPenalty_ValueChanged(object sender, EventArgs e) {
     189      EvalBestKnownSolution();
     190    }
     191    private void TimeFactorParameter_ValueChanged(object sender, EventArgs e) {
     192      TimeFactor.ValueChanged += TimeFactor_ValueChanged;
     193      EvalBestKnownSolution();
     194    }
     195    private void TimeFactor_ValueChanged(object sender, EventArgs e) {
    163196      EvalBestKnownSolution();
    164197    }
  • stable/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MultiDepotVRPProblemInstance.cs

    r14186 r15219  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using System.Linq;
     
    174175    [StorableConstructor]
    175176    protected MultiDepotVRPProblemInstance(bool deserializing) : base(deserializing) { }
    176 
     177    protected MultiDepotVRPProblemInstance(MultiDepotVRPProblemInstance original, Cloner cloner)
     178      : base(original, cloner) {
     179      AttachEventHandlers();
     180    }
    177181    public MultiDepotVRPProblemInstance() {
    178182      Parameters.Add(new ValueParameter<IntValue>("Depots", "The number of depots", new IntValue(0)));
    179183      Parameters.Add(new ValueParameter<IntArray>("VehicleDepotAssignment", "The assignment of vehicles to depots", new IntArray()));
     184      AttachEventHandlers();
    180185    }
    181186
     
    184189    }
    185190
    186     protected MultiDepotVRPProblemInstance(MultiDepotVRPProblemInstance original, Cloner cloner)
    187       : base(original, cloner) {
    188     }
     191    [StorableHook(HookType.AfterDeserialization)]
     192    private void AfterDeserialization() {
     193      AttachEventHandlers();
     194    }
     195
     196    private void AttachEventHandlers() {
     197      DepotsParameter.ValueChanged += DepotsParameter_ValueChanged;
     198      Depots.ValueChanged += Depots_ValueChanged;
     199      VehicleDepotAssignmentParameter.ValueChanged += VehicleDepotAssignmentParameter_ValueChanged;
     200      VehicleDepotAssignment.Reset += VehicleDepotAssignment_Changed;
     201      VehicleDepotAssignment.ItemChanged += VehicleDepotAssignment_Changed;
     202    }
     203
     204    #region Event handlers
     205    private void DepotsParameter_ValueChanged(object sender, EventArgs e) {
     206      Depots.ValueChanged += Depots_ValueChanged;
     207      EvalBestKnownSolution();
     208    }
     209    private void Depots_ValueChanged(object sender, EventArgs e) {
     210      EvalBestKnownSolution();
     211    }
     212    private void VehicleDepotAssignmentParameter_ValueChanged(object sender, EventArgs e) {
     213      VehicleDepotAssignment.Reset += VehicleDepotAssignment_Changed;
     214      VehicleDepotAssignment.ItemChanged += VehicleDepotAssignment_Changed;
     215      EvalBestKnownSolution();
     216    }
     217    private void VehicleDepotAssignment_Changed(object sender, EventArgs e) {
     218      EvalBestKnownSolution();
     219    }
     220    #endregion
    189221  }
    190222}
Note: See TracChangeset for help on using the changeset viewer.