Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/17/11 01:04:30 (14 years ago)
Author:
cneumuel
Message:

#1215

  • manipulators for one and all parameters
  • SolutionCache to avoid multiple evaluations of equal solutions
  • RunsAnalyzer which stores all base level runs
  • ItemDictionaryView for runs
Location:
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/Manipulators/ParameterConfigurationManipulator.cs

    r5277 r5303  
    1414  // todo: item name/descr...
    1515  [StorableClass]
    16   public class ParameterConfigurationManipulator : SingleSuccessorOperator, IParameterConfigurationManipulator, IStochasticOperator {
     16  public abstract class ParameterConfigurationManipulator : SingleSuccessorOperator, IParameterConfigurationManipulator, IStochasticOperator {
    1717    public override bool CanChangeName {
    1818      get { return false; }
     
    4444      : base(original, cloner) {
    4545    }
    46     public override IDeepCloneable Clone(Cloner cloner) {
    47       return new ParameterConfigurationManipulator(this, cloner);
    48     }
    4946
    50     public sealed override IOperation Apply() {
     47    public override IOperation Apply() {
    5148      Apply(RandomParameter.ActualValue, ParameterConfigurationTreeParameter.ActualValue, IntValueManipulatorParameter.ActualValue, DoubleValueManipulatorParameter.ActualValue);
    5249      return base.Apply();
     
    5754    }
    5855
    59     private static void Mutate(IRandom random, IOptimizable configuration, IIntValueManipulator intValueManipulator, IDoubleValueManipulator doubleValueManipulator) {
     56    protected static void Mutate(IRandom random, IOptimizable configuration, IIntValueManipulator intValueManipulator, IDoubleValueManipulator doubleValueManipulator) {
    6057      var vc = configuration as IValueConfiguration;
    6158      var pc = configuration as IParameterConfiguration;
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurationTree.cs

    r5212 r5303  
    213213      return cnt;
    214214    }
     215
     216    public IOptimizable GetRandomOptimizable(IRandom random) {
     217      List<IOptimizable> allOptimizables = GetAllOptimizables();
     218      return allOptimizables[random.Next(allOptimizables.Count)];
     219    }
    215220  }
    216221}
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurations/ParameterConfiguration.cs

    r5277 r5303  
    455455    }
    456456
     457    public List<IOptimizable> GetAllOptimizables() {
     458      var list = new List<IOptimizable>();
     459      foreach (var vc in ValueConfigurations) {
     460        if (vc.Optimize) {
     461          list.Add(vc);
     462          list.AddRange(vc.GetAllOptimizables());
     463        }
     464      }
     465      return list;
     466    }
    457467  }
    458468}
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ValueConfigurations/ValueConfiguration.cs

    r5277 r5303  
    269269      }
    270270    }
     271
     272    public List<IOptimizable> GetAllOptimizables() {
     273      var list = new List<IOptimizable>();
     274      foreach (var pc in ParameterConfigurations) {
     275        if(pc.Optimize) {
     276          if(pc.ValueConfigurations.CheckedItems.Count() > 1) list.Add(pc); // only add if there are more than 1 choices. otherwise it makes no sense to optimize which VC is selected
     277          list.AddRange(pc.GetAllOptimizables());
     278        }
     279      }
     280      return list;
     281    }
    271282  }
    272283}
Note: See TracChangeset for help on using the changeset viewer.