Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8007


Ignore:
Timestamp:
06/14/12 10:52:35 (13 years ago)
Author:
svonolfe
Message:

Merged changes from trunk into branch (#1177)

Location:
branches/VRP
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting.Views/3.4

  • branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting.Views/3.4/VRPImportDialog.Designer.cs

    r7882 r8007  
    169169      this.AcceptButton = this.okButton;
    170170      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    171       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     171      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    172172      this.CancelButton = this.cancelButton;
    173173      this.ClientSize = new System.Drawing.Size(586, 104);
  • branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting.Views/3.4/VRPInstanceProviderView.designer.cs

    r7881 r8007  
    2525    private void InitializeComponent() {
    2626      components = new System.ComponentModel.Container();
    27       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     27      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    2828    }
    2929
  • branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting/3.4

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4

  • branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/VRPImportDialog.Designer.cs

    r6851 r8007  
    173173      this.AcceptButton = this.okButton;
    174174      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    175       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     175      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    176176      this.CancelButton = this.cancelButton;
    177177      this.ClientSize = new System.Drawing.Size(586, 104);
  • branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/VehicleRoutingProblemView.Designer.cs

    r7871 r8007  
    2525    private void InitializeComponent() {
    2626      components = new System.ComponentModel.Container();
    27       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     27      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    2828    }
    2929
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4

  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Interfaces/IVRPProblemInstance.cs

    r7852 r8007  
    3131namespace HeuristicLab.Problems.VehicleRouting.Interfaces {
    3232  public interface IVRPProblemInstance: IItem {
    33     IVRPEvaluator SolutionEvaluator { get; }
     33    IVRPEvaluator SolutionEvaluator { get; set; }
    3434    IVRPEvaluator MoveEvaluator { get; }
    3535    IEnumerable<IOperator> Operators { get; }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs

    r7958 r8007  
    174174        return evaluator;
    175175      }
     176
     177      set {
     178        moveEvaluator = null;
     179        evaluator = value;
     180        EvalBestKnownSolution();
     181      }
    176182    }
    177183
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs

    r8003 r8007  
    4141  [Creatable("Problems")]
    4242  [StorableClass]
    43   public sealed class VehicleRoutingProblem : ParameterizedNamedItem, ISingleObjectiveHeuristicOptimizationProblem, IStorableContent, IProblemInstanceConsumer<IVRPData> {
     43  public sealed class VehicleRoutingProblem : Problem, ISingleObjectiveHeuristicOptimizationProblem, IStorableContent, IProblemInstanceConsumer<IVRPData> {
    4444    public string Filename { get; set; }
    4545
     
    107107    public ISolutionCreator SolutionCreator {
    108108      get { return SolutionCreatorParameter.Value; }
    109     }
    110 
    111     [Storable]
    112     private List<IItem> operators;
    113 
    114     public IEnumerable<IItem> Operators {
    115       get { return operators; }
    116109    }
    117110    #endregion
     
    131124      EvaluatorParameter.Hidden = true;
    132125
    133       operators = new List<IItem>();
    134 
    135126      InitializeRandomVRPInstance();
    136127      InitializeOperators();
     
    147138    private VehicleRoutingProblem(VehicleRoutingProblem original, Cloner cloner)
    148139      : base(original, cloner) {
    149       this.operators = original.operators.Select(x => (IItem)cloner.Clone(x)).ToList();
    150140      this.AttachEventHandlers();
    151141    }
     
    162152      if (handler != null) handler(this, EventArgs.Empty);
    163153    }
    164     public event EventHandler OperatorsChanged;
    165     private void OnOperatorsChanged() {
    166       EventHandler handler = OperatorsChanged;
    167       if (handler != null) handler(this, EventArgs.Empty);
    168     }
    169     public event EventHandler Reset;
    170     private void OnReset() {
    171       EventHandler handler = Reset;
    172       if (handler != null) handler(this, EventArgs.Empty);
    173     }
    174154    #endregion
    175155
     
    181161    }
    182162
     163    [Storable(Name = "operators", AllowOneWay = true)]
     164    private List<IOperator> StorableOperators {
     165      set { Operators.AddRange(value); }
     166    }
     167
    183168    private void AttachEventHandlers() {
    184169      ProblemInstanceParameter.ValueChanged += new EventHandler(ProblemInstanceParameter_ValueChanged);
    185170      BestKnownSolutionParameter.ValueChanged += new EventHandler(BestKnownSolutionParameter_ValueChanged);
     171      EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged);
     172      SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged);
    186173    }
    187174
     
    193180        EvaluatorParameter.Value = ProblemInstance.SolutionEvaluator;
    194181        IVRPCreator defaultCreator = null;
    195         foreach (IVRPCreator creator in operators.Where(o => o is IVRPCreator)) {
     182        foreach (IVRPCreator creator in Operators.Where(o => o is IVRPCreator)) {
    196183          solutionCreatorParameter.ValidValues.Add(creator);
    197184          if (creator is Encodings.Alba.RandomCreator)
     
    220207
    221208    void ProblemInstance_EvaluationChanged(object sender, EventArgs e) {
     209      EvaluatorParameter.Value = ProblemInstance.SolutionEvaluator;
    222210      EvalBestKnownSolution();
    223211    }
     
    245233
    246234    private void SolutionCreatorParameter_ValueChanged(object sender, EventArgs e) {
    247       ParameterizeSolutionCreator();
    248 
    249235      OnSolutionCreatorChanged();
    250236    }
    251237    private void EvaluatorParameter_ValueChanged(object sender, EventArgs e) {
     238      if (ProblemInstance != null)
     239        ProblemInstance.SolutionEvaluator = EvaluatorParameter.Value;
    252240      OnEvaluatorChanged();
    253241    }
    254242
    255243    private void InitializeOperators() {
    256       operators = new List<IItem>();
     244      Operators.Clear();
    257245
    258246      if (ProblemInstance != null) {
    259         operators.AddRange(
     247        Operators.AddRange(
    260248        ProblemInstance.Operators.Concat(
    261249          ApplicationManager.Manager.GetInstances<IGeneralVRPOperator>().Cast<IOperator>()).OrderBy(op => op.Name));
     
    265253    }
    266254
    267     private void ParameterizeSolutionCreator() {
    268       if (SolutionCreator is IMultiVRPOperator) {
    269         (SolutionCreator as IMultiVRPOperator).SetOperators(Operators.OfType<IOperator>());
    270       }
    271     }
    272 
    273255    private void ParameterizeOperators() {
    274       foreach (IOperator op in Operators) {
     256      foreach (IOperator op in Operators.OfType<IOperator>()) {
    275257        if (op is IMultiVRPOperator) {
    276258          (op as IMultiVRPOperator).SetOperators(Operators.OfType<IOperator>());
Note: See TracChangeset for help on using the changeset viewer.