Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/19/10 15:43:21 (14 years ago)
Author:
svonolfe
Message:

Merged changes from trunk into branch (#1177)

File:
1 edited

Legend:

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

    r4752 r4860  
    103103      Parameters.Add(new ValueParameter<DoubleValue>("EvalTimeFactor", "The time factor considered in the evaluation.", new DoubleValue(0)));
    104104      Parameters.Add(new ValueParameter<DoubleValue>("EvalTardinessPenalty", "The tardiness penalty considered in the evaluation.", new DoubleValue(100)));
     105
     106      AttachEventHandlers();
    105107    }
    106108
     
    111113    protected CVRPTWProblemInstance(CVRPTWProblemInstance original, Cloner cloner)
    112114      : base(original, cloner) {
     115        AttachEventHandlers();
    113116    }
     117
     118    [StorableHook(HookType.AfterDeserialization)]
     119    private void AfterDeserializationHook() {
     120      AttachEventHandlers();
     121    }
     122
     123    private void AttachEventHandlers() {
     124      TardinessPenaltyParameter.ValueChanged += new EventHandler(TardinessPenaltyParameter_ValueChanged);
     125      TardinessPenaltyParameter.Value.ValueChanged += new EventHandler(TardinessPenalty_ValueChanged);
     126      TimeFactorParameter.ValueChanged += new EventHandler(TimeFactorParameter_ValueChanged);
     127      TimeFactorParameter.Value.ValueChanged += new EventHandler(TimeFactor_ValueChanged);
     128    }
     129
     130    #region Event handlers
     131    void TardinessPenaltyParameter_ValueChanged(object sender, EventArgs e) {
     132      TardinessPenaltyParameter.Value.ValueChanged += new EventHandler(TardinessPenalty_ValueChanged);
     133      EvalBestKnownSolution();
     134    }
     135    void TardinessPenalty_ValueChanged(object sender, EventArgs e) {
     136      EvalBestKnownSolution();
     137    }
     138    void TimeFactorParameter_ValueChanged(object sender, EventArgs e) {
     139      TimeFactorParameter.Value.ValueChanged += new EventHandler(TimeFactor_ValueChanged);
     140      EvalBestKnownSolution();
     141    }
     142    void TimeFactor_ValueChanged(object sender, EventArgs e) {
     143      EvalBestKnownSolution();
     144    }
     145    #endregion
    114146  }
    115147}
Note: See TracChangeset for help on using the changeset viewer.