Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/13/15 15:00:15 (10 years ago)
Author:
abeham
Message:

#2174, #2282: merged revisions r11961,r11963,r11967,r11970,r11971,r11982,r11984,r11998,r12001,r12002,r12003,r12004,r11939,r11945,r11956,r11958,r11959,r11960,r11983,r11987,r11988,r11990,r11993,r11994,r11996,r11999,r12000 to stable

Location:
stable
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Problems.Programmable/3.3/HeuristicLab.Problems.Programmable-3.3.csproj

    r11961 r12005  
    111111  </ItemGroup>
    112112  <ItemGroup>
     113    <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">
     114      <Project>{887425b4-4348-49ed-a457-b7d2c26ddbf9}</Project>
     115      <Name>HeuristicLab.Analysis-3.3</Name>
     116      <Private>False</Private>
     117    </ProjectReference>
    113118    <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    114119      <Project>{958b43bc-cc5c-4fa2-8628-2b3b01d890b6}</Project>
  • stable/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblem.cs

    r11961 r12005  
    2424using HeuristicLab.Common.Resources;
    2525using HeuristicLab.Core;
     26using HeuristicLab.Data;
    2627using HeuristicLab.Optimization;
    2728using HeuristicLab.Parameters;
     
    7374
    7475    private void OnProblemDefinitionChanged() {
     76      Parameters.Remove("Maximization");
     77      Parameters.Add(new ValueParameter<BoolArray>("Maximization", "Set to false if the problem should be minimized.", (BoolArray)new BoolArray(Maximization).AsReadOnly()) { Hidden = true });
     78
    7579      Encoding = ProblemDefinition.Encoding;
    7680      OnOperatorsChanged();
     
    7983
    8084    public override bool[] Maximization {
    81       get { return ProblemDefinition.Maximization; }
     85      get { return Parameters.ContainsKey("ProblemScript") ? ProblemDefinition.Maximization : new[] { false }; }
    8286    }
    8387
  • stable/HeuristicLab.Problems.Programmable/3.3/Plugin.cs.frame

    r11961 r12005  
    2525  [Plugin("HeuristicLab.Problems.Programmable", "Programmable problem for defining custom representation and evaluation function.", "3.3.9.$WCREV$")]
    2626  [PluginFile("HeuristicLab.Problems.Programmable-3.3.dll", PluginFileType.Assembly)]
     27  [PluginDependency("HeuristicLab.Analysis", "3.3")]
    2728  [PluginDependency("HeuristicLab.Collections", "3.3")]
    2829  [PluginDependency("HeuristicLab.Common", "3.3")]
    2930  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
    3031  [PluginDependency("HeuristicLab.Core", "3.3")]
     32  [PluginDependency("HeuristicLab.Data", "3.3")]
    3133  [PluginDependency("HeuristicLab.Optimization", "3.3")]
    3234  [PluginDependency("HeuristicLab.Parameters", "3.3")]
  • stable/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs

    r11961 r12005  
    2222using System.Collections.Generic;
    2323using System.Drawing;
     24using HeuristicLab.Analysis;
    2425using HeuristicLab.Common;
    2526using HeuristicLab.Common.Resources;
    2627using HeuristicLab.Core;
     28using HeuristicLab.Data;
    2729using HeuristicLab.Optimization;
    2830using HeuristicLab.Parameters;
     
    6163      : base() {
    6264      Parameters.Add(new FixedValueParameter<SingleObjectiveProblemDefinitionScript>("ProblemScript", "Defines the problem.", new SingleObjectiveProblemDefinitionScript() { Name = Name }));
     65      Operators.Add(new BestScopeSolutionAnalyzer());
    6366      RegisterEvents();
    6467    }
     
    7477
    7578    private void OnProblemDefinitionChanged() {
     79      Parameters.Remove("Maximization");
     80      Parameters.Add(new FixedValueParameter<BoolValue>("Maximization", "Set to false if the problem should be minimized.", (BoolValue)new BoolValue(Maximization).AsReadOnly()) { Hidden = true });
     81
    7682      Encoding = ProblemDefinition.Encoding;
     83      OnOperatorsChanged();
     84      OnReset();
    7785    }
    7886
    7987    public override bool Maximization {
    80       get { return ProblemDefinition.Maximization; }
     88      get { return Parameters.ContainsKey("ProblemScript") ? ProblemDefinition.Maximization : false; }
    8189    }
    8290
  • stable/HeuristicLab.Problems.Programmable/3.3/Templates/CompiledSingleObjectiveProblemDefinition.cs

    r11949 r12005  
    4444      // Write or update results given the range of vectors and resulting qualities
    4545      // Uncomment the following lines if you want to retrieve the best individual
    46       //var bestIndex = Maximization ?
    47       //         qualities.Select((v, i) => Tuple.Create(i, v)).OrderByDescending(x => x.Item2).First().Item1
    48       //       : qualities.Select((v, i) => Tuple.Create(i, v)).OrderBy(x => x.Item2).First().Item1;
    49       //var best = individuals[bestIndex];
     46
     47      //var orderedIndividuals = individuals.Zip(qualities, (i, q) => new { Individual = i, Quality = q }).OrderBy(z => z.Quality);
     48      //var best = Maximization ? orderedIndividuals.Last().Individual : orderedIndividuals.First().Individual;
     49
     50      //if (!results.ContainsKey("Best Solution")) {
     51      //  results.Add(new Result("Best Solution", typeof(RealVector)));
     52      //}
     53      //results["Best Solution"].Value = (IItem)best.RealVector("r").Clone();
    5054    }
    5155
Note: See TracChangeset for help on using the changeset viewer.