Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/15/19 13:36:51 (5 years ago)
Author:
abeham
Message:

#2457: merged trunk into branch

Location:
branches/2457_ExpertSystem/HeuristicLab.Optimization
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2457_ExpertSystem/HeuristicLab.Optimization

  • branches/2457_ExpertSystem/HeuristicLab.Optimization/3.3/Problems/Problem.cs

    r16075 r16956  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2323using System.Collections.Generic;
    2424using System.Drawing;
     25using HEAL.Attic;
    2526using HeuristicLab.Collections;
    2627using HeuristicLab.Common;
     
    2829using HeuristicLab.Data;
    2930using HeuristicLab.Parameters;
    30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3131
    3232namespace HeuristicLab.Optimization {
    3333  [Item("Problem", "Represents the base class for a problem.")]
    34   [StorableClass]
     34  [StorableType("6DC97432-9BD1-4304-802A-1FC48A0E0468")]
    3535  public abstract class Problem : ParameterizedNamedItem, IProblem {
    3636    private const string OperatorsParameterName = "Operators";
     
    4444
    4545    [StorableConstructor]
    46     protected Problem(bool deserializing) : base(deserializing) { }
     46    protected Problem(StorableConstructorFlag _) : base(_) { }
    4747    protected Problem(Problem original, Cloner cloner)
    4848      : base(original, cloner) {
     
    5252    protected Problem()
    5353      : base() {
    54       Parameters.Add(new FixedValueParameter<ItemCollection<IItem>>(OperatorsParameterName, "The operators and items that the problem provides to the algorithms.", new ItemCollection<IItem>(), false));
     54      Parameters.Add(new FixedValueParameter<ItemCollection<IItem>>(OperatorsParameterName, "The operators and items that the problem provides to the algorithms.", new ItemCollection<IItem>()) { GetsCollected = false });
    5555      OperatorsParameter.Hidden = true;
    5656      RegisterEventHandlers();
     
    6666        if (operators != null) {
    6767          Parameters.Remove(OperatorsParameterName);
    68           Parameters.Add(new FixedValueParameter<ItemCollection<IItem>>(OperatorsParameterName, "The operators and items that the problem provides to the algorithms.", new ItemCollection<IItem>(operators), false));
     68          Parameters.Add(new FixedValueParameter<ItemCollection<IItem>>(OperatorsParameterName, "The operators and items that the problem provides to the algorithms.", new ItemCollection<IItem>(operators)) { GetsCollected = false });
    6969          OperatorsParameter.Hidden = true;
    7070        }
     
    8484    // BackwardsCompatibility3.3
    8585    #region Backwards compatible code, remove with 3.4
    86     [Storable(Name = "Operators", AllowOneWay = true)]
     86    [Storable(OldName = "Operators")]
    8787    private IEnumerable<IOperator> StorableOperators {
    8888      set {
     
    9595        //necessary to convert old experiments files where no parameter was used for saving the operators
    9696        if (!Parameters.ContainsKey(OperatorsParameterName)) {
    97           Parameters.Add(new FixedValueParameter<ItemCollection<IItem>>(OperatorsParameterName, "The operators and items that the problem provides to the algorithms.", new ItemCollection<IItem>(), false));
     97          Parameters.Add(new FixedValueParameter<ItemCollection<IItem>>(OperatorsParameterName, "The operators and items that the problem provides to the algorithms.", new ItemCollection<IItem>()) { GetsCollected = false });
    9898          OperatorsParameter.Hidden = true;
    9999        }
     
    107107        #region Backwards compatible code, remove with 3.4
    108108        if (!Parameters.ContainsKey(OperatorsParameterName)) {
    109           Parameters.Add(new FixedValueParameter<ItemCollection<IItem>>(OperatorsParameterName, "The operators and items that the problem provides to the algorithms.", new ItemCollection<IItem>(), false));
     109          Parameters.Add(new FixedValueParameter<ItemCollection<IItem>>(OperatorsParameterName, "The operators and items that the problem provides to the algorithms.", new ItemCollection<IItem>()) { GetsCollected = false });
    110110          OperatorsParameter.Hidden = true;
    111111        }
Note: See TracChangeset for help on using the changeset viewer.