Changeset 13583
- Timestamp:
- 02/02/16 14:10:53 (9 years ago)
- Location:
- branches/PerformanceComparison
- Files:
-
- 8 added
- 36 deleted
- 20 edited
- 12 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Algorithms/LocalAnalysis.cs
r8172 r13583 20 20 #endregion 21 21 22 using System;23 using System.Linq;24 22 using HeuristicLab.Common; 25 23 using HeuristicLab.Core; 26 24 using HeuristicLab.Data; 25 using HeuristicLab.Operators; 27 26 using HeuristicLab.Optimization; 28 27 using HeuristicLab.Optimization.Operators; 29 28 using HeuristicLab.Parameters; 30 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 using HeuristicLab.PluginInfrastructure;32 30 using HeuristicLab.Random; 31 using System; 32 using System.Linq; 33 33 34 34 namespace HeuristicLab.Analysis.FitnessLandscape { 35 35 [Item("Local Analysis", "A local analysis algorithm.")] 36 [Creatable("Algorithms")]37 36 [StorableClass] 38 public sealed class LocalAnalysis : HeuristicOptimizationEngineAlgorithm, IStorableContent{37 public abstract class LocalAnalysis<T> : HeuristicOptimizationEngineAlgorithm, IStorableContent where T : class, IOperator, new() { 39 38 public string Filename { get; set; } 40 39 … … 50 49 51 50 #region Parameter Properties 52 p rivateValueParameter<IntValue> SeedParameter {53 get { return ( ValueParameter<IntValue>)Parameters["Seed"]; }54 } 55 p rivateValueParameter<BoolValue> SetSeedRandomlyParameter {56 get { return ( ValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; }51 public IFixedValueParameter<IntValue> SeedParameter { 52 get { return (IFixedValueParameter<IntValue>)Parameters["Seed"]; } 53 } 54 public IFixedValueParameter<BoolValue> SetSeedRandomlyParameter { 55 get { return (IFixedValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; } 57 56 } 58 57 public IConstrainedValueParameter<IManipulator> MutatorParameter { 59 58 get { return (IConstrainedValueParameter<IManipulator>)Parameters["Mutator"]; } 60 59 } 61 public IConstrainedValueParameter<ISelector> SelectorParameter { 62 get { return (IConstrainedValueParameter<ISelector>)Parameters["Selector"]; } 63 } 64 private ValueParameter<IntValue> MaximumIterationsParameter { 65 get { return (ValueParameter<IntValue>)Parameters["MaximumIterations"]; } 66 } 67 private ValueParameter<IntValue> SampleSizeParameter { 68 get { return (ValueParameter<IntValue>)Parameters["SampleSize"]; } 69 } 70 private ValueParameter<MultiAnalyzer> AnalyzerParameter { 71 get { return (ValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; } 60 public IFixedValueParameter<IntValue> MaximumIterationsParameter { 61 get { return (IFixedValueParameter<IntValue>)Parameters["MaximumIterations"]; } 62 } 63 public IValueParameter<MultiAnalyzer> AnalyzerParameter { 64 get { return (IValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; } 65 } 66 public IFixedValueParameter<T> SelectorParameter { 67 get { return (IFixedValueParameter<T>)Parameters["Selector"]; } 72 68 } 73 69 #endregion 74 70 75 71 #region Properties 76 pr ivateRandomCreator RandomCreator {72 protected RandomCreator RandomCreator { 77 73 get { return (RandomCreator)OperatorGraph.InitialOperator; } 78 74 } 79 private SolutionsCreator SolutionsCreator { 80 get { return (SolutionsCreator)RandomCreator.Successor; } 81 } 82 private LocalAnalysisMainLoop MainLoop { 75 protected VariableCreator VariableCreator { 76 get { return (VariableCreator)RandomCreator.Successor; } 77 } 78 protected SolutionsCreator SolutionsCreator { 79 get { return (SolutionsCreator)VariableCreator.Successor; } 80 } 81 protected LocalAnalysisMainLoop MainLoop { 83 82 get { return (LocalAnalysisMainLoop)SolutionsCreator.Successor; } 84 83 } 85 [Storable] 86 private BestAverageWorstQualityAnalyzer qualityAnalyzer; 84 87 85 [Storable] 88 86 private QualityTrailMultiAnalyzer qualityTrailAnalyzer; … … 90 88 91 89 [StorableConstructor] 92 pr ivateLocalAnalysis(bool deserializing) : base(deserializing) { }93 pr ivate LocalAnalysis(LocalAnalysisoriginal, Cloner cloner)90 protected LocalAnalysis(bool deserializing) : base(deserializing) { } 91 protected LocalAnalysis(LocalAnalysis<T> original, Cloner cloner) 94 92 : base(original, cloner) { 95 qualityAnalyzer = (BestAverageWorstQualityAnalyzer)cloner.Clone(original.qualityAnalyzer); 96 qualityTrailAnalyzer = (QualityTrailMultiAnalyzer)cloner.Clone(original.qualityTrailAnalyzer); 97 Initialize(); 98 } 99 public LocalAnalysis() 93 qualityTrailAnalyzer = cloner.Clone(original.qualityTrailAnalyzer); 94 RegisterEventHandlers(); 95 } 96 protected LocalAnalysis(T selector) 100 97 : base() { 101 Parameters.Add(new ValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));102 Parameters.Add(new ValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));98 Parameters.Add(new FixedValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0))); 99 Parameters.Add(new FixedValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true))); 103 100 Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "Mutation operator.")); 104 Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "Selection operator.")); 105 Parameters.Add(new ValueParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.", new IntValue(10000))); 106 Parameters.Add(new ValueParameter<IntValue>("SampleSize", "Number of moves that MultiMoveGenerators should create. This is ignored for Exhaustive- and SingleMoveGenerators.", new IntValue(1))); 101 Parameters.Add(new FixedValueParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.", new IntValue(10000))); 107 102 Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze the solution and moves.", new MultiAnalyzer())); 103 Parameters.Add(new FixedValueParameter<T>("Selector", "Selection operator.", selector)); 108 104 109 105 RandomCreator randomCreator = new RandomCreator(); 106 VariableCreator variableCreator = new VariableCreator(); 110 107 SolutionsCreator solutionsCreator = new SolutionsCreator(); 111 108 LocalAnalysisMainLoop laMainLoop = new LocalAnalysisMainLoop(); … … 117 114 randomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameter.Name; 118 115 randomCreator.SetSeedRandomlyParameter.Value = null; 119 randomCreator.Successor = solutionsCreator; 116 randomCreator.Successor = variableCreator; 117 118 variableCreator.Successor = solutionsCreator; 120 119 121 120 solutionsCreator.NumberOfSolutions = new IntValue(1); … … 129 128 laMainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name; 130 129 131 qualityAnalyzer = new BestAverageWorstQualityAnalyzer();132 130 qualityTrailAnalyzer = new QualityTrailMultiAnalyzer(); 133 ParameterizeAnalyzers(); 134 UpdateAnalyzers(); 135 136 Initialize(); 137 } 138 139 public override IDeepCloneable Clone(Cloner cloner) { 140 return new LocalAnalysis(this, cloner); 131 qualityTrailAnalyzer.UpdateIntervalParameter.Value = null; 132 qualityTrailAnalyzer.UpdateIntervalParameter.ActualName = "MaximumIterations"; 133 AnalyzerParameter.Value.Operators.Add(qualityTrailAnalyzer, true); 134 135 RegisterEventHandlers(); 141 136 } 142 137 143 138 public override void Prepare() { 144 if (Problem != null) 145 base.Prepare(); 139 if (Problem != null) base.Prepare(); 146 140 } 147 141 148 142 #region Events 149 143 protected override void OnProblemChanged() { 150 ParameterizeStochasticOperator(Problem.SolutionCreator); 151 ParameterizeStochasticOperator(Problem.Evaluator); 152 foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op); 153 ParameterizeSolutionsCreator(); 154 ParameterizeMainLoop(); 144 base.OnProblemChanged(); 155 145 UpdateMutators(); 156 UpdateSelectors(); 157 UpdateAnalyzers(); 158 ParameterizeSelector(); 159 ParameterizeAnalyzers(); 160 ParameterizeIterationBasedOperators(); 161 Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged); 162 base.OnProblemChanged(); 146 Parameterize(); 147 Problem.Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged; 163 148 } 164 149 protected override void Problem_SolutionCreatorChanged(object sender, EventArgs e) { 165 ParameterizeStochasticOperator(Problem.SolutionCreator);166 ParameterizeSolutionsCreator();167 150 base.Problem_SolutionCreatorChanged(sender, e); 151 Parameterize(); 168 152 } 169 153 protected override void Problem_EvaluatorChanged(object sender, EventArgs e) { 170 ParameterizeStochasticOperator(Problem.Evaluator);171 ParameterizeSolutionsCreator();172 ParameterizeMainLoop();173 ParameterizeSelector();174 ParameterizeAnalyzers();175 Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);176 154 base.Problem_EvaluatorChanged(sender, e); 155 Parameterize(); 156 Problem.Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged; 177 157 } 178 158 protected override void Problem_OperatorsChanged(object sender, EventArgs e) { 179 foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op);180 159 UpdateMutators(); 181 UpdateSelectors(); 182 UpdateAnalyzers(); 183 ParameterizeMainLoop(); 184 ParameterizeSelector(); 185 ParameterizeAnalyzers(); 186 ParameterizeIterationBasedOperators(); 160 Parameterize(); 187 161 base.Problem_OperatorsChanged(sender, e); 188 162 } 189 163 private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) { 190 ParameterizeMainLoop(); 191 ParameterizeSelector(); 192 } 193 private void MutatorParameter_ValueChanged(object sender, EventArgs e) { 194 ParameterizeMainLoop(); 195 ParameterizeSelector(); 196 ParameterizeAnalyzers(); 164 Parameterize(); 197 165 } 198 166 #endregion 199 167 200 168 #region Helpers 201 [StorableHook(HookType.AfterDeserialization)] 202 private void Initialize() { 169 private void RegisterEventHandlers() { 203 170 if (Problem != null) { 204 Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged); 205 } 206 MutatorParameter.ValueChanged += MutatorParameter_ValueChanged; 207 } 208 private void UpdateSelectors() { 209 SelectorParameter.ValidValues.Clear(); 210 foreach (var s in ApplicationManager.Manager.GetInstances<ISelector>()) 211 SelectorParameter.ValidValues.Add(s); 212 } 171 Problem.Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged; 172 } 173 } 174 213 175 private void UpdateMutators() { 176 var selected = MutatorParameter.Value; 214 177 MutatorParameter.ValidValues.Clear(); 215 178 foreach (var m in Problem.Operators.OfType<IManipulator>()) { 216 179 MutatorParameter.ValidValues.Add(m); 217 } 218 } 219 private void UpdateAnalyzers() { 220 AnalyzerParameter.Value.Operators.Clear(); 221 if (Problem != null) { 222 foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>()) { 223 foreach (IScopeTreeLookupParameter param in analyzer.Parameters.OfType<IScopeTreeLookupParameter>()) 224 param.Depth = 0; 225 AnalyzerParameter.Value.Operators.Add(analyzer); 226 } 227 } 228 AnalyzerParameter.Value.Operators.Add(qualityAnalyzer); 229 AnalyzerParameter.Value.Operators.Add(qualityTrailAnalyzer); 230 } 231 private void ParameterizeSolutionsCreator() { 232 SolutionsCreator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name; 233 SolutionsCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name; 234 } 235 private void ParameterizeMainLoop() { 180 if (selected != null && selected.GetType() == m.GetType()) MutatorParameter.Value = m; 181 } 182 } 183 184 protected virtual void Parameterize() { 185 if (Problem == null) return; 186 236 187 MainLoop.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name; 237 188 MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 238 189 MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 239 } 240 private void ParameterizeStochasticOperator(IOperator op) { 241 if (op is IStochasticOperator) 242 ((IStochasticOperator)op).RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 243 } 244 private void ParameterizeSelector() { 245 if (Problem != null) { 246 foreach (var op in SelectorParameter.ValidValues) { 247 op.NumberOfSelectedSubScopesParameter.Value = new IntValue(1); 248 op.CopySelected = new BoolValue(false); 249 ISingleObjectiveSelector sos = op as ISingleObjectiveSelector; 250 if (sos != null) { 251 sos.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 252 sos.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 253 } 254 IStochasticOperator so = op as IStochasticOperator; 255 if (so != null) { 256 so.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 257 } 258 } 259 } 260 } 261 private void ParameterizeAnalyzers() { 262 qualityAnalyzer.ResultsParameter.ActualName = "Results"; 263 if (Problem != null) { 264 qualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 265 qualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name; 266 } 267 } 268 private void ParameterizeIterationBasedOperators() { 269 if (Problem != null) { 270 foreach (IIterationBasedOperator op in Problem.Operators.OfType<IIterationBasedOperator>()) { 271 op.IterationsParameter.ActualName = "Iterations"; 272 op.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name; 190 foreach (var sOp in Problem.Operators.OfType<IStochasticOperator>()) { 191 sOp.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 192 } 193 foreach (var iOp in Problem.Operators.OfType<IIterationBasedOperator>()) { 194 iOp.IterationsParameter.ActualName = "Iterations"; 195 iOp.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name; 196 } 197 var sEval = Problem.Evaluator as IStochasticOperator; 198 if (sEval != null) sEval.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 199 var sCrea = Problem.SolutionCreator as IStochasticOperator; 200 if (sCrea != null) sCrea.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 201 var sSel = SelectorParameter.Value as IStochasticOperator; 202 if (sSel != null) sSel.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 203 var sel = SelectorParameter.Value as ISelector; 204 if (sel != null) { 205 sel.NumberOfSelectedSubScopesParameter.Value = new IntValue(1); 206 sel.CopySelected = new BoolValue(false); 207 var sos = sel as ISingleObjectiveSelector; 208 if (sos != null) { 209 sos.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 210 sos.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 273 211 } 274 212 } -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Algorithms/LocalAnalysisMainLoop.cs
r7128 r13583 101 101 #region Create operators 102 102 VariableCreator variableCreator = new VariableCreator(); 103 SubScopesProcessor subScopesProcessor0 = new SubScopesProcessor();104 Assigner bestQualityInitializer = new Assigner();105 103 Placeholder analyzer1 = new Placeholder(); 106 ResultsCollector resultsCollector1 = new ResultsCollector();104 SubScopesCounter evaluatedSolutionsCounter1 = new SubScopesCounter(); 107 105 LeftSelector leftSelector = new LeftSelector(); 108 106 SubScopesProcessor mainProcessor = new SubScopesProcessor(); … … 110 108 Placeholder mutator = new Placeholder(); 111 109 Placeholder evaluator = new Placeholder(); 112 IntCounter evaluatedMovesCounter = new IntCounter();110 SubScopesCounter evaluatedSolutionsCounter2 = new SubScopesCounter(); 113 111 Placeholder selector = new Placeholder(); 114 SubScopesProcessor moveMakingProcessor = new SubScopesProcessor(); 115 UniformSubScopesProcessor selectedMoveMakingProcessor = new UniformSubScopesProcessor(); 116 QualityComparator qualityComparator = new QualityComparator(); 117 ConditionalBranch improvesQualityBranch = new ConditionalBranch(); 118 Assigner bestQualityUpdater = new Assigner(); 112 RightReducer rightReducer1 = new RightReducer(); 113 RightReducer rightReducer2 = new RightReducer(); 119 114 Placeholder analyzer2 = new Placeholder(); 120 RightReducer rightReducer = new RightReducer();121 RightReducer rightReducer2 = new RightReducer();122 115 IntCounter iterationsCounter = new IntCounter(); 123 116 Comparator iterationsComparator = new Comparator(); … … 126 119 127 120 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0))); 128 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("BestQuality", new DoubleValue(0))); 129 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedMoves", new IntValue(0))); 130 131 bestQualityInitializer.Name = "Initialize BestQuality"; 132 bestQualityInitializer.LeftSideParameter.ActualName = "BestQuality"; 133 bestQualityInitializer.RightSideParameter.ActualName = QualityParameter.ActualName; 121 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue(0))); 134 122 135 123 analyzer1.Name = "Analyzer (placeholder)"; 136 124 analyzer1.OperatorParameter.ActualName = AnalyzerParameter.Name; 137 125 138 resultsCollector1.CopyValue = new BoolValue(false); 139 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Iterations")); 140 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality")); 141 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves")); 142 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 126 evaluatedSolutionsCounter1.Name = "EvaluatedSolutions++"; 127 evaluatedSolutionsCounter1.AccumulateParameter.Value = new BoolValue(true); 128 evaluatedSolutionsCounter1.ValueParameter.ActualName = "EvaluatedSolutions"; 143 129 144 130 leftSelector.CopySelected = new BoolValue(true); 145 131 leftSelector.NumberOfSelectedSubScopesParameter.ActualName = SampleSizeParameter.Name; 146 132 147 mutationProcessor.Parallel = new BoolValue(true); 133 mainProcessor.Name = "Main Processsor"; 134 135 mutationProcessor.Parallel = new BoolValue(false); 148 136 149 137 mutator.Name = "(Mutator)"; … … 153 141 evaluator.OperatorParameter.ActualName = "Evaluator"; 154 142 155 evaluated MovesCounter.Name = "EvaluatedMoves++";156 evaluated MovesCounter.ValueParameter.ActualName = "EvaluatedMoves";157 evaluated MovesCounter.Increment = new IntValue(1);143 evaluatedSolutionsCounter2.Name = "EvaluatedSolutions++"; 144 evaluatedSolutionsCounter2.AccumulateParameter.Value = new BoolValue(true); 145 evaluatedSolutionsCounter2.ValueParameter.ActualName = "EvaluatedSolutions"; 158 146 159 selector.Name = " Selector (placeholder)";147 selector.Name = "(Selector)"; 160 148 selector.OperatorParameter.ActualName = SelectorParameter.Name; 161 149 162 qualityComparator.LeftSideParameter.ActualName = QualityParameter.Name; 163 qualityComparator.RightSideParameter.ActualName = "BestQuality"; 164 qualityComparator.ResultParameter.ActualName = "IsBetter"; 165 166 improvesQualityBranch.ConditionParameter.ActualName = "IsBetter"; 167 168 bestQualityUpdater.Name = "Update BestQuality"; 169 bestQualityUpdater.LeftSideParameter.ActualName = "BestQuality"; 170 bestQualityUpdater.RightSideParameter.ActualName = QualityParameter.Name; 171 172 analyzer2.Name = "Analyzer (placeholder)"; 150 analyzer2.Name = "(Analyzer)"; 173 151 analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name; 174 152 … … 183 161 iterationsComparator.ResultParameter.ActualName = "Terminate"; 184 162 185 resultsCollector2.CopyValue = new BoolValue(false); 186 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves")); 163 resultsCollector2.CopyValue = new BoolValue(true); 164 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Iterations")); 165 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("EvaluatedSolutions")); 187 166 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name; 188 167 … … 193 172 #region Create operator graph 194 173 OperatorGraph.InitialOperator = variableCreator; 195 variableCreator.Successor = subScopesProcessor0; 196 subScopesProcessor0.Operators.Add(bestQualityInitializer); 197 subScopesProcessor0.Successor = resultsCollector1; 198 bestQualityInitializer.Successor = analyzer1; 199 analyzer1.Successor = null; 200 resultsCollector1.Successor = leftSelector; 174 variableCreator.Successor = evaluatedSolutionsCounter1; 175 evaluatedSolutionsCounter1.Successor = analyzer1; 176 analyzer1.Successor = leftSelector; 201 177 leftSelector.Successor = mainProcessor; 202 178 mainProcessor.Operators.Add(new EmptyOperator()); … … 204 180 mainProcessor.Successor = rightReducer2; 205 181 mutationProcessor.Operator = mutator; 206 mutationProcessor.Successor = selector;182 mutationProcessor.Successor = evaluatedSolutionsCounter2; 207 183 mutator.Successor = evaluator; 208 evaluator.Successor = evaluatedMovesCounter; 209 evaluatedMovesCounter.Successor = null; 210 selector.Successor = moveMakingProcessor; 211 moveMakingProcessor.Operators.Add(new EmptyOperator()); 212 moveMakingProcessor.Operators.Add(selectedMoveMakingProcessor); 213 moveMakingProcessor.Successor = rightReducer; 214 selectedMoveMakingProcessor.Operator = qualityComparator; 215 selectedMoveMakingProcessor.Successor = null; 216 qualityComparator.Successor = improvesQualityBranch; 217 improvesQualityBranch.TrueBranch = bestQualityUpdater; 218 improvesQualityBranch.FalseBranch = null; 219 improvesQualityBranch.Successor = analyzer2; 220 bestQualityUpdater.Successor = null; 221 analyzer2.Successor = null; 222 rightReducer.Successor = null; 184 evaluator.Successor = null; 185 evaluatedSolutionsCounter2.Successor = selector; 186 selector.Successor = rightReducer1; 187 rightReducer1.Successor = null; 223 188 rightReducer2.Successor = iterationsCounter; 224 iterationsCounter.Successor = iterationsComparator;225 iterationsComparator.Successor = resultsCollector2;226 resultsCollector2.Successor = iterationsTermination;227 iterationsTermination.TrueBranch = null;189 iterationsCounter.Successor = analyzer2; 190 analyzer2.Successor = iterationsComparator; 191 iterationsComparator.Successor = iterationsTermination; 192 iterationsTermination.TrueBranch = resultsCollector2; 228 193 iterationsTermination.FalseBranch = leftSelector; 229 194 #endregion 230 195 } 231 232 public override IOperation Apply() {233 return base.Apply();234 }235 196 } 236 197 } -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Analysis/EnumerableExtensions.cs
r7128 r13583 19 19 */ 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 24 23 25 namespace HeuristicLab.Analysis.FitnessLandscape { 24 26 -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Analysis/FitnessCloudAnalyzer.cs
r7176 r13583 19 19 */ 20 20 #endregion 21 21 22 using System.Drawing; 22 23 using System.Linq; … … 28 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 30 30 namespace HeuristicLab.Analysis.FitnessLandscape .Analysis{31 namespace HeuristicLab.Analysis.FitnessLandscape { 31 32 32 33 [StorableClass] -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Analysis/IQualityTrailAnalyzer.cs
r7128 r13583 19 19 */ 20 20 #endregion 21 21 22 using HeuristicLab.Optimization; 23 22 24 namespace HeuristicLab.Analysis.FitnessLandscape { 23 25 public interface IQualityTrailAnalyzer : IAnalyzer { } -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Analysis/InformationAnalysis.cs
r9142 r13583 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq; 4 25 5 namespace HeuristicLab.Analysis.FitnessLandscape .Analysis{26 namespace HeuristicLab.Analysis.FitnessLandscape { 6 27 7 28 public class InformationAnalysis { … … 19 40 public List<double> PartialInformationContent { get; private set; } 20 41 public List<double> DensityBasinInformation { get; private set; } 21 public List<double> TotalEntropy { get; private set; } 42 public List<double> TotalEntropy { get; private set; } 22 43 public List<double> QualityDelta { get; private set; } 23 44 public double InformationStability { get; private set; } … … 89 110 90 111 #region types, fields and properties 91 public enum Form { Uni, NonUni, Any}112 public enum Form { Uni, NonUni, Any } 92 113 93 114 private readonly Slope[] slopes; 94 115 95 116 private static readonly Dictionary<Tuple<Form, int>, IList<Shape>> SHAPES = 96 new Dictionary<Tuple<Form, int>,IList<Shape>>();117 new Dictionary<Tuple<Form, int>, IList<Shape>>(); 97 118 #endregion 98 119 … … 130 151 131 152 private Shape Extend(Slope s) { 132 return new Shape(slopes.Concat(new[] { s}));153 return new Shape(slopes.Concat(new[] { s })); 133 154 } 134 155 … … 157 178 #region IEnumerable Members 158 179 public IEnumerator<Slope> GetEnumerator() { 159 return (IEnumerator<Slope>) 180 return (IEnumerator<Slope>)slopes.GetEnumerator(); 160 181 } 161 182 System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { … … 171 192 if (other.Length > Length) 172 193 return 1; 173 for (var i = 0; i <Length; i++) {194 for (var i = 0; i < Length; i++) { 174 195 var d = slopes[i].CompareTo(other.slopes[i]); 175 196 if (d != 0) … … 184 205 } 185 206 public override int GetHashCode() { 186 return slopes.Aggregate(0, (a, s) => a *3 + ((int)s + 1)).GetHashCode();207 return slopes.Aggregate(0, (a, s) => a * 3 + ((int)s + 1)).GetHashCode(); 187 208 } 188 209 … … 197 218 private static IEnumerable<Slope> Slopes(double eps, IEnumerable<double> differences) { 198 219 return differences.Select(d => (d > eps ? Slope.Up : (d < -eps ? Slope.Down : 0))); 199 } 220 } 200 221 201 222 private static IEnumerable<Shape> Shapes(int size, IEnumerable<Slope> slopes) { … … 243 264 244 265 private static IEnumerable<double> Differences(IEnumerable<double> values) { 245 return Utils.Delta(values,(x, y) => y - x);266 return values.Delta((x, y) => y - x); 246 267 } 247 268 -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Analysis/InformationAnalyzer.cs
r9142 r13583 20 20 #endregion 21 21 22 using System;23 using System.Linq;24 using HeuristicLab.Analysis.FitnessLandscape.DataTables;25 22 using HeuristicLab.Common; 26 23 using HeuristicLab.Core; 27 24 using HeuristicLab.Data; 28 25 using HeuristicLab.Operators; 29 using HeuristicLab.Optimization .Operators;26 using HeuristicLab.Optimization; 30 27 using HeuristicLab.Parameters; 31 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using System.Linq; 32 30 33 namespace HeuristicLab.Analysis.FitnessLandscape .Analysis{31 namespace HeuristicLab.Analysis.FitnessLandscape { 34 32 35 33 [StorableClass] 36 public class InformationAnalyzer : AlgorithmOperator, IQualityTrailAnalyzer {34 public class InformationAnalyzer : SingleSuccessorOperator, IQualityTrailAnalyzer { 37 35 public bool EnabledByDefault { 38 36 get { return false; } … … 43 41 get { return (LookupParameter<DataTable>)Parameters["Quality Trail"]; } 44 42 } 45 public LookupParameter<InformationStabilityTable> InformationStabilityParameter { 46 get { return (LookupParameter<InformationStabilityTable>)Parameters["Information Stability"]; } 47 } 48 public LookupParameter<InformationAnalysisTable> InformationParameter { 49 get { return (LookupParameter<InformationAnalysisTable>)Parameters["Information"]; } 50 } 51 public LookupParameter<VariableCollection> ResultsParameter { 52 get { return (LookupParameter<VariableCollection>)Parameters["Results"]; } 43 public LookupParameter<ResultCollection> ResultsParameter { 44 get { return (LookupParameter<ResultCollection>)Parameters["Results"]; } 53 45 } 54 46 public ValueLookupParameter<IntValue> NQuantilesParameter { … … 58 50 get { return (ValueLookupParameter<IntValue>)Parameters["ShapeSize"]; } 59 51 } 60 public LookupParameter<DoubleValue> InformationContent ValueParameter {61 get { return (LookupParameter<DoubleValue>)Parameters["InformationContent Value"]; }52 public LookupParameter<DoubleValue> InformationContentParameter { 53 get { return (LookupParameter<DoubleValue>)Parameters["InformationContent"]; } 62 54 } 63 public LookupParameter<DoubleValue> PartialInformationContent ValueParameter {64 get { return (LookupParameter<DoubleValue>)Parameters["PartialInformationContent Value"]; }55 public LookupParameter<DoubleValue> PartialInformationContentParameter { 56 get { return (LookupParameter<DoubleValue>)Parameters["PartialInformationContent"]; } 65 57 } 66 public LookupParameter<DoubleValue> DensityBasinInformation ValueParameter {67 get { return (LookupParameter<DoubleValue>)Parameters["DensityBasinInformation Value"]; }58 public LookupParameter<DoubleValue> DensityBasinInformationParameter { 59 get { return (LookupParameter<DoubleValue>)Parameters["DensityBasinInformation"]; } 68 60 } 69 public LookupParameter<DoubleValue> TotalEntropy ValueParameter {70 get { return (LookupParameter<DoubleValue>)Parameters["TotalEntropy Value"]; }61 public LookupParameter<DoubleValue> TotalEntropyParameter { 62 get { return (LookupParameter<DoubleValue>)Parameters["TotalEntropy"]; } 71 63 } 72 public LookupParameter<DoubleValue> InformationStability ValueParameter {73 get { return (LookupParameter<DoubleValue>)Parameters["InformationStability Value"]; }64 public LookupParameter<DoubleValue> InformationStabilityParameter { 65 get { return (LookupParameter<DoubleValue>)Parameters["InformationStability"]; } 74 66 } 75 public LookupParameter< IntValue> RegularityValueParameter {76 get { return (LookupParameter< IntValue>)Parameters["RegularityValue"]; }67 public LookupParameter<DoubleValue> RegularityParameter { 68 get { return (LookupParameter<DoubleValue>)Parameters["Regularity"]; } 77 69 } 78 public LookupParameter< IntValue> DiversityValueParameter {79 get { return (LookupParameter< IntValue>)Parameters["DiversityValue"]; }70 public LookupParameter<DoubleValue> DiversityParameter { 71 get { return (LookupParameter<DoubleValue>)Parameters["Diversity"]; } 80 72 } 81 82 #region Peaks83 73 public LookupParameter<DoubleValue> PeakInformationContentParameter { 84 get { return (LookupParameter<DoubleValue>) Parameters["PeakInformationContent"]; } 85 } 86 public LookupParameter<DoubleValue> PeakInformationContentQualityDeltaParameter { 87 get { return (LookupParameter<DoubleValue>) Parameters["PeakInformationContentQualityDelta"]; } 74 get { return (LookupParameter<DoubleValue>)Parameters["PeakInformationContent"]; } 88 75 } 89 76 public LookupParameter<DoubleValue> PeakDensityBasinInformationParameter { 90 get { return (LookupParameter<DoubleValue>) 77 get { return (LookupParameter<DoubleValue>)Parameters["PeakDensityBasinInformation"]; } 91 78 } 92 public LookupParameter<DoubleValue> PeakDensityBasinInformationQualityDeltaParameter {93 get { return (LookupParameter<DoubleValue>) Parameters["PeakDensityBasinInformationQualityDelta"]; }94 }95 96 97 79 #endregion 98 99 #endregion100 101 private InformationStabilityTable InformationStability {102 get { return InformationStabilityParameter.ActualValue; }103 }104 private double InformationContentValue {105 set { InformationContentValueParameter.ActualValue = new DoubleValue(value); }106 }107 private double PartialInformationContentValue {108 set { PartialInformationContentValueParameter.ActualValue = new DoubleValue(value); }109 }110 private double DensityBasinInformationValue {111 set { DensityBasinInformationValueParameter.ActualValue = new DoubleValue(value); }112 }113 private double TotalEntropyValue {114 set { TotalEntropyValueParameter.ActualValue = new DoubleValue(value); }115 }116 private double InformationStabilityValue {117 set { InformationStabilityValueParameter.ActualValue = new DoubleValue(value); }118 }119 80 120 81 [StorableConstructor] … … 124 85 public InformationAnalyzer() { 125 86 Parameters.Add(new LookupParameter<DataTable>("Quality Trail", "The qualities of the solutions")); 126 Parameters.Add(new LookupParameter<InformationStabilityTable>("Information Stability", "Information stability development over time")); 127 Parameters.Add(new LookupParameter<InformationAnalysisTable>("Information", "A data table that information theoretic fitness landscape characteristics")); 128 Parameters.Add(new LookupParameter<VariableCollection>("Results", "The collection of all results of this algorithm")); 87 Parameters.Add(new LookupParameter<ResultCollection>("Results", "The collection of all results of this algorithm")); 129 88 130 89 Parameters.Add(new ValueLookupParameter<IntValue>("NQuantiles", "The number of delta quantiles to display", new IntValue(20))); 131 90 Parameters.Add(new ValueLookupParameter<IntValue>("ShapeSize", "The number of slopes to consider as shapes.", new IntValue(2))); 132 91 133 Parameters.Add(new LookupParameter<DoubleValue>("InformationContent Value", "The information content H(0) at eps = 0"));134 Parameters.Add(new LookupParameter<DoubleValue>("PartialInformationContent Value", "Partial information content M(0) at eps = 0"));135 Parameters.Add(new LookupParameter<DoubleValue>("DensityBasinInformation Value", "Density Basin Information h(0) at eps = 0"));136 Parameters.Add(new LookupParameter<DoubleValue>("TotalEntropy Value", "The overall disorder in the trajectory"));137 Parameters.Add(new LookupParameter<DoubleValue>("InformationStability Value", "Information Stability Value"));138 Parameters.Add(new LookupParameter< IntValue>("RegularityValue", "The number of different quality differences"));139 Parameters.Add(new LookupParameter< IntValue>("DiversityValue", "The number of different quality values"));92 Parameters.Add(new LookupParameter<DoubleValue>("InformationContent", "The information content H(0) at eps = 0")); 93 Parameters.Add(new LookupParameter<DoubleValue>("PartialInformationContent", "Partial information content M(0) at eps = 0")); 94 Parameters.Add(new LookupParameter<DoubleValue>("DensityBasinInformation", "Density Basin Information h(0) at eps = 0")); 95 Parameters.Add(new LookupParameter<DoubleValue>("TotalEntropy", "The overall disorder in the trajectory")); 96 Parameters.Add(new LookupParameter<DoubleValue>("InformationStability", "Information Stability Value")); 97 Parameters.Add(new LookupParameter<DoubleValue>("Regularity", "The number of different quality differences")); 98 Parameters.Add(new LookupParameter<DoubleValue>("Diversity", "The number of different quality values")); 140 99 Parameters.Add(new LookupParameter<DoubleValue>("PeakInformationContent", "Maximum information content at any quality delta.")); 141 Parameters.Add(new LookupParameter<DoubleValue>("PeakInformationContentQualityDelta", "Quality delta with maximum information content."));142 100 Parameters.Add(new LookupParameter<DoubleValue>("PeakDensityBasinInformation", "Maximum density basin information at any quality delta.")); 143 Parameters.Add(new LookupParameter<DoubleValue>("PeakDensityBasinInformationQualityDelta", "Quality delta with maximum density basin information."));144 145 var resultsCollector = new ResultsCollector();146 resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>(InformationParameter.Name));147 resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>(InformationStabilityParameter.Name));148 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(InformationContentValueParameter.Name));149 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(PartialInformationContentValueParameter.Name));150 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(DensityBasinInformationValueParameter.Name));151 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(TotalEntropyValueParameter.Name));152 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(InformationStabilityValueParameter.Name));153 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>(RegularityValueParameter.Name));154 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>(DiversityValueParameter.Name));155 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(PeakInformationContentParameter.Name));156 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(PeakInformationContentQualityDeltaParameter.Name));157 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(PeakDensityBasinInformationParameter.Name));158 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(PeakDensityBasinInformationQualityDeltaParameter.Name));159 160 OperatorGraph.InitialOperator = resultsCollector;161 resultsCollector.Successor = null;162 101 } 163 102 … … 167 106 168 107 public override IOperation Apply() { 169 DataTable qualityTrail = QualityTrailParameter.ActualValue; 170 if (qualityTrail != null && qualityTrail.Rows.Count > 0) { 171 EnsureExistsInformationStabilityTable(); 172 EnsureExistsInformationTable(); 173 AnalyseInformation(); 174 } 108 var qualityTrail = QualityTrailParameter.ActualValue; 109 if (qualityTrail == null || qualityTrail.Rows.Count == 0) return base.Apply(); 110 111 var qualities = QualityTrailParameter.ActualValue.Rows.First().Values.ToList(); 112 if (qualities.Count <= 2) return base.Apply(); 113 114 var nQuantiles = NQuantilesParameter.ActualValue.Value; 115 var shapeSize = ShapeSizeParameter.ActualValue.Value; 116 var results = ResultsParameter.ActualValue; 117 118 var analysis = new InformationAnalysis(qualities, nQuantiles, shapeSize); 119 var ic = new DoubleValue(analysis.InformationContent.FirstOrDefault()); 120 InformationContentParameter.ActualValue = ic; 121 AddOrUpdateResult(results, InformationContentParameter.Name, ic); 122 var pic = new DoubleValue(analysis.PartialInformationContent.FirstOrDefault()); 123 PartialInformationContentParameter.ActualValue = pic; 124 AddOrUpdateResult(results, PartialInformationContentParameter.Name, pic); 125 var dbi = new DoubleValue(analysis.DensityBasinInformation.FirstOrDefault()); 126 DensityBasinInformationParameter.ActualValue = dbi; 127 AddOrUpdateResult(results, DensityBasinInformationParameter.Name, dbi); 128 var @is = new DoubleValue(analysis.InformationStability); 129 InformationStabilityParameter.ActualValue = @is; 130 AddOrUpdateResult(results, InformationStabilityParameter.Name, @is); 131 var regularity = new DoubleValue(1.0 * analysis.Regularity / qualities.Count); 132 RegularityParameter.ActualValue = regularity; 133 AddOrUpdateResult(results, RegularityParameter.Name, regularity); 134 var diversity = new DoubleValue(1.0 * analysis.Diversity / qualities.Count); 135 DiversityParameter.ActualValue = diversity; 136 AddOrUpdateResult(results, DiversityParameter.Name, diversity); 137 var totalEntropy = new DoubleValue(analysis.TotalEntropy.FirstOrDefault()); 138 TotalEntropyParameter.ActualValue = totalEntropy; 139 AddOrUpdateResult(results, TotalEntropyParameter.Name, totalEntropy); 140 var peakIc = new DoubleValue(analysis.PeakInformationContent.Value); 141 PeakInformationContentParameter.ActualValue = peakIc; 142 AddOrUpdateResult(results, PeakInformationContentParameter.Name, peakIc); 143 var peakDbi = new DoubleValue(analysis.PeakDensityBasinInformation.Value); 144 PeakDensityBasinInformationParameter.ActualValue = peakDbi; 145 AddOrUpdateResult(results, PeakDensityBasinInformationParameter.Name, peakDbi); 146 175 147 return base.Apply(); 176 148 } 177 149 178 private void AnalyseInformation() { 179 int nQuantiles = NQuantilesParameter.ActualValue.Value; 180 int shapeSize = ShapeSizeParameter.ActualValue.Value; 181 var qualities = QualityTrailParameter.ActualValue.Rows.First().Values.ToList(); 182 if (qualities.Count > 2) { 183 InformationAnalysisTable informationTable = InformationParameter.ActualValue; 184 var informationContent = informationTable.Rows["Information Content"].Values; 185 var partialInformationContent = informationTable.Rows["Partial Information Content"].Values; 186 var densityBasinInformation = informationTable.Rows["Density Basin Information"].Values; 187 var totalEntropy = informationTable.Rows["Total Entropy"].Values; 188 var qualityDelta = informationTable.Rows["Quality Delta"].Values; 189 var analysis = new InformationAnalysis(qualities, nQuantiles, shapeSize); 190 InformationStability.Rows["Regularity"].Values.Add(analysis.Regularity); 191 InformationStability.Rows["Diversity"].Values.Add(analysis.Diversity); 192 InformationStability.Rows["Relative Regularity"].Values.Add(1.0*analysis.Regularity/qualities.Count); 193 InformationStability.Rows["Relative Diversity"].Values.Add(1.0*analysis.Diversity/qualities.Count); 194 InformationStability.Rows["Information Stability"].Values.Add(analysis.InformationStability); 195 informationContent.Clear(); 196 informationContent.AddRange(analysis.InformationContent); 197 partialInformationContent.Clear(); 198 partialInformationContent.AddRange(analysis.PartialInformationContent); 199 densityBasinInformation.Clear(); 200 densityBasinInformation.AddRange(analysis.DensityBasinInformation); 201 totalEntropy.Clear(); 202 totalEntropy.AddRange(analysis.TotalEntropy); 203 qualityDelta.Clear(); 204 qualityDelta.AddRange(analysis.QualityDelta); 205 InformationContentValue = analysis.InformationContent.FirstOrDefault(); 206 PartialInformationContentValue = analysis.PartialInformationContent.FirstOrDefault(); 207 DensityBasinInformationValue = analysis.DensityBasinInformation.FirstOrDefault(); 208 InformationStabilityValue = analysis.InformationStability; 209 RegularityValueParameter.ActualValue = new IntValue(analysis.Regularity); 210 DiversityValueParameter.ActualValue = new IntValue(analysis.Diversity); 211 if (analysis.PeakInformationContent != null) { 212 PeakInformationContentParameter.ActualValue = new DoubleValue(analysis.PeakInformationContent.Value); 213 PeakInformationContentQualityDeltaParameter.ActualValue = new DoubleValue(analysis.PeakInformationContent.QualityDelta); 214 } 215 if (analysis.PeakDensityBasinInformation != null) { 216 PeakDensityBasinInformationParameter.ActualValue = new DoubleValue(analysis.PeakDensityBasinInformation.Value); 217 PeakDensityBasinInformationQualityDeltaParameter.ActualValue = new DoubleValue(analysis.PeakDensityBasinInformation.QualityDelta); 218 } 219 } 220 } 221 222 private void EnsureExistsInformationTable() { 223 InformationAnalysisTable information = InformationParameter.ActualValue; 224 if (information == null) { 225 information = new InformationAnalysisTable("Information"); 226 information.Rows.Add(new DataRow("Information Content")); 227 information.Rows.Add(new DataRow("Partial Information Content")); 228 information.Rows.Add(new DataRow("Density Basin Information")); 229 information.Rows.Add(new DataRow("Total Entropy")); 230 information.Rows.Add(new DataRow("Quality Delta") {VisualProperties = {SecondYAxis = true}}); 231 InformationParameter.ActualValue = information; 232 } 233 } 234 235 private void EnsureExistsInformationStabilityTable() { 236 InformationStabilityTable informationStability = InformationStabilityParameter.ActualValue; 237 if (informationStability == null) { 238 informationStability = new InformationStabilityTable("Information Stability"); 239 informationStability.Rows.Add(new DataRow("Information Stability")); 240 informationStability.Rows.Add(new DataRow("Relative Regularity")); 241 informationStability.Rows.Add(new DataRow("Relative Diversity")); 242 informationStability.Rows.Add(new DataRow("Regularity") {VisualProperties = {SecondYAxis = true}}); 243 informationStability.Rows.Add(new DataRow("Diversity") {VisualProperties = {SecondYAxis = true}}); 244 InformationStabilityParameter.ActualValue = informationStability; 245 } 150 private static void AddOrUpdateResult(ResultCollection results, string name, IItem item, bool clone = false) { 151 IResult r; 152 if (!results.TryGetValue(name, out r)) { 153 results.Add(new Result(name, clone ? (IItem)item.Clone() : item)); 154 } else r.Value = clone ? (IItem)item.Clone() : item; 246 155 } 247 156 } -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Analysis/QualityTrailMultiAnalyzer.cs
r10299 r13583 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System.Linq;23 using HeuristicLab.Collections;24 22 using HeuristicLab.Common; 25 23 using HeuristicLab.Core; … … 27 25 using HeuristicLab.Operators; 28 26 using HeuristicLab.Optimization; 29 using HeuristicLab.Optimization.Operators;30 27 using HeuristicLab.Parameters; 31 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 29 using HeuristicLab.PluginInfrastructure; 30 using System.Linq; 31 33 32 namespace HeuristicLab.Analysis.FitnessLandscape { 34 35 33 [Item("QualityTrailAnalyzer", "An analyzer that creates a quality trail which can be further analyzed by several analyzers.")] 36 34 [StorableClass] … … 44 42 } 45 43 46 public ValueLookupParameter<IntValue> UpdateIntervalParameter {47 get { return ( ValueLookupParameter<IntValue>)Parameters["QualityTrailUpdateInterval"]; }44 public IValueLookupParameter<IntValue> UpdateIntervalParameter { 45 get { return (IValueLookupParameter<IntValue>)Parameters["QualityTrailUpdateInterval"]; } 48 46 } 49 public LookupParameter<IntValue> UpdateCounterParameter {50 get { return ( LookupParameter<IntValue>)Parameters["QualityTrailUpdateCounter"]; }47 public ILookupParameter<IntValue> UpdateCounterParameter { 48 get { return (ILookupParameter<IntValue>)Parameters["QualityTrailUpdateCounter"]; } 51 49 } 52 public ValueLookupParameter<DataTable> QualityTrailParameter {53 get { return ( ValueLookupParameter<DataTable>)Parameters["Quality Trail"]; }50 public ILookupParameter<DataTable> QualityTrailParameter { 51 get { return (ILookupParameter<DataTable>)Parameters["Quality Trail"]; } 54 52 } 55 public LookupParameter<VariableCollection> ResultsParameter {56 get { return ( LookupParameter<VariableCollection>)Parameters["Results"]; }53 public ILookupParameter<ResultCollection> ResultsParameter { 54 get { return (ILookupParameter<ResultCollection>)Parameters["Results"]; } 57 55 } 58 public LookupParameter<DoubleValue> QualityParameter {59 get { return ( LookupParameter<DoubleValue>)Parameters["Quality"]; }56 public IScopeTreeLookupParameter<DoubleValue> QualityParameter { 57 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; } 60 58 } 61 public ScopeTreeLookupParameter<DoubleValue> QualitiesParameter { 62 get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Qualities"]; } 63 } 64 public OperatorParameter ResultsCollector { 65 get { return (OperatorParameter)Parameters["ResultsCollector"]; } 66 } 67 public LookupParameter<BoolValue> MaximizationParameter { 68 get { return (LookupParameter<BoolValue>)Parameters["Maximization"]; } 59 public ILookupParameter<BoolValue> MaximizationParameter { 60 get { return (ILookupParameter<BoolValue>)Parameters["Maximization"]; } 69 61 } 70 62 … … 77 69 protected QualityTrailMultiAnalyzer(bool deserializing) : base(deserializing) { } 78 70 protected QualityTrailMultiAnalyzer(QualityTrailMultiAnalyzer original, Cloner cloner) : base(original, cloner) { } 79 80 71 public QualityTrailMultiAnalyzer() 81 72 : base() { 82 73 Parameters.Add(new ValueLookupParameter<IntValue>("QualityTrailUpdateInterval", "The interval at which the contained analyzers should be applied.", new IntValue(1))); 83 74 Parameters.Add(new LookupParameter<IntValue>("QualityTrailUpdateCounter", "The number of times the Analyzer was called since the last update.")); 84 Parameters.Add(new ValueLookupParameter<DataTable>("Quality Trail", "All historical quality values throughout the algorithm run")); 85 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "Single quality value from the current iteration/generation")); 86 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Qualities", "Quality values of the whole population", "Quality", 1)); 87 Parameters.Add(new LookupParameter<VariableCollection>("Results", "The collected results")); 88 Parameters.Add(new OperatorParameter("ResultsCollector")); 75 Parameters.Add(new LookupParameter<DataTable>("Quality Trail", "All historical quality values throughout the algorithm run")); 76 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "Quality values of the whole population", 1)); 77 Parameters.Add(new LookupParameter<ResultCollection>("Results", "The collected results")); 89 78 Parameters.Add(new LookupParameter<BoolValue>("Maximization", "Whether the problem is a maximization problem")); 90 79 91 foreach (var analyzer in ApplicationManager.Manager.GetInstances<IQualityTrailAnalyzer>()) 92 Operators.Add(analyzer); 93 94 var resultsCollector = new ResultsCollector(); 95 resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>(QualityTrailParameter.Name)); 96 ResultsCollector.Value = resultsCollector; 80 foreach (var analyzer in ApplicationManager.Manager.GetInstances<IQualityTrailAnalyzer>()) { 81 Operators.Add(analyzer, !(analyzer is FitnessCloudAnalyzer)); 82 } 97 83 } 98 84 … … 102 88 103 89 public override IOperation InstrumentedApply() { 104 UpdateQualityTrail(); 105 106 IntValue interval = UpdateIntervalParameter.ActualValue; 107 if (interval == null) interval = new IntValue(1); 108 109 IntValue counter = UpdateCounterParameter.ActualValue; 110 if (counter == null) { 111 counter = new IntValue(interval.Value); 112 UpdateCounterParameter.ActualValue = counter; 113 } else counter.Value++; 114 115 OperationCollection next = new OperationCollection(); 116 next.Add(ExecutionContext.CreateOperation(ResultsCollector.Value)); 117 if (counter.Value == interval.Value) { 118 counter.Value = 0; 119 foreach (IndexedItem<IQualityTrailAnalyzer> item in Operators.CheckedItems) 120 next.Add(ExecutionContext.CreateOperation(item.Value)); 121 122 } 123 next.Add(base.InstrumentedApply()); 124 return next; 125 } 126 127 private void UpdateQualityTrail() { 128 DataTable qualityTrail = QualityTrailParameter.ActualValue; 90 var maximization = MaximizationParameter.ActualValue.Value; 91 var qualityTrail = QualityTrailParameter.ActualValue; 129 92 if (qualityTrail == null) { 130 93 qualityTrail = new DataTable("Quality Trail"); … … 132 95 QualityTrailParameter.ActualValue = qualityTrail; 133 96 } 134 if (QualityParameter.ActualValue != null) 135 qualityTrail.Rows["Qualities"].Values.Add(QualityParameter.ActualValue.Value); 136 if (QualitiesParameter.ActualName != null && 137 QualitiesParameter.ActualValue.Count() > 0 && 138 MaximizationParameter != null) 139 if (MaximizationParameter.ActualValue.Value) 140 qualityTrail.Rows["Qualities"].Values.Add(QualitiesParameter.ActualValue.Select(dv => dv.Value).Max()); 141 else 142 qualityTrail.Rows["Qualities"].Values.Add(QualitiesParameter.ActualValue.Select(dv => dv.Value).Min()); 97 var qualities = QualityParameter.ActualValue.Select(x => x.Value); 98 qualityTrail.Rows["Qualities"].Values.Add(maximization ? qualities.Max() : qualities.Min()); 143 99 100 var interval = UpdateIntervalParameter.ActualValue.Value; 101 var counter = UpdateCounterParameter.ActualValue; 102 if (counter == null) { 103 counter = new IntValue(0); 104 UpdateCounterParameter.ActualValue = counter; 105 } 106 counter.Value++; 107 108 var next = new OperationCollection(); 109 if (counter.Value % interval == 0) { 110 counter.Value = 0; 111 foreach (var item in Operators.CheckedItems) next.Add(ExecutionContext.CreateOperation(item.Value)); 112 } 113 next.Add(base.InstrumentedApply()); 114 return next; 144 115 } 145 116 } -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Analysis/RuggednessAnalyzer.cs
r7176 r13583 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System.Linq;23 using HeuristicLab.Analysis.FitnessLandscape.DataTables;24 22 using HeuristicLab.Common; 25 23 using HeuristicLab.Core; 26 24 using HeuristicLab.Data; 27 25 using HeuristicLab.Operators; 28 using HeuristicLab.Optimization .Operators;26 using HeuristicLab.Optimization; 29 27 using HeuristicLab.Parameters; 30 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using System.Linq; 31 30 32 namespace HeuristicLab.Analysis.FitnessLandscape .Analysis{33 31 namespace HeuristicLab.Analysis.FitnessLandscape { 32 [Item("Ruggedness Analyzer", "Analyzes autocorrelation for one mutation step and correlation length.")] 34 33 [StorableClass] 35 public class RuggednessAnalyzer : AlgorithmOperator, IQualityTrailAnalyzer {34 public class RuggednessAnalyzer : SingleSuccessorOperator, IQualityTrailAnalyzer { 36 35 public bool EnabledByDefault { 37 36 get { return false; } … … 42 41 get { return (LookupParameter<DataTable>)Parameters["Quality Trail"]; } 43 42 } 44 public LookupParameter<DataTable> CorrelationLengthTableParameter { 45 get { return (LookupParameter<DataTable>)Parameters["CorrelationLengthTable"]; } 46 } 47 public LookupParameter<AutoCorrelationTable> AutocorrelationParameter { 48 get { return (LookupParameter<AutoCorrelationTable>)Parameters["Autocorrelation"]; } 49 } 50 public LookupParameter<VariableCollection> ResultsParameter { 51 get { return (LookupParameter<VariableCollection>)Parameters["Results"]; } 43 public LookupParameter<ResultCollection> ResultsParameter { 44 get { return (LookupParameter<ResultCollection>)Parameters["Results"]; } 52 45 } 53 46 public LookupParameter<DoubleValue> AutoCorrelation1Parameter { … … 62 55 protected RuggednessAnalyzer(bool deserializing) : base(deserializing) { } 63 56 protected RuggednessAnalyzer(RuggednessAnalyzer original, Cloner cloner) : base(original, cloner) { } 64 65 57 public RuggednessAnalyzer() { 66 58 Parameters.Add(new LookupParameter<DataTable>("Quality Trail", "The quality of the solution")); 67 Parameters.Add(new LookupParameter<DataTable>("CorrelationLengthTable", "Maximum nr of steps between statistically significantly correlated quality values")); 68 Parameters.Add(new LookupParameter<AutoCorrelationTable>("Autocorrelation", "Autocorrelation function of successive quality values")); 69 Parameters.Add(new LookupParameter<VariableCollection>("Results", "The collection of all results of this algorithm")); 59 Parameters.Add(new LookupParameter<ResultCollection>("Results", "The collection of all results of this algorithm")); 70 60 Parameters.Add(new LookupParameter<DoubleValue>("AutoCorrelation1", "Autocorrelation for one mutation step.")); 71 61 Parameters.Add(new LookupParameter<IntValue>("CorrelationLength", "The correlation length.")); 72 73 var resultsCollector = new ResultsCollector();74 resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>(CorrelationLengthTableParameter.Name));75 resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>(AutocorrelationParameter.Name));76 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(AutoCorrelation1Parameter.Name));77 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>(CorrelationLengthParameter.Name));78 79 OperatorGraph.InitialOperator = resultsCollector;80 resultsCollector.Successor = null;81 62 } 82 63 … … 86 67 87 68 public override IOperation Apply() { 88 DataTable correlationLengthTable = GetOrCreateCorrelationLengthTable(); 89 AutoCorrelationTable autocorrelationTable = GetOrCreateAutoCorrelationTable(); 90 DataTable qualityTrail = QualityTrailParameter.ActualValue; 91 if (qualityTrail != null && qualityTrail.Rows.Count > 0) { 92 double[] autocorrelationValues; 93 int correlationLength = RuggednessCalculator.CalculateCorrelationLength(qualityTrail.Rows.First().Values.ToArray(), out autocorrelationValues); 94 correlationLengthTable.Rows["Correlation Length"].Values.Add(correlationLength); 95 autocorrelationTable.Rows["Auto Correlation"].Values.Clear(); 96 autocorrelationTable.Rows["Auto Correlation"].Values.AddRange(autocorrelationValues); 97 CorrelationLengthParameter.ActualValue = new IntValue(correlationLength); 98 AutoCorrelation1Parameter.ActualValue = new DoubleValue(autocorrelationValues.Length > 1 ? autocorrelationValues[1] : 0.0); 99 } 69 var qualityTrail = QualityTrailParameter.ActualValue; 70 if (qualityTrail == null || qualityTrail.Rows.Count <= 0) return base.Apply(); 71 var results = ResultsParameter.ActualValue; 72 double[] autocorrelationValues; 73 var correlationLength = RuggednessCalculator.CalculateCorrelationLength(qualityTrail.Rows.First().Values.ToArray(), out autocorrelationValues); 74 var cl = new IntValue(correlationLength); 75 CorrelationLengthParameter.ActualValue = cl; 76 AddOrUpdateResult(results, CorrelationLengthParameter.Name, cl); 77 var ac1 = new DoubleValue(autocorrelationValues.Length > 1 ? autocorrelationValues[1] : 0.0); 78 AutoCorrelation1Parameter.ActualValue = ac1; 79 AddOrUpdateResult(results, AutoCorrelation1Parameter.Name, ac1); 100 80 return base.Apply(); 101 81 } 102 82 103 private AutoCorrelationTable GetOrCreateAutoCorrelationTable() { 104 AutoCorrelationTable autocorrelationTable = AutocorrelationParameter.ActualValue; 105 if (autocorrelationTable == null) { 106 autocorrelationTable = new AutoCorrelationTable("Auto Correlation"); 107 AutocorrelationParameter.ActualValue = autocorrelationTable; 108 var row = new DataRow("Auto Correlation"); 109 row.VisualProperties.StartIndexZero = true; 110 autocorrelationTable.Rows.Add(row); 111 } 112 return autocorrelationTable; 113 } 114 115 private DataTable GetOrCreateCorrelationLengthTable() { 116 DataTable correlationLengthTable = CorrelationLengthTableParameter.ActualValue; 117 if (correlationLengthTable == null) { 118 correlationLengthTable = new DataTable("Correlation Length"); 119 CorrelationLengthTableParameter.ActualValue = correlationLengthTable; 120 correlationLengthTable.Rows.Add(new DataRow("Correlation Length")); 121 } 122 return correlationLengthTable; 83 private static void AddOrUpdateResult(ResultCollection results, string name, IItem item, bool clone = false) { 84 IResult r; 85 if (!results.TryGetValue(name, out r)) { 86 results.Add(new Result(name, clone ? (IItem)item.Clone() : item)); 87 } else r.Value = clone ? (IItem)item.Clone() : item; 123 88 } 124 89 } -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Analysis/RuggednessCalculator.cs
r13484 r13583 1 using System; 2 using System.Linq; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 3 22 using HeuristicLab.Common; 4 23 using HeuristicLab.Core; … … 7 26 using HeuristicLab.Parameters; 8 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using System; 9 29 using System.Collections.Generic; 30 using System.Linq; 10 31 11 namespace HeuristicLab.Analysis.FitnessLandscape .Analysis{32 namespace HeuristicLab.Analysis.FitnessLandscape { 12 33 [Item("Ruggedness Calculator", "Calculates ruggedness descriptors froma given quality trail.")] 13 34 [StorableClass] … … 25 46 } 26 47 #endregion 27 28 48 29 49 #region Constructors & Cloning … … 58 78 alglib.basestat.samplemoments(qualities, qualities.Length, ref mean, ref variance, ref skewness, ref kurtosis); 59 79 List<double> autocorrelation = new List<double>() { 1.0 }; 60 double bound = Math.Min(2 / Math.Sqrt(qualities.Length), 1.0); 61 int correlationLength = 1; 62 for (; correlationLength < qualities.Length; correlationLength++) { 63 double value = correlations[correlationLength]/qualities.Length - mean * mean; 80 int correlationLength = -1, counter = 1; 81 for (; counter < qualities.Length / 2; counter++) { 82 double value = correlations[counter] / qualities.Length - mean * mean; 64 83 if (variance > 0) 65 value = Math.Max(Math.Min(value /variance, 1.0), -1.0);84 value = Math.Max(Math.Min(value / variance, 1.0), -1.0); 66 85 else 67 86 value = 1; 68 87 autocorrelation.Add(value); 69 if ( Math.Abs(value) < bound) break;88 if (value < 0 && correlationLength < 0) correlationLength = counter; 70 89 } 71 90 acf = autocorrelation.ToArray(); 72 return correlationLength -1;91 return correlationLength - 1; 73 92 } 74 93 -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Analysis/UniqueThresholdCalculator.cs
r7128 r13583 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 23 using System.Collections.Generic; 24 using System.Diagnostics; 2 25 using System.Linq; 3 using System.Collections.Generic;4 using System.Text;5 using System.Diagnostics;6 26 7 namespace HeuristicLab.Analysis {27 namespace HeuristicLab.Analysis.FitnessLandscape { 8 28 9 29 public static class UniqueThresholdCalculator { … … 61 81 } else { 62 82 double min = thresholds[0]; 63 double max = thresholds[thresholds.Count -1];83 double max = thresholds[thresholds.Count - 1]; 64 84 if (min == max) { 65 85 yield return min; 66 86 } else { 67 87 yield return min; 68 foreach (var t in DetermineInnerThresholds(thresholds, n -2))88 foreach (var t in DetermineInnerThresholds(thresholds, n - 2)) 69 89 yield return t; 70 90 yield return max; -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Analysis/UpDownWalkAnalyzer.cs
r7176 r13583 20 20 #endregion 21 21 22 using System.Collections.Generic;23 using System.Drawing;24 using System.Linq;25 using HeuristicLab.Collections;26 22 using HeuristicLab.Common; 27 23 using HeuristicLab.Core; 28 24 using HeuristicLab.Data; 29 25 using HeuristicLab.Operators; 30 using HeuristicLab.Optimization .Operators;26 using HeuristicLab.Optimization; 31 27 using HeuristicLab.Parameters; 32 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using System.Linq; 33 30 34 namespace HeuristicLab.Analysis.FitnessLandscape .Analysis{35 31 namespace HeuristicLab.Analysis.FitnessLandscape { 32 [Item("Up/Down Walk Analyzer", "Analyzes the quality trail produced from an up/down walk.")] 36 33 [StorableClass] 37 public class UpDownWalkAnalyzer : AlgorithmOperator, IQualityTrailAnalyzer {34 public class UpDownWalkAnalyzer : SingleSuccessorOperator, IQualityTrailAnalyzer { 38 35 public bool EnabledByDefault { 39 36 get { return false; } … … 44 41 get { return (LookupParameter<DataTable>)Parameters["Quality Trail"]; } 45 42 } 46 public LookupParameter<VariableCollection> ResultsParameter { 47 get { return (LookupParameter<VariableCollection>)Parameters["Results"]; } 48 } 49 public LookupParameter<DataTable> UpDownStepsParameter { 50 get { return (LookupParameter<DataTable>)Parameters["UpDownSteps"]; } 51 } 52 public LookupParameter<DataTable> UpDownLevelsParameter { 53 get { return (LookupParameter<DataTable>)Parameters["UpDownLevels"]; } 43 public LookupParameter<ResultCollection> ResultsParameter { 44 get { return (LookupParameter<ResultCollection>)Parameters["Results"]; } 54 45 } 55 46 public LookupParameter<DoubleValue> UpWalkLengthParameter { … … 65 56 get { return (LookupParameter<DoubleValue>)Parameters["DownWalkLenVar"]; } 66 57 } 67 public LookupParameter<DoubleValue> UpperLevelParameter {68 get { return (LookupParameter<DoubleValue>)Parameters["UpperLevel"]; }69 }70 public LookupParameter<DoubleValue> LowerLevelParameter {71 get { return (LookupParameter<DoubleValue>)Parameters["LowerLevel"]; }72 }73 58 public LookupParameter<DoubleValue> UpperVarianceParameter { 74 59 get { return (LookupParameter<DoubleValue>)Parameters["UpperVariance"]; } … … 82 67 protected UpDownWalkAnalyzer(bool deserializing) : base(deserializing) { } 83 68 protected UpDownWalkAnalyzer(UpDownWalkAnalyzer original, Cloner cloner) : base(original, cloner) { } 84 85 69 public UpDownWalkAnalyzer() { 86 70 Parameters.Add(new LookupParameter<DataTable>("Quality Trail", "The qualities of the solutions")); 87 Parameters.Add(new LookupParameter<VariableCollection>("Results", "The collection of all results of this algorithm")); 88 Parameters.Add(new LookupParameter<DataTable>("UpDownSteps", "Distribution of upward and downward steps between extremes.")); 89 Parameters.Add(new LookupParameter<DataTable>("UpDownLevels", "Distribution of upper and lower levels in up-down walks.")); 71 Parameters.Add(new LookupParameter<ResultCollection>("Results", "The collection of all results of this algorithm")); 90 72 Parameters.Add(new LookupParameter<DoubleValue>("DownWalkLength", "Average downward walk length.")); 91 73 Parameters.Add(new LookupParameter<DoubleValue>("UpWalkLength", "Average updward walk length.")); 92 74 Parameters.Add(new LookupParameter<DoubleValue>("UpWalkLenVar", "Upward walk length variance.")); 93 75 Parameters.Add(new LookupParameter<DoubleValue>("DownWalkLenVar", "Downward walk length variance.")); 94 Parameters.Add(new LookupParameter<DoubleValue>("UpperLevel", "Average maximum fitness value."));95 Parameters.Add(new LookupParameter<DoubleValue>("LowerLevel", "Average minimum fitness value."));96 76 Parameters.Add(new LookupParameter<DoubleValue>("LowerVariance", "Lower level variance.")); 97 77 Parameters.Add(new LookupParameter<DoubleValue>("UpperVariance", "Upper level variance.")); 98 99 100 var resultsCollector = new ResultsCollector();101 resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>(UpDownStepsParameter.Name));102 resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>(UpDownLevelsParameter.Name));103 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(DownWalkLengthParameter.Name));104 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(UpWalkLengthParameter.Name));105 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(UpWalkLenVarParameter.Name));106 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(DownWalkLenVarParameter.Name));107 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(UpperLevelParameter.Name));108 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(LowerLevelParameter.Name));109 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(UpperVarianceParameter.Name));110 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(LowerVarianceParameter.Name));111 112 OperatorGraph.InitialOperator = resultsCollector;113 resultsCollector.Successor = null;114 78 } 115 79 … … 119 83 120 84 public override IOperation Apply() { 121 var stepsTable = GetOrCreateTable(UpDownStepsParameter, "Up", "Down"); 122 var levelsTable = GetOrCreateTable(UpDownLevelsParameter, "Top", "Bottom"); 123 DataTable qualityTrail = QualityTrailParameter.ActualValue; 85 var qualityTrail = QualityTrailParameter.ActualValue; 124 86 if (qualityTrail != null && qualityTrail.Rows.Count > 0) { 125 87 var qualities = qualityTrail.Rows.First().Values.ToList(); 126 88 if (qualities.Count > 2) { 89 var results = ResultsParameter.ActualValue; 127 90 var extremes = qualities 128 .Delta((a, b) => new { a, b, diff = b - a})129 .Select((p, i) => new { p.a, p.b, p.diff, i = i+1})91 .Delta((a, b) => new { a, b, diff = b - a }) 92 .Select((p, i) => new { p.a, p.b, p.diff, i = i + 1 }) 130 93 .Delta((s1, s2) => new { 131 94 s1.i, … … 143 106 var maxima = extremes.Where(x => x.top).ToList(); 144 107 var minima = extremes.Where(x => x.bottom).ToList(); 145 var tops = Enumerable.Repeat(new { length = 0, value = 0.0}, 0).ToList();108 var tops = Enumerable.Repeat(new { length = 0, value = 0.0 }, 0).ToList(); 146 109 var bottoms = tops; 147 110 if (maxima.Count > 0 && minima.Count > 0) { 148 111 if (maxima.First().i < minima.First().i) { 149 bottoms = maxima.Zip(minima, (t, b) => new { length = b.i - t.i, b.value}).ToList();150 minima.Insert(0, new { i = -1, value = 0.0, top = false, bottom = false});151 tops = maxima.Zip(minima, (t, b) => new { length = t.i - b.i, t.value}).ToList();112 bottoms = maxima.Zip(minima, (t, b) => new { length = b.i - t.i, b.value }).ToList(); 113 minima.Insert(0, new { i = -1, value = 0.0, top = false, bottom = false }); 114 tops = maxima.Zip(minima, (t, b) => new { length = t.i - b.i, t.value }).ToList(); 152 115 } else { 153 tops = maxima.Zip(minima, (t, b) => new { length = t.i - b.i, t.value}).ToList();154 maxima.Insert(0, new { i = -1, value = 0.0, top = false, bottom = false});155 bottoms = maxima.Zip(minima, (t, b) => new { length = b.i - t.i, b.value}).ToList();116 tops = maxima.Zip(minima, (t, b) => new { length = t.i - b.i, t.value }).ToList(); 117 maxima.Insert(0, new { i = -1, value = 0.0, top = false, bottom = false }); 118 bottoms = maxima.Zip(minima, (t, b) => new { length = b.i - t.i, b.value }).ToList(); 156 119 } 157 120 if (tops.Count > 0) { 158 var topLengths = tops.Select(t => (double) 121 var topLengths = tops.Select(t => (double)t.length).ToList(); 159 122 var topVals = tops.Select(t => t.value).ToList(); 160 ReplaceHistogram(stepsTable.Rows["Up"], topLengths); 161 ReplaceHistogram(levelsTable.Rows["Top"], topVals); 162 UpperLevelParameter.ActualValue = new DoubleValue(topVals.Average()); 163 UpperVarianceParameter.ActualValue = new DoubleValue(topVals.Variance()); 164 UpWalkLengthParameter.ActualValue = new DoubleValue(topLengths.Average()); 165 UpWalkLenVarParameter.ActualValue = new DoubleValue(topLengths.Variance()); 123 var uv = new DoubleValue(topVals.Variance()); 124 UpperVarianceParameter.ActualValue = uv; 125 AddOrUpdateResult(results, UpperVarianceParameter.Name, uv); 126 var ul = new DoubleValue(topLengths.Average()); 127 UpWalkLengthParameter.ActualValue = ul; 128 AddOrUpdateResult(results, UpWalkLengthParameter.Name, ul); 129 var ulv = new DoubleValue(topLengths.Variance()); 130 UpWalkLenVarParameter.ActualValue = ulv; 131 AddOrUpdateResult(results, UpWalkLenVarParameter.Name, ulv); 166 132 } 167 133 if (bottoms.Count > 0) { 168 var bottomLengths = bottoms.Select(b => (double) 134 var bottomLengths = bottoms.Select(b => (double)b.length).ToList(); 169 135 var bottomVals = bottoms.Select(b => b.value).ToList(); 170 ReplaceHistogram(stepsTable.Rows["Down"], bottomLengths); 171 ReplaceHistogram(levelsTable.Rows["Bottom"], bottomVals); 172 LowerLevelParameter.ActualValue = new DoubleValue(bottomVals.Average()); 173 LowerVarianceParameter.ActualValue = new DoubleValue(bottomVals.Variance()); 174 DownWalkLengthParameter.ActualValue = new DoubleValue(bottomLengths.Average()); 175 DownWalkLenVarParameter.ActualValue = new DoubleValue(bottomLengths.Variance()); 136 var lv = new DoubleValue(bottomVals.Variance()); 137 LowerVarianceParameter.ActualValue = lv; 138 AddOrUpdateResult(results, LowerVarianceParameter.Name, lv); 139 var dl = new DoubleValue(bottomLengths.Average()); 140 DownWalkLengthParameter.ActualValue = dl; 141 AddOrUpdateResult(results, DownWalkLengthParameter.Name, dl); 142 var dlv = new DoubleValue(bottomLengths.Variance()); 143 DownWalkLenVarParameter.ActualValue = dlv; 144 AddOrUpdateResult(results, DownWalkLenVarParameter.Name, dlv); 176 145 } 177 146 } … … 181 150 } 182 151 183 private void ReplaceHistogram(DataRow row, IEnumerable<double> values) { 184 row.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram; 185 row.VisualProperties.Bins = 25; 186 row.Values.Clear(); 187 row.Values.AddRange(values); 188 } 189 190 private DataTable GetOrCreateTable(LookupParameter<DataTable> tableParameter, params string[] rowNames) { 191 DataTable table = tableParameter.ActualValue; 192 if (table == null) { 193 table = new DataTable(tableParameter.Name, tableParameter.Description); 194 tableParameter.ActualValue = table; 195 foreach (var name in rowNames) { 196 table.Rows.Add(new DataRow(name)); 197 } 198 } 199 return table; 152 private static void AddOrUpdateResult(ResultCollection results, string name, IItem item, bool clone = false) { 153 IResult r; 154 if (!results.TryGetValue(name, out r)) { 155 results.Add(new Result(name, clone ? (IItem)item.Clone() : item)); 156 } else r.Value = clone ? (IItem)item.Clone() : item; 200 157 } 201 158 } -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/DistanceCalculators/BinaryVectorDistanceCalculator.cs
r7202 r13583 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 23 using System.Drawing; 24 using HeuristicLab.Common; 25 using HeuristicLab.Common.Resources; 5 26 using HeuristicLab.Core; 6 using HeuristicLab. Common.Resources;27 using HeuristicLab.Encodings.BinaryVectorEncoding; 7 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 8 using HeuristicLab.Common;9 using HeuristicLab.Encodings.BinaryVectorEncoding;10 using System.Drawing;11 29 12 30 namespace HeuristicLab.Analysis.FitnessLandscape.DistanceCalculators { -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/DistanceCalculators/IItemDistanceCalculator.cs
r7128 r13583 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 5 23 using HeuristicLab.Core; 6 24 -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/DistanceCalculators/PermutationDistanceCalculator.cs
r7202 r13583 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 24 using System.Drawing; 25 using HeuristicLab.Common; 26 using HeuristicLab.Common.Resources; 5 27 using HeuristicLab.Core; 6 using HeuristicLab. Common.Resources;28 using HeuristicLab.Encodings.PermutationEncoding; 7 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 8 using HeuristicLab.Common;9 using HeuristicLab.Encodings.BinaryVectorEncoding;10 using HeuristicLab.Encodings.PermutationEncoding;11 using System.Drawing;12 30 13 31 namespace HeuristicLab.Analysis.FitnessLandscape.DistanceCalculators { … … 63 81 case PermutationTypes.RelativeUndirected: return RelativeDistance(a, b); 64 82 default: throw new NotImplementedException("Unknown permutation type " + a.PermutationType); 65 } 83 } 66 84 } 67 85 68 86 private double AbsoluteDistance(Permutation a, Permutation b) { 69 87 int mismatches = 0; 70 for (int i = 0; i <a.Length; i++) {88 for (int i = 0; i < a.Length; i++) { 71 89 if (a[i] != b[i]) 72 90 mismatches++; … … 87 105 } 88 106 89 private static Point GetEdge(Permutation a, int index) { 107 private static Point GetEdge(Permutation a, int index) { 90 108 int start = a[index]; 91 int end = a[(index + 1) %a.Length];109 int end = a[(index + 1) % a.Length]; 92 110 switch (a.PermutationType) { 93 111 case PermutationTypes.RelativeDirected: return new Point(start, end); -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/DistanceCalculators/RealVectorDistanceCalculator.cs
r12575 r13583 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 23 using System.Drawing; 24 using HeuristicLab.Common; 25 using HeuristicLab.Common.Resources; 5 26 using HeuristicLab.Core; 6 using HeuristicLab.Common.Resources; 27 using HeuristicLab.Encodings.BinaryVectorEncoding; 28 using HeuristicLab.Encodings.RealVectorEncoding; 7 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 8 using HeuristicLab.Common;9 using HeuristicLab.Encodings.BinaryVectorEncoding;10 using System.Drawing;11 using HeuristicLab.Encodings.RealVectorEncoding;12 30 13 31 namespace HeuristicLab.Analysis.FitnessLandscape.DistanceCalculators { … … 15 33 [Item("RealVectorDistanceCalculator", "Calculates the Euclidian distance of two real vectors")] 16 34 [StorableClass] 17 public class RealVectorDistanceCalculator : NamedItem, IItemDistanceCalculator {35 public class RealVectorDistanceCalculator : NamedItem, IItemDistanceCalculator { 18 36 19 37 #region Properties … … 52 70 53 71 public double Distance(IItem x, IItem y) { 54 RealVector a = (RealVector 55 RealVector b = (RealVector 72 RealVector a = (RealVector)x; 73 RealVector b = (RealVector)y; 56 74 if (a.Length != b.Length) 57 75 throw new InvalidOperationException("Cannot compare vectors of different lengths"); … … 63 81 } 64 82 65 private static double Sqr(double x) { return x *x; }83 private static double Sqr(double x) { return x * x; } 66 84 67 85 #endregion -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Extensions.cs
r13484 r13583 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Core; 23 using System; 2 24 using System.Collections.Generic; 3 using System.Linq;4 using System.Text;5 25 6 26 namespace HeuristicLab.Analysis.FitnessLandscape { 7 public static class ListExtensions {27 public static class IListExtensions { 8 28 public static void DuplicateLast<T>(this IList<T> l) { 9 l.Add(l[l.Count -1]);29 l.Add(l[l.Count - 1]); 10 30 } 11 public static T Last<T>(this IList<T> l) { 12 return l[l.Count - 1]; 31 32 public static void Shuffle<T>(this IList<T> list, IRandom random) { 33 int n = list.Count - 1; 34 while (n > 0) { 35 int k = random.Next(n + 1); 36 T value = list[k]; 37 list[k] = list[n]; 38 list[n] = value; 39 n--; 40 } 41 } 42 } 43 44 public static class IDictionaryExtensions { 45 public static TValue GetValueOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> d, TKey key, Func<TValue> @default) { 46 TValue value; 47 return d.TryGetValue(key, out value) ? value : @default(); 48 } 49 50 public static TValue GetValueOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> d, TKey key, TValue @default = default(TValue)) { 51 TValue value; 52 return d.TryGetValue(key, out value) ? value : @default; 13 53 } 14 54 } -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/HeuristicLab.Analysis.FitnessLandscape-3.3.csproj
r13484 r13583 40 40 <DebugType>full</DebugType> 41 41 <Optimize>false</Optimize> 42 <OutputPath>..\..\..\ trunk\sources\bin\</OutputPath>42 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 43 43 <DefineConstants>DEBUG;TRACE</DefineConstants> 44 44 <ErrorReport>prompt</ErrorReport> … … 49 49 <DebugType>pdbonly</DebugType> 50 50 <Optimize>true</Optimize> 51 <OutputPath>..\..\..\ trunk\sources\bin\</OutputPath>51 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 52 52 <DefineConstants>TRACE</DefineConstants> 53 53 <ErrorReport>prompt</ErrorReport> … … 57 57 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> 58 58 <DebugSymbols>true</DebugSymbols> 59 <OutputPath>..\..\..\ trunk\sources\bin\</OutputPath>59 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 60 60 <DefineConstants>DEBUG;TRACE</DefineConstants> 61 61 <DebugType>full</DebugType> … … 65 65 </PropertyGroup> 66 66 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> 67 <OutputPath>..\..\..\ trunk\sources\bin\</OutputPath>67 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 68 68 <DefineConstants>TRACE</DefineConstants> 69 69 <Optimize>true</Optimize> … … 75 75 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> 76 76 <DebugSymbols>true</DebugSymbols> 77 <OutputPath>..\..\..\ trunk\sources\bin\</OutputPath>77 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 78 78 <DefineConstants>DEBUG;TRACE</DefineConstants> 79 79 <DebugType>full</DebugType> … … 83 83 </PropertyGroup> 84 84 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> 85 <OutputPath>..\..\..\ trunk\sources\bin\</OutputPath>85 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 86 86 <DefineConstants>TRACE</DefineConstants> 87 87 <Optimize>true</Optimize> … … 92 92 </PropertyGroup> 93 93 <ItemGroup> 94 <Reference Include="ALGLIB-3.7.0, Version=3.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 95 <HintPath>..\..\..\trunk\sources\bin\ALGLIB-3.7.0.dll</HintPath> 96 </Reference> 97 <Reference Include="HeuristicLab.Analysis-3.3"> 98 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath> 94 <Reference Include="ALGLIB-3.7.0"> 95 <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.7.0.dll</HintPath> 96 <Private>False</Private> 99 97 </Reference> 100 98 <Reference Include="HeuristicLab.Collections-3.3"> 101 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath> 99 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath> 100 <Private>False</Private> 102 101 </Reference> 103 102 <Reference Include="HeuristicLab.Common-3.3"> 104 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath> 103 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath> 104 <Private>False</Private> 105 105 </Reference> 106 106 <Reference Include="HeuristicLab.Common.Resources-3.3"> 107 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath> 107 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath> 108 <Private>False</Private> 108 109 </Reference> 109 110 <Reference Include="HeuristicLab.Core-3.3"> 110 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath> 111 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath> 112 <Private>False</Private> 111 113 </Reference> 112 114 <Reference Include="HeuristicLab.Data-3.3"> 113 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath> 115 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath> 116 <Private>False</Private> 114 117 </Reference> 115 118 <Reference Include="HeuristicLab.Encodings.BinaryVectorEncoding-3.3"> 116 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Encodings.BinaryVectorEncoding-3.3.dll</HintPath> 119 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.BinaryVectorEncoding-3.3.dll</HintPath> 120 <Private>False</Private> 117 121 </Reference> 118 122 <Reference Include="HeuristicLab.Encodings.IntegerVectorEncoding-3.3"> 119 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Encodings.IntegerVectorEncoding-3.3.dll</HintPath> 123 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.IntegerVectorEncoding-3.3.dll</HintPath> 124 <Private>False</Private> 120 125 </Reference> 121 126 <Reference Include="HeuristicLab.Encodings.PermutationEncoding-3.3"> 122 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Encodings.PermutationEncoding-3.3.dll</HintPath> 127 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.PermutationEncoding-3.3.dll</HintPath> 128 <Private>False</Private> 123 129 </Reference> 124 130 <Reference Include="HeuristicLab.Encodings.RealVectorEncoding-3.3"> 125 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Encodings.RealVectorEncoding-3.3.dll</HintPath> 131 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.RealVectorEncoding-3.3.dll</HintPath> 132 <Private>False</Private> 126 133 </Reference> 127 134 <Reference Include="HeuristicLab.Operators-3.3"> 128 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath> 129 </Reference> 130 <Reference Include="HeuristicLab.Optimization-3.3"> 131 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath> 135 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath> 136 <Private>False</Private> 132 137 </Reference> 133 138 <Reference Include="HeuristicLab.Optimization.Operators-3.3"> 134 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath> 139 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath> 140 <Private>False</Private> 135 141 </Reference> 136 142 <Reference Include="HeuristicLab.Parameters-3.3"> 137 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath> 143 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath> 144 <Private>False</Private> 138 145 </Reference> 139 146 <Reference Include="HeuristicLab.Persistence-3.3"> 140 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath> 147 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath> 148 <Private>False</Private> 141 149 </Reference> 142 150 <Reference Include="HeuristicLab.PluginInfrastructure-3.3"> 143 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath> 144 </Reference> 145 <Reference Include="HeuristicLab.Problems.TestFunctions-3.3"> 146 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.TestFunctions-3.3.dll</HintPath> 151 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath> 152 <Private>False</Private> 147 153 </Reference> 148 154 <Reference Include="HeuristicLab.Random-3.3"> 149 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath> 155 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath> 156 <Private>False</Private> 150 157 </Reference> 151 158 <Reference Include="HeuristicLab.Selection-3.3"> 152 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Selection-3.3.dll</HintPath> 159 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Selection-3.3.dll</HintPath> 160 <Private>False</Private> 153 161 </Reference> 154 162 <Reference Include="System" /> … … 170 178 </ItemGroup> 171 179 <ItemGroup> 172 <Compile Include="Algorithms\RepeatedUpDownWalkAnalyzer.cs" /> 173 <Compile Include="Algorithms\EvolvabilityAnalyzer.cs" /> 174 <Compile Include="Algorithms\RepeatedInformationAnalyzer.cs" /> 175 <Compile Include="Algorithms\RepeatMultiAnalyzer.cs" /> 176 <Compile Include="Algorithms\RepeatedRuggednessAnalyzer.cs" /> 177 <Compile Include="Algorithms\ScopeDuplicator.cs" /> 178 <Compile Include="Analysis\Aggregators\BoundingBoxAggregator.cs" /> 179 <Compile Include="Analysis\Aggregators\Aggregator.cs" /> 180 <Compile Include="Analysis\Aggregators\AutoCorrelationAggregator.cs" /> 181 <Compile Include="Analysis\Aggregators\UpDownAggregatorAggregator.cs" /> 182 <Compile Include="Analysis\Aggregators\EvolvabilityAggregator.cs" /> 183 <Compile Include="Analysis\Aggregators\InformationAnalysisPeakAggregator.cs" /> 184 <Compile Include="Analysis\Aggregators\InformationAnalysisValueAggregator.cs" /> 185 <Compile Include="Analysis\Aggregators\DistributionAnalyzer.cs" /> 186 <Compile Include="Analysis\Aggregators\RuggednessAggregator.cs" /> 187 <Compile Include="Analysis\Aggregators\QualityTrailSummaryAggregator.cs" /> 188 <Compile Include="Analysis\Aggregators\InformationStabilityAggregator.cs" /> 189 <Compile Include="Analysis\Aggregators\InformationAnalysisAggregator.cs" /> 190 <Compile Include="Analysis\Aggregators\IAggregator.cs" /> 191 <Compile Include="Algorithms\RepeatedLocalAnalysis.cs" /> 180 <Compile Include="Algorithms\AdaptiveWalk.cs" /> 181 <Compile Include="Algorithms\UpDownWalk.cs" /> 182 <Compile Include="Algorithms\RandomWalk.cs" /> 183 <Compile Include="Analysis\RuggednessCalculator.cs" /> 192 184 <Compile Include="Analysis\UpDownWalkAnalyzer.cs" /> 193 <Compile Include="Analysis\NeutralityAnalyzer.cs" />194 <Compile Include="Analysis\QualityTrailSummarizer.cs" />195 185 <Compile Include="Analysis\EnumerableExtensions.cs" /> 196 186 <Compile Include="Analysis\FitnessCloudAnalyzer.cs" /> 197 187 <Compile Include="Analysis\InformationAnalysis.cs" /> 198 <Compile Include="Analysis\InformationAnalysisCalculator.cs" />199 188 <Compile Include="Analysis\QualityTrailMultiAnalyzer.cs" /> 200 <Compile Include="Analysis\RealVectorBoundingBoxUpdater.cs" />201 <Compile Include="Analysis\RepeatAggregator.cs" />202 189 <Compile Include="Analysis\RuggednessAnalyzer.cs" /> 203 190 <Compile Include="Analysis\IQualityTrailAnalyzer.cs" /> … … 205 192 <Compile Include="Algorithms\LocalAnalysisMainLoop.cs" /> 206 193 <Compile Include="Analysis\InformationAnalyzer.cs" /> 207 <Compile Include="Analysis\RuggednessCalculator.cs" />208 194 <Compile Include="Analysis\UniqueThresholdCalculator.cs" /> 209 <Compile Include="BestWorstSelector.cs" /> 210 <Compile Include="BoxChart\BoxChartCreator.cs" /> 211 <Compile Include="BoxChart\ColorValue.cs" /> 212 <Compile Include="BoxChart\RunCollectionMultiDiscretizer.cs" /> 213 <Compile Include="BoxChart\ResultNamesCollector.cs" /> 214 <Compile Include="BoxChart\StringValueBoxChartElementGenerator.cs" /> 215 <Compile Include="BoxChart\IBoxChartElementGenerator.cs" /> 216 <Compile Include="BoxChart\EmptyBoxChartElementGenerator.cs" /> 217 <Compile Include="BoxChart\StringConstantBoxChartElementGenerator.cs" /> 218 <Compile Include="BoxChart\DiscreteValueBoxChartElementGenerator.cs" /> 219 <Compile Include="BoxChart\BitmapItem.cs" /> 220 <Compile Include="ColorGradient.cs" /> 221 <Compile Include="DictionaryExtensions.cs" /> 195 <Compile Include="CharacteristicCalculator\AdaptiveWalkCalculator.cs" /> 196 <Compile Include="CharacteristicCalculator\UpDownWalkCalculator.cs" /> 197 <Compile Include="CharacteristicCalculator\RandomWalkCalculator.cs" /> 198 <Compile Include="UpDownSelector.cs" /> 222 199 <Compile Include="DistanceCalculators\RealVectorDistanceCalculator.cs" /> 223 200 <Compile Include="DistanceCalculators\BinaryVectorDistanceCalculator.cs" /> 224 201 <Compile Include="DistanceCalculators\PermutationDistanceCalculator.cs" /> 225 202 <Compile Include="DistanceCalculators\IItemDistanceCalculator.cs" /> 226 <Compile Include="IListExtensions.cs" /> 227 <Compile Include="ListExtensions.cs" /> 228 <Compile Include="NeutralSelector.cs" /> 229 <Compile Include="DataTables\AutoCorrelationTable.cs" /> 230 <Compile Include="EngineAlgorithm\EngineAlgorithmOperator.cs" /> 231 <Compile Include="DataTables\QualityTrailSummaryTable.cs" /> 232 <Compile Include="DataTables\InformationStabilityTable.cs" /> 233 <Compile Include="DataTables\InformationAnalysisTable.cs" /> 234 <Compile Include="Evolvability\EvolvabilityAnalyzer.cs" /> 203 <Compile Include="Extensions.cs" /> 235 204 <Compile Include="FDC\QAPPermutationFitnessDistanceCorrelationAnalyzer.cs" /> 236 <Compile Include="ScopePathLookupParameter.cs" />237 205 <Compile Include="FDC\BinaryVectorFitnessDistanceCorrelationAnalyzer.cs" /> 238 206 <Compile Include="FDC\HeatMap.cs" /> 239 <Compile Include="HeuristicLabAnalysisFitnessLandscapePlugin.cs" /> 240 <Compile Include="MultiTrajectory\GridRealVectorsCreator.cs" /> 241 <Compile Include="MultiTrajectory\PreassignedPermutationCreator.cs" /> 242 <Compile Include="MultiTrajectory\MultiTrajectoryAnalysis.cs" /> 243 <Compile Include="MultiTrajectory\PreassignedRealVectorCreator.cs" /> 244 <Compile Include="MultiTrajectory\PreassignedBinaryVectorCreator.cs" /> 245 <Compile Include="MultiTrajectory\PreassignedSolutionCreator.cs" /> 246 <Compile Include="PopDist\PopulationDistributionAnalyzer.cs" /> 247 <Compile Include="Exhaustive\PermutationEnumerationManipulator.cs" /> 207 <Compile Include="Plugin.cs" /> 248 208 <Compile Include="FDC\PermutationFitnessDistanceCorrelationAnalyzer.cs" /> 249 <Compile Include="TestFunctions\CustomAdditiveMoveEvaluator.cs" />250 <Compile Include="TestFunctions\CustomEvaluator.cs" />251 209 <None Include="Properties\AssemblyInfo.cs.frame" /> 252 210 <Compile Include="Properties\AssemblyInfo.cs" /> 253 211 <Compile Include="FDC\RealVectorFitnessDistanceCorrelationAnalyzer.cs" /> 254 212 <Compile Include="FDC\FitnessDistanceCorrelationAnalyzer.cs" /> 255 <None Include=" HeuristicLabAnalysisFitnessLandscapePlugin.cs.frame" />213 <None Include="Plugin.cs.frame" /> 256 214 <Compile Include="FDC\ScatterPlot.cs" /> 257 215 </ItemGroup> … … 276 234 </BootstrapperPackage> 277 235 </ItemGroup> 278 <ItemGroup /> 236 <ItemGroup> 237 <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj"> 238 <Project>{887425b4-4348-49ed-a457-b7d2c26ddbf9}</Project> 239 <Name>HeuristicLab.Analysis-3.3</Name> 240 <Private>False</Private> 241 </ProjectReference> 242 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 243 <Project>{14ab8d24-25bc-400c-a846-4627aa945192}</Project> 244 <Name>HeuristicLab.Optimization-3.3</Name> 245 <Private>False</Private> 246 </ProjectReference> 247 </ItemGroup> 279 248 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 280 249 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. … … 286 255 --> 287 256 <PropertyGroup> 288 <PostBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 289 set ProjectDir=$(ProjectDir) 290 set SolutionDir=$(SolutionDir) 291 set Outdir=$(Outdir) 292 set Platform=$(PlatformName) 293 set Configuration=$(ConfigurationName)</PostBuildEvent> 257 <PostBuildEvent> 258 </PostBuildEvent> 294 259 </PropertyGroup> 295 260 <PropertyGroup> … … 299 264 set Outdir=$(Outdir) 300 265 301 SubWCRev "%25ProjectDir%25\" "%25ProjectDir%25\Properties\AssemblyInfo.cs.frame" "%25ProjectDir%25\Properties\AssemblyInfo.cs" 302 SubWCRev "%25ProjectDir%25\" "%25ProjectDir%25\HeuristicLabAnalysisFitnessLandscapePlugin.cs.frame" "%25ProjectDir%25\HeuristicLabAnalysisFitnessLandscapePlugin.cs"</PreBuildEvent>266 call PreBuildEvent.cmd 267 </PreBuildEvent> 303 268 </PropertyGroup> 304 269 </Project> -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Plugin.cs.frame
r13484 r13583 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 24 24 namespace HeuristicLab.Analysis.FitnessLandscape { 25 25 26 [Plugin("HeuristicLab.Analysis.FitnessLandscape", "3.3. 0.$WCREV$")]26 [Plugin("HeuristicLab.Analysis.FitnessLandscape", "3.3.14.$WCREV$")] 27 27 [PluginFile("HeuristicLab.Analysis.FitnessLandscape-3.3.dll", PluginFileType.Assembly)] 28 28 [PluginDependency("HeuristicLab.ALGLIB", "3.7")] -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Properties/AssemblyInfo.cs.frame
r7128 r13583 1 using System.Reflection; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System.Reflection; 2 23 using System.Runtime.CompilerServices; 3 24 using System.Runtime.InteropServices; … … 11 32 [assembly: AssemblyCompany("")] 12 33 [assembly: AssemblyProduct("HeuristicLab")] 13 [assembly: AssemblyCopyright("(c) 201 0HEAL")]34 [assembly: AssemblyCopyright("(c) 2016 HEAL")] 14 35 [assembly: AssemblyTrademark("")] 15 36 [assembly: AssemblyCulture("")] … … 33 54 // by using the '*' as shown below: 34 55 // [assembly: AssemblyVersion("1.0.*")] 35 [assembly: AssemblyVersion("3.3.0. 3000")]36 [assembly: AssemblyFileVersion("3.3. 0.$WCREV$")]56 [assembly: AssemblyVersion("3.3.0.0")] 57 [assembly: AssemblyFileVersion("3.3.14.$WCREV$")] 37 58 -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/UpDownSelector.cs
r13484 r13583 1 using System.Collections.Generic; 2 using System.Linq; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 3 22 using HeuristicLab.Common; 4 23 using HeuristicLab.Core; 5 24 using HeuristicLab.Data; 25 using HeuristicLab.Operators; 6 26 using HeuristicLab.Optimization; 7 27 using HeuristicLab.Parameters; 8 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 using HeuristicLab.Selection; 29 using System.Collections.Generic; 30 using System.Linq; 10 31 11 32 namespace HeuristicLab.Analysis.FitnessLandscape { 12 [Item(" BestOrWorstSelector", "A selection operator that moves towards the next local optimum, when found reverses direction and so on.")]33 [Item("Up/DownSelector", "A selection operator that moves towards the next local optimum, when found reverses direction and so on.")] 13 34 [StorableClass] 14 public class BestWorstSelector : SingleObjectiveSelector, ISingleObjectiveSelector {35 public class UpDownSelector : InstrumentedOperator, IStochasticOperator { 15 36 16 37 #region Parameters 17 public ScopePathLookupParameter<BoolValue> MoveTowardsOptimumParameter {18 get { return ( ScopePathLookupParameter<BoolValue>)Parameters["MoveTowardsOptimum"]; }38 public ILookupParameter<BoolValue> MaximizationParameter { 39 get { return (ILookupParameter<BoolValue>)Parameters["Maximization"]; } 19 40 } 20 public ScopePathLookupParameter<DoubleValue> BaseQualityParameter {21 get { return ( ScopePathLookupParameter<DoubleValue>)Parameters["BaseQuality"]; }41 public ILookupParameter<BoolValue> MoveTowardsOptimumParameter { 42 get { return (ILookupParameter<BoolValue>)Parameters["MoveTowardsOptimum"]; } 22 43 } 23 public LookupParameter<IRandom> RandomParameter { 24 get { return (LookupParameter<IRandom>)Parameters["Random"]; } 44 public ILookupParameter<DoubleValue> BaseQualityParameter { 45 get { return (ILookupParameter<DoubleValue>)Parameters["BaseQuality"]; } 46 } 47 public IScopeTreeLookupParameter<DoubleValue> QualityParameter { 48 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; } 49 } 50 public ILookupParameter<IRandom> RandomParameter { 51 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } 25 52 } 26 53 #endregion … … 29 56 30 57 [StorableConstructor] 31 protected BestWorstSelector(bool deserializing) : base(deserializing) { } 32 protected BestWorstSelector(BestWorstSelector original, Cloner cloner) : base(original, cloner) { } 33 public BestWorstSelector() { 34 Parameters.Add(new ScopePathLookupParameter<BoolValue>("MoveTowardsOptimum", "Specifies whether the selector should optimize towards or away from the optimum.")); 35 Parameters.Add(new ScopePathLookupParameter<DoubleValue>("BaseQuality", "The base quality value to compare to. This is required to determine wheter a local optimum has been found and the direction should be reversed.")); 58 protected UpDownSelector(bool deserializing) : base(deserializing) { } 59 protected UpDownSelector(UpDownSelector original, Cloner cloner) : base(original, cloner) { } 60 public UpDownSelector() { 61 Parameters.Add(new LookupParameter<BoolValue>("Maximization", "Whether the problem is a maximization or minimization problem.")); 62 Parameters.Add(new LookupParameter<BoolValue>("MoveTowardsOptimum", "Specifies whether the selector should optimize towards or away from the optimum.")); 63 Parameters.Add(new LookupParameter<DoubleValue>("BaseQuality", "The base quality value to compare to. This is required to determine wheter a local optimum has been found and the direction should be reversed.")); 64 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the solutions.")); 36 65 Parameters.Add(new LookupParameter<IRandom>("Random", "Random number generator")); 37 MoveTowardsOptimumParameter.Hidden = false;38 BaseQualityParameter.Hidden = false;39 MoveTowardsOptimumParameter.Path = "..";40 BaseQualityParameter.Path = "../Remaining/{0}";41 66 BaseQualityParameter.ActualName = "Quality"; 42 QualityParameter.Hidden = false;43 MaximizationParameter.Hidden = true;44 NumberOfSelectedSubScopesParameter.Value = new IntValue(1);45 NumberOfSelectedSubScopesParameter.Hidden = true;46 67 } 47 68 public override IDeepCloneable Clone(Cloner cloner) { 48 return new BestWorstSelector(this, cloner);69 return new UpDownSelector(this, cloner); 49 70 } 50 71 #endregion 51 72 52 protected override IScope[] Select(List<IScope> scopes) { 73 public override IOperation InstrumentedApply() { 74 var scopes = ExecutionContext.Scope.SubScopes.ToList(); 75 var selected = Select(scopes); 76 scopes.Remove(selected); 77 ExecutionContext.Scope.SubScopes.Clear(); 78 ExecutionContext.Scope.SubScopes.Add(new Scope("Remaining")); 79 ExecutionContext.Scope.SubScopes[0].SubScopes.AddRange(scopes); 80 ExecutionContext.Scope.SubScopes.Add(new Scope("Selected")); 81 ExecutionContext.Scope.SubScopes[1].SubScopes.Add(selected); 82 return base.InstrumentedApply(); 83 } 84 85 private IScope Select(List<IScope> scopes) { 86 var maximization = MaximizationParameter.ActualValue.Value; 53 87 bool optimize = true; 54 88 if (MoveTowardsOptimumParameter.ActualValue == null) { … … 57 91 optimize = MoveTowardsOptimumParameter.ActualValue.Value; 58 92 } 59 double baseQuality = BaseQualityParameter.ActualValue.Value;60 int count = NumberOfSelectedSubScopesParameter.ActualValue.Value;61 bool copy = CopySelectedParameter.Value.Value;62 bool maximization = MaximizationParameter.ActualValue.Value;63 ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;64 IScope[] selected = new IScope[count];65 IRandomrandom = RandomParameter.ActualValue;93 var qualities = QualityParameter.ActualValue; 94 var list = qualities.Select((x, i) => new { Index = i, Quality = x.Value }).ToList(); 95 var baseQuality = BaseQualityParameter.ActualValue.Value; 96 if (double.IsNaN(baseQuality)) { 97 baseQuality = maximization ? list.Max(x => x.Quality) : list.Min(x => x.Quality); 98 } 99 var random = RandomParameter.ActualValue; 66 100 67 var list = qualities.Select((x, i) => new { Index=i, Quality=x.Value }).ToList();68 101 if (random != null) 69 102 list.Shuffle(random); … … 77 110 MoveTowardsOptimumParameter.ActualValue = new BoolValue(!optimize); 78 111 } 79 80 if (copy) { 81 int j = 0; 82 for (int i = 0; i < count; i++) { 83 selected[i] = (IScope)scopes[list[j].Index].Clone(); 84 j++; 85 if (j >= list.Count) j = 0; 86 } 87 } else { 88 for (int i = 0; i < count; i++) { 89 selected[i] = scopes[list[0].Index]; 90 scopes[list[0].Index] = null; 91 list.RemoveAt(0); 92 } 93 scopes.RemoveAll(x => x == null); 94 } 95 96 return selected; 112 return scopes[list[0].Index]; 97 113 } 98 114 } -
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionRLDView.cs
r13475 r13583 20 20 #endregion 21 21 22 using HeuristicLab.Analysis; 23 using HeuristicLab.Collections; 24 using HeuristicLab.Core.Views; 25 using HeuristicLab.Data; 26 using HeuristicLab.MainForm; 27 using HeuristicLab.MainForm.WindowsForms; 22 28 using System; 23 29 using System.Collections.Generic; … … 27 33 using System.Linq; 28 34 using System.Windows.Forms; 29 using HeuristicLab.Analysis;30 using HeuristicLab.Collections;31 using HeuristicLab.Core.Views;32 using HeuristicLab.Data;33 using HeuristicLab.MainForm;34 using HeuristicLab.MainForm.WindowsForms;35 35 36 36 namespace HeuristicLab.Optimization.Views { … … 86 86 VisualProperties = { 87 87 YAxisTitle = "Proportion of reached targets", 88 YAxisMinimumFixedValue = 0, YAxisMinimumAuto = false, 89 YAxisMaximumFixedValue = 1, YAxisMaximumAuto = false 88 YAxisMinimumFixedValue = 0, 89 YAxisMinimumAuto = false, 90 YAxisMaximumFixedValue = 1, 91 YAxisMaximumAuto = false 90 92 } 91 93 }; … … 94 96 VisualProperties = { 95 97 YAxisTitle = "Proportion of unused budgets", 96 YAxisMinimumFixedValue = 0, YAxisMinimumAuto = false, 97 YAxisMaximumFixedValue = 1, YAxisMaximumAuto = false 98 YAxisMinimumFixedValue = 0, 99 YAxisMinimumAuto = false, 100 YAxisMaximumFixedValue = 1, 101 YAxisMaximumAuto = false 98 102 } 99 103 }; … … 223 227 var problemNamesDifferent = problems.Select(x => x.ProblemName).Where(x => !string.IsNullOrEmpty(x)).Distinct().Count() > 1; 224 228 var evaluatorDifferent = problems.Select(x => x.Evaluator).Where(x => !string.IsNullOrEmpty(x)).Distinct().Count() > 1; 225 var allEqual = !problemTypesDifferent && !problemNamesDifferent && !evaluatorDifferent; 229 var maximizationDifferent = problems.Select(x => x.Maximization).Distinct().Count() > 1; 230 var allEqual = !problemTypesDifferent && !problemNamesDifferent && !evaluatorDifferent && !maximizationDifferent; 226 231 227 232 var selectedProblemItem = (ProblemDescription)problemComboBox.SelectedItem; … … 234 239 prob.DisplayProblemName = problemNamesDifferent || allEqual; 235 240 prob.DisplayEvaluator = evaluatorDifferent; 241 prob.DisplayMaximization = maximizationDifferent; 236 242 problemComboBox.Items.Add(prob); 237 243 if (prob.Equals(selectedProblemItem)) problemComboBox.SelectedItem = prob; … … 266 272 } 267 273 268 private Dictionary<string, Dictionary< string, Tuple<double, List<IRun>>>> GroupRuns() {269 var groupedRuns = new Dictionary<string, Dictionary< string, Tuple<double, List<IRun>>>>();274 private Dictionary<string, Dictionary<ProblemDescription, Tuple<double, List<IRun>>>> GroupRuns() { 275 var groupedRuns = new Dictionary<string, Dictionary<ProblemDescription, Tuple<double, List<IRun>>>>(); 270 276 271 277 var table = (string)dataTableComboBox.SelectedItem; … … 278 284 if (selectedProblem == null) return groupedRuns; 279 285 280 var maximization = IsMaximization(); 281 282 var targetsPerProblem = CalculateBestTargetPerProblemInstance(table, maximization); 286 var targetsPerProblem = CalculateBestTargetPerProblemInstance(table); 283 287 284 288 foreach (var x in (from r in Content … … 289 293 group r by selectedGroup == AllRuns ? AllRuns : r.Parameters[selectedGroup].ToString() into g 290 294 select Tuple.Create(g.Key, g.ToList()))) { 291 var pDict = new Dictionary< string, Tuple<double, List<IRun>>>();295 var pDict = new Dictionary<ProblemDescription, Tuple<double, List<IRun>>>(); 292 296 foreach (var y in (from r in x.Item2 293 let pd = new ProblemDescription(r) .ToString()297 let pd = new ProblemDescription(r) 294 298 group r by pd into g 295 299 select Tuple.Create(g.Key, g.ToList()))) { … … 319 323 var colorCount = 0; 320 324 var lineStyleCount = 0; 321 var maximization = IsMaximization();322 325 323 326 foreach (var group in groupedRuns) { … … 331 334 332 335 if (eachOrAllTargetCheckBox.Checked) { 333 CalculateHitsForEachTarget(hits, resultsTable.Rows.First(), maximization, group.Key, group.Value.Count, problem.Value.Item1, problem.Value.Item2.Count);336 CalculateHitsForEachTarget(hits, resultsTable.Rows.First(), problem.Key, group.Key, group.Value.Count, problem.Value.Item1, problem.Value.Item2.Count); 334 337 } else { 335 maxLength = CalculateHitsForAllTargets(hits, resultsTable.Rows.First(), maximization, group.Key, group.Value.Count, problem.Value.Item1, problem.Value.Item2.Count);338 maxLength = CalculateHitsForAllTargets(hits, resultsTable.Rows.First(), problem.Key, group.Key, group.Value.Count, problem.Value.Item1, problem.Value.Item2.Count); 336 339 } 337 340 } … … 379 382 } 380 383 381 private void CalculateHitsForEachTarget(Dictionary<string, SortedList<double, double>> hits, IndexedDataRow<double> row, bool maximization, string group, int groupCount, double bestTarget, int problemCount) {382 foreach (var l in targets.Select(x => ( maximization? (1 - x) : (1 + x)) * bestTarget)) {384 private void CalculateHitsForEachTarget(Dictionary<string, SortedList<double, double>> hits, IndexedDataRow<double> row, ProblemDescription problem, string group, int groupCount, double bestTarget, int problemCount) { 385 foreach (var l in targets.Select(x => (problem.IsMaximization() ? (1 - x) : (1 + x)) * bestTarget)) { 383 386 var key = group + "-" + l; 384 387 if (!hits.ContainsKey(key)) hits.Add(key, new SortedList<double, double>()); 385 388 foreach (var v in row.Values) { 386 if ( maximization && v.Item2 >= l || !maximization&& v.Item2 <= l) {389 if (problem.IsMaximization() && v.Item2 >= l || !problem.IsMaximization() && v.Item2 <= l) { 387 390 if (hits[key].ContainsKey(v.Item1)) 388 391 hits[key][v.Item1] += 1.0 / (groupCount * problemCount); … … 394 397 } 395 398 396 private double CalculateHitsForAllTargets(Dictionary<string, SortedList<double, double>> hits, IndexedDataRow<double> row, bool maximization, string group, int groupCount, double bestTarget, int problemCount) {399 private double CalculateHitsForAllTargets(Dictionary<string, SortedList<double, double>> hits, IndexedDataRow<double> row, ProblemDescription problem, string group, int groupCount, double bestTarget, int problemCount) { 397 400 var values = row.Values; 398 401 if (!hits.ContainsKey(group)) hits.Add(group, new SortedList<double, double>()); … … 401 404 var j = 0; 402 405 while (i < targets.Length && j < values.Count) { 403 var target = ( maximization? (1 - targets[i]) : (1 + targets[i])) * bestTarget;406 var target = (problem.IsMaximization() ? (1 - targets[i]) : (1 + targets[i])) * bestTarget; 404 407 var current = values[j]; 405 if ( maximization&& current.Item2 >= target406 || ! maximization&& current.Item2 <= target) {408 if (problem.IsMaximization() && current.Item2 >= target 409 || !problem.IsMaximization() && current.Item2 <= target) { 407 410 if (!hits[group].ContainsKey(current.Item1)) hits[group][current.Item1] = 0; 408 411 hits[group][current.Item1] += 1.0 / (groupCount * problemCount * targets.Length); … … 416 419 } 417 420 418 private void UpdateErtTables(Dictionary<string, Dictionary< string, Tuple<double, List<IRun>>>> groupedRuns) {421 private void UpdateErtTables(Dictionary<string, Dictionary<ProblemDescription, Tuple<double, List<IRun>>>> groupedRuns) { 419 422 ertTableView.Content = null; 420 423 var columns = 1 + targets.Length + 1; 421 424 var matrix = new string[groupedRuns.Count * groupedRuns.Max(x => x.Value.Count) + groupedRuns.Max(x => x.Value.Count), columns]; 422 425 var rowCount = 0; 423 var maximization = IsMaximization();424 426 425 427 var tableName = (string)dataTableComboBox.SelectedItem; 426 428 if (string.IsNullOrEmpty(tableName)) return; 427 429 428 var targetsPerProblem = CalculateBestTargetPerProblemInstance(tableName , maximization);430 var targetsPerProblem = CalculateBestTargetPerProblemInstance(tableName); 429 431 430 432 var colNames = new string[columns]; … … 436 438 437 439 foreach (var problem in problems) { 438 matrix[rowCount, 0] = problem ;440 matrix[rowCount, 0] = problem.ToString(); 439 441 for (var i = 0; i < targets.Length; i++) { 440 matrix[rowCount, i + 1] = (targetsPerProblem[problem] * ( maximization? (1 - targets[i]) : (1 + targets[i]))).ToString(CultureInfo.CurrentCulture.NumberFormat);442 matrix[rowCount, i + 1] = (targetsPerProblem[problem] * (problem.IsMaximization() ? (1 - targets[i]) : (1 + targets[i]))).ToString(CultureInfo.CurrentCulture.NumberFormat); 441 443 } 442 444 matrix[rowCount, columns - 1] = "#succ"; … … 453 455 ErtCalculationResult result = default(ErtCalculationResult); 454 456 for (var i = 0; i < targets.Length; i++) { 455 result = ExpectedRuntimeHelper.CalculateErt(runs, tableName, ( maximization ? (1 - targets[i]) : (1 + targets[i])) * group.Value[problem].Item1, maximization);457 result = ExpectedRuntimeHelper.CalculateErt(runs, tableName, (problem.IsMaximization() ? (1 - targets[i]) : (1 + targets[i])) * group.Value[problem].Item1, problem.IsMaximization()); 456 458 matrix[rowCount, i + 1] = result.ToString(); 457 459 } … … 482 484 var lineStyleCount = 0; 483 485 484 var maximization = IsMaximization(); 485 var targetsPerProblem = CalculateBestTargetPerProblemInstance((string)dataTableComboBox.SelectedItem, maximization); 486 var targetsPerProblem = CalculateBestTargetPerProblemInstance((string)dataTableComboBox.SelectedItem); 486 487 487 488 foreach (var group in groupedRuns) { … … 493 494 494 495 if (eachOrAllBudgetsCheckBox.Checked) { 495 CalculateHitsForEachBudget(hits, resultsTable.Rows.First(), maximization, group.Value.Count, group.Key, problem.Value.Item2.Count, targetsPerProblem[problem.Key]);496 CalculateHitsForEachBudget(hits, resultsTable.Rows.First(), group.Value.Count, problem.Key, group.Key, problem.Value.Item2.Count, targetsPerProblem[problem.Key]); 496 497 } else { 497 CalculateHitsForAllBudgets(hits, resultsTable.Rows.First(), maximization, group.Value.Count, group.Key, problem.Value.Item2.Count, targetsPerProblem[problem.Key]);498 CalculateHitsForAllBudgets(hits, resultsTable.Rows.First(), group.Value.Count, problem.Key, group.Key, problem.Value.Item2.Count, targetsPerProblem[problem.Key]); 498 499 } 499 500 } … … 547 548 } 548 549 549 private void CalculateHitsForEachBudget(Dictionary<string, SortedList<double, double>> hits, IndexedDataRow<double> row, bool maximization, int groupCount, string groupName, int problemCount, double bestTarget) {550 private void CalculateHitsForEachBudget(Dictionary<string, SortedList<double, double>> hits, IndexedDataRow<double> row, int groupCount, ProblemDescription problem, string groupName, int problemCount, double bestTarget) { 550 551 foreach (var b in budgets) { 551 552 var key = groupName + "-" + b; … … 557 558 if (prev == null && v.Item1 != b) break; 558 559 var tgt = ((prev == null || v.Item1 == b) ? v.Item2 : prev.Item2); 559 tgt = maximization? bestTarget / tgt : tgt / bestTarget;560 tgt = problem.IsMaximization() ? bestTarget / tgt : tgt / bestTarget; 560 561 if (hits[key].ContainsKey(tgt)) 561 562 hits[key][tgt] += 1.0 / (groupCount * problemCount); … … 569 570 } 570 571 571 private void CalculateHitsForAllBudgets(Dictionary<string, SortedList<double, double>> hits, IndexedDataRow<double> row, bool maximization, int groupCount, string groupName, int problemCount, double bestTarget) {572 private void CalculateHitsForAllBudgets(Dictionary<string, SortedList<double, double>> hits, IndexedDataRow<double> row, int groupCount, ProblemDescription problem, string groupName, int problemCount, double bestTarget) { 572 573 var values = row.Values; 573 574 if (!hits.ContainsKey(groupName)) hits.Add(groupName, new SortedList<double, double>()); … … 581 582 if (prev != null || current.Item1 == budgets[i]) { 582 583 var tgt = (prev == null || current.Item1 == budgets[i]) ? current.Item2 : prev.Item2; 583 tgt = maximization? bestTarget / tgt : tgt / bestTarget;584 tgt = problem.IsMaximization() ? bestTarget / tgt : tgt / bestTarget; 584 585 if (!hits[groupName].ContainsKey(tgt)) hits[groupName][tgt] = 0; 585 586 hits[groupName][tgt] += 1.0 / (groupCount * problemCount * budgets.Length); … … 592 593 } 593 594 var lastTgt = values.Last().Item2; 594 lastTgt = maximization? bestTarget / lastTgt : lastTgt / bestTarget;595 lastTgt = problem.IsMaximization() ? bestTarget / lastTgt : lastTgt / bestTarget; 595 596 if (i < budgets.Length && !hits[groupName].ContainsKey(lastTgt)) hits[groupName][lastTgt] = 0; 596 597 while (i < budgets.Length) { … … 665 666 666 667 private void generateTargetsButton_Click(object sender, EventArgs e) { 667 var maximization = IsMaximization();668 668 decimal max = 1, min = 0, count = 10; 669 669 if (targets != null) { … … 680 680 if (dialog.ShowDialog() == DialogResult.OK) { 681 681 if (dialog.Values.Any()) { 682 targets = maximization ? dialog.Values.Select(x => (double)x).ToArray() 683 : dialog.Values.Reverse().Select(x => (double)x).ToArray(); 682 targets = dialog.Values.Select(x => (double)x).ToArray(); 684 683 suppressTargetsEvents = true; 685 684 targetsTextBox.Text = string.Join("% ; ", targets); … … 695 694 private void addTargetsAsResultButton_Click(object sender, EventArgs e) { 696 695 var table = (string)dataTableComboBox.SelectedItem; 697 var maximization = IsMaximization(); 698 699 var targetsPerProblem = CalculateBestTargetPerProblemInstance(table, maximization); 696 697 var targetsPerProblem = CalculateBestTargetPerProblemInstance(table); 700 698 701 699 foreach (var run in Content) { … … 707 705 var pd = new ProblemDescription(run); 708 706 while (i < targets.Length && j < values.Count) { 709 var target = ( maximization ? (1 - targets[i]) : (1 + targets[i])) * targetsPerProblem[pd.ToString()];707 var target = (pd.IsMaximization() ? (1 - targets[i]) : (1 + targets[i])) * targetsPerProblem[pd]; 710 708 var current = values[j]; 711 if ( maximization&& current.Item2 >= target712 || ! maximization&& current.Item2 <= target) {709 if (pd.IsMaximization() && current.Item2 >= target 710 || !pd.IsMaximization() && current.Item2 <= target) { 713 711 run.Results[table + ".Target" + target] = new DoubleValue(current.Item1); 714 712 i++; … … 828 826 829 827 #region Helpers 830 // Determines if the RunCollection contains maximization or minimization runs 831 private bool IsMaximization() { 832 if (Content == null) return false; 833 if (Content.Count > 0) { 834 foreach (var run in Content.Where(x => x.Parameters.ContainsKey("Maximization") 835 && x.Parameters["Maximization"] is BoolValue)) { 836 if (((BoolValue)run.Parameters["Maximization"]).Value) { 837 return true; 838 } else { 839 return false; 840 } 841 } 842 if (dataTableComboBox.SelectedIndex >= 0) { 843 var selectedTable = (string)dataTableComboBox.SelectedItem; 844 foreach (var run in Content.Where(x => x.Results.ContainsKey(selectedTable))) { 845 var table = run.Results[selectedTable] as IndexedDataTable<double>; 846 if (table == null) continue; 847 var firstRowValues = table.Rows.First().Values; 848 if (firstRowValues.Count < 2) continue; 849 return firstRowValues[0].Item2 < firstRowValues[firstRowValues.Count - 1].Item2; 850 } 851 } 852 } 853 // assume minimization by default 854 return false; 855 } 856 857 private Dictionary<string, double> CalculateBestTargetPerProblemInstance(string table, bool maximization) { 828 private Dictionary<ProblemDescription, double> CalculateBestTargetPerProblemInstance(string table) { 858 829 return (from r in Content 859 830 where r.Visible 860 let pd = new ProblemDescription(r) .ToString()831 let pd = new ProblemDescription(r) 861 832 let target = r.Parameters.ContainsKey("BestKnownQuality") 862 833 && r.Parameters["BestKnownQuality"] is DoubleValue … … 864 835 : ((IndexedDataTable<double>)r.Results[table]).Rows.First().Values.Last().Item2 865 836 group target by pd into g 866 select new { Problem = g.Key, Target = maximization? g.Max() : g.Min() })837 select new { Problem = g.Key, Target = g.Key.IsMaximization() ? g.Max() : g.Min() }) 867 838 .ToDictionary(x => x.Problem, x => x.Target); 868 839 } … … 892 863 ProblemName = string.Empty; 893 864 Evaluator = string.Empty; 865 Maximization = string.Empty; 894 866 DisplayProblemType = false; 895 867 DisplayProblemName = false; 896 868 DisplayEvaluator = false; 869 DisplayMaximization = false; 897 870 matchAll = true; 898 871 } … … 902 875 ProblemName = GetStringValueOrEmpty(run, "Problem Name"); 903 876 Evaluator = GetStringValueOrEmpty(run, "Evaluator"); 877 Maximization = GetMaximizationValueOrEmpty(run, "Maximization"); 904 878 DisplayProblemType = !string.IsNullOrEmpty(ProblemType); 905 879 DisplayProblemName = !string.IsNullOrEmpty(ProblemName); 906 880 DisplayEvaluator = !string.IsNullOrEmpty(Evaluator); 881 DisplayMaximization = !string.IsNullOrEmpty(Maximization); 907 882 matchAll = false; 908 883 } … … 914 889 public bool DisplayEvaluator { get; set; } 915 890 public string Evaluator { get; set; } 891 public bool DisplayMaximization { get; set; } 892 public string Maximization { get; set; } 893 894 public bool IsMaximization() { 895 return Maximization == "MAX"; 896 } 916 897 917 898 public bool Match(IRun run) { … … 919 900 GetStringValueOrEmpty(run, "Problem Type") == ProblemType 920 901 && GetStringValueOrEmpty(run, "Problem Name") == ProblemName 921 && GetStringValueOrEmpty(run, "Evaluator") == Evaluator; 902 && GetStringValueOrEmpty(run, "Evaluator") == Evaluator 903 && GetMaximizationValueOrEmpty(run, "Maximization") == Maximization; 922 904 } 923 905 924 906 private string GetStringValueOrEmpty(IRun run, string key) { 925 907 return run.Parameters.ContainsKey(key) ? ((StringValue)run.Parameters[key]).Value : string.Empty; 908 } 909 910 private string GetMaximizationValueOrEmpty(IRun run, string key) { 911 return run.Parameters.ContainsKey(key) ? (((BoolValue)run.Parameters[key]).Value ? "MAX" : "MIN") : string.Empty; 926 912 } 927 913 … … 931 917 return ProblemType == other.ProblemType 932 918 && ProblemName == other.ProblemName 933 && Evaluator == other.Evaluator; 919 && Evaluator == other.Evaluator 920 && Maximization == other.Maximization; 934 921 } 935 922 936 923 public override int GetHashCode() { 937 return ProblemType.GetHashCode() ^ ProblemName.GetHashCode() ^ Evaluator.GetHashCode() ;924 return ProblemType.GetHashCode() ^ ProblemName.GetHashCode() ^ Evaluator.GetHashCode() ^ Maximization.GetHashCode(); 938 925 } 939 926 … … 942 929 (DisplayProblemType ? ProblemType : string.Empty), 943 930 (DisplayProblemName ? ProblemName : string.Empty), 944 (DisplayEvaluator ? Evaluator : string.Empty) }.Where(x => !string.IsNullOrEmpty(x))); 931 (DisplayEvaluator ? Evaluator : string.Empty), 932 (DisplayMaximization ? Maximization : string.Empty)}.Where(x => !string.IsNullOrEmpty(x))); 945 933 } 946 934 } -
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionTableView.cs
r13475 r13583 20 20 #endregion 21 21 22 using HeuristicLab.Core; 23 using HeuristicLab.Data.Views; 24 using HeuristicLab.MainForm; 22 25 using System; 23 26 using System.Collections.Generic; … … 25 28 using System.Linq; 26 29 using System.Windows.Forms; 27 using HeuristicLab.Collections;28 using HeuristicLab.Core;29 using HeuristicLab.Data.Views;30 using HeuristicLab.MainForm;31 30 32 31 namespace HeuristicLab.Optimization.Views { … … 122 121 } 123 122 124 p rotectedoverride void UpdateColumnHeaders() {123 public override void UpdateColumnHeaders() { 125 124 string[] colNames = base.Content.ColumnNames.ToArray(); 126 125 int colCount = colNames.Length; -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3
-
Property
svn:global-ignores
set to
*.DotSettings
-
Property
svn:global-ignores
set to
-
branches/PerformanceComparison/PerformanceComparison.sln
r13485 r13583 15 15 EndProject 16 16 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.OptimizationExpertSystem.Views-3.3", "HeuristicLab.OptimizationExpertSystem.Views\3.3\HeuristicLab.OptimizationExpertSystem.Views-3.3.csproj", "{6240A044-BD4B-4DDB-9E67-A6CFA5E0C7BE}" 17 EndProject 18 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Analysis.FitnessLandscape-3.3", "HeuristicLab.Analysis.FitnessLandscape\3.3\HeuristicLab.Analysis.FitnessLandscape-3.3.csproj", "{5FBDCD4A-3C2A-4EC6-83CE-34B29F43621A}" 17 19 EndProject 18 20 Global … … 98 100 {6240A044-BD4B-4DDB-9E67-A6CFA5E0C7BE}.Release|x86.ActiveCfg = Release|x86 99 101 {6240A044-BD4B-4DDB-9E67-A6CFA5E0C7BE}.Release|x86.Build.0 = Release|x86 102 {5FBDCD4A-3C2A-4EC6-83CE-34B29F43621A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 103 {5FBDCD4A-3C2A-4EC6-83CE-34B29F43621A}.Debug|Any CPU.Build.0 = Debug|Any CPU 104 {5FBDCD4A-3C2A-4EC6-83CE-34B29F43621A}.Debug|x64.ActiveCfg = Debug|x64 105 {5FBDCD4A-3C2A-4EC6-83CE-34B29F43621A}.Debug|x64.Build.0 = Debug|x64 106 {5FBDCD4A-3C2A-4EC6-83CE-34B29F43621A}.Debug|x86.ActiveCfg = Debug|x86 107 {5FBDCD4A-3C2A-4EC6-83CE-34B29F43621A}.Debug|x86.Build.0 = Debug|x86 108 {5FBDCD4A-3C2A-4EC6-83CE-34B29F43621A}.Release|Any CPU.ActiveCfg = Release|Any CPU 109 {5FBDCD4A-3C2A-4EC6-83CE-34B29F43621A}.Release|Any CPU.Build.0 = Release|Any CPU 110 {5FBDCD4A-3C2A-4EC6-83CE-34B29F43621A}.Release|x64.ActiveCfg = Release|x64 111 {5FBDCD4A-3C2A-4EC6-83CE-34B29F43621A}.Release|x64.Build.0 = Release|x64 112 {5FBDCD4A-3C2A-4EC6-83CE-34B29F43621A}.Release|x86.ActiveCfg = Release|x86 113 {5FBDCD4A-3C2A-4EC6-83CE-34B29F43621A}.Release|x86.Build.0 = Release|x86 100 114 EndGlobalSection 101 115 GlobalSection(SolutionProperties) = preSolution
Note: See TracChangeset
for help on using the changeset viewer.