Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/20/10 20:16:18 (15 years ago)
Author:
abeham
Message:

fixed some things in trajectory based algorithms #933

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealing.cs

    r3131 r3145  
    3535  [Item("Simulated Annealing", "A simulated annealing algorithm.")]
    3636  [Creatable("Algorithms")]
    37   public class SimulatedAnnealing : EngineAlgorithm {
     37  public sealed class SimulatedAnnealing : EngineAlgorithm {
    3838    #region Problem Properties
    3939    public override Type ProblemType {
     
    132132    #endregion
    133133
     134    [StorableConstructor]
     135    private SimulatedAnnealing(bool deserializing) : base() { }
    134136    public SimulatedAnnealing()
    135137      : base() {
     
    173175    }
    174176
    175     [StorableConstructor]
    176     private SimulatedAnnealing(bool deserializing) : base() { }
    177 
    178177    public override IDeepCloneable Clone(Cloner cloner) {
    179178      SimulatedAnnealing clone = (SimulatedAnnealing)base.Clone(cloner);
     
    213212      base.Problem_EvaluatorChanged(sender, e);
    214213    }
     214    protected override void Problem_VisualizerChanged(object sender, EventArgs e) {
     215      ParameterizeStochasticOperator(Problem.Visualizer);
     216      ParameterizeMainLoop();
     217      if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
     218      base.Problem_VisualizerChanged(sender, e);
     219    }
    215220    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
    216221      foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
     
    248253      ParameterizeMoveEvaluators();
    249254      ParameterizeMoveMakers();
     255    }
     256    private void Visualizer_VisualizationParameter_ActualNameChanged(object sender, EventArgs e) {
     257      ParameterizeMainLoop();
    250258    }
    251259    #endregion
     
    325333    }
    326334    private void ParameterizeMainLoop() {
     335      MainLoop.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
    327336      MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
    328337      MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    329338      if (MoveEvaluator != null)
    330339        MainLoop.MoveQualityParameter.ActualName = MoveEvaluator.MoveQualityParameter.ActualName;
     340      MainLoop.VisualizerParameter.ActualName = Problem.VisualizerParameter.Name;
     341      if (Problem.Visualizer != null)
     342        MainLoop.VisualizationParameter.ActualName = Problem.Visualizer.VisualizationParameter.ActualName;
    331343    }
    332344    private void ParameterizeStochasticOperator(IOperator op) {
Note: See TracChangeset for help on using the changeset viewer.