Changeset 12969 for branches/gteufl/HeuristicLab.Problems.LinearAssignment
- Timestamp:
- 09/25/15 14:39:59 (9 years ago)
- Location:
- branches/gteufl
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gteufl
- Property svn:ignore
-
old new 8 8 FxCopResults.txt 9 9 Google.ProtocolBuffers-0.9.1.dll 10 Google.ProtocolBuffers-2.4.1.473.dll 10 11 HeuristicLab 3.3.5.1.ReSharper.user 11 12 HeuristicLab 3.3.6.0.ReSharper.user 12 13 HeuristicLab.4.5.resharper.user 13 14 HeuristicLab.ExtLibs.6.0.ReSharper.user 15 HeuristicLab.Scripting.Development 14 16 HeuristicLab.resharper.user 15 17 ProtoGen.exe … … 17 19 _ReSharper.HeuristicLab 18 20 _ReSharper.HeuristicLab 3.3 21 _ReSharper.HeuristicLab 3.3 Tests 19 22 _ReSharper.HeuristicLab.ExtLibs 20 23 bin 21 24 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll 25 obj
-
- Property svn:mergeinfo changed
-
Property
svn:global-ignores
set to
*.nuget
packages
- Property svn:ignore
-
branches/gteufl/HeuristicLab.Problems.LinearAssignment/3.3/Analyzers/BestLAPSolutionAnalyzer.cs
r9456 r12969 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 33 33 [Item("BestLAPSolutionAnalyzer", "Analyzes the best solution found.")] 34 34 [StorableClass] 35 public class BestLAPSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer {35 public class BestLAPSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer, ISingleObjectiveOperator { 36 36 public bool EnabledByDefault { get { return true; } } 37 37 … … 101 101 bool max = MaximizationParameter.ActualValue.Value; 102 102 DoubleValue bestKnownQuality = BestKnownQualityParameter.ActualValue; 103 103 104 104 var sorted = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).ToArray(); 105 105 if (max) sorted = sorted.Reverse().ToArray(); -
branches/gteufl/HeuristicLab.Problems.LinearAssignment/3.3/HeuristicLab.Problems.LinearAssignment-3.3.csproj
r8600 r12969 11 11 <RootNamespace>HeuristicLab.Problems.LinearAssignment</RootNamespace> 12 12 <AssemblyName>HeuristicLab.Problems.LinearAssignment-3.3</AssemblyName> 13 <TargetFrameworkVersion>v4. 0</TargetFrameworkVersion>13 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> 14 14 <FileAlignment>512</FileAlignment> 15 <TargetFrameworkProfile /> 15 16 </PropertyGroup> 16 17 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> … … 22 23 <ErrorReport>prompt</ErrorReport> 23 24 <WarningLevel>4</WarningLevel> 25 <Prefer32Bit>false</Prefer32Bit> 24 26 </PropertyGroup> 25 27 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> … … 30 32 <ErrorReport>prompt</ErrorReport> 31 33 <WarningLevel>4</WarningLevel> 34 <Prefer32Bit>false</Prefer32Bit> 32 35 </PropertyGroup> 33 36 <PropertyGroup> … … 52 55 <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 53 56 <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> 57 <Prefer32Bit>false</Prefer32Bit> 54 58 </PropertyGroup> 55 59 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> … … 67 71 <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 68 72 <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> 73 <Prefer32Bit>false</Prefer32Bit> 69 74 </PropertyGroup> 70 75 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> … … 83 88 <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 84 89 <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> 90 <Prefer32Bit>false</Prefer32Bit> 85 91 </PropertyGroup> 86 92 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> … … 100 106 <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> 101 107 <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules> 108 <Prefer32Bit>false</Prefer32Bit> 102 109 </PropertyGroup> 103 110 <ItemGroup> … … 186 193 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 187 194 <PropertyGroup> 188 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)195 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 189 196 set ProjectDir=$(ProjectDir) 190 197 set SolutionDir=$(SolutionDir) … … 192 199 193 200 call PreBuildEvent.cmd</PreBuildEvent> 194 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">201 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> 195 202 export ProjectDir=$(ProjectDir) 196 203 export SolutionDir=$(SolutionDir) -
branches/gteufl/HeuristicLab.Problems.LinearAssignment/3.3/HungarianAlgorithm.cs
r9456 r12969 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 35 35 /// </summary> 36 36 [Item("Hungarian Algorithm", "The Hungarian algorithm can be used to solve the linear assignment problem in O(n^3). It is also known as the Kuhn–Munkres algorithm or Munkres assignment algorithm.")] 37 [Creatable( "Algorithms")]37 [Creatable(CreatableAttribute.Categories.SingleSolutionAlgorithms, Priority = 170)] 38 38 [StorableClass] 39 39 public sealed class HungarianAlgorithm : EngineAlgorithm, IStorableContent { -
branches/gteufl/HeuristicLab.Problems.LinearAssignment/3.3/Interfaces/ILAPEvaluator.cs
r9456 r12969 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/gteufl/HeuristicLab.Problems.LinearAssignment/3.3/LAPAssignment.cs
r9456 r12969 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/gteufl/HeuristicLab.Problems.LinearAssignment/3.3/LAPEvaluator.cs
r9456 r12969 2 2 #region License Information 3 3 /* HeuristicLab 4 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)4 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 5 5 * 6 6 * This file is part of HeuristicLab. … … 32 32 [Item("LAPEvaluator", "Evaluates a solution to the linear assignment problem.")] 33 33 [StorableClass] 34 public class LAPEvaluator : SingleSuccessorOperator, ILAPEvaluator {34 public class LAPEvaluator : InstrumentedOperator, ILAPEvaluator { 35 35 36 36 public ILookupParameter<DoubleMatrix> CostsParameter { … … 47 47 protected LAPEvaluator(bool deserializing) : base(deserializing) { } 48 48 protected LAPEvaluator(LAPEvaluator original, Cloner cloner) : base(original, cloner) { } 49 public LAPEvaluator() : base() { 49 public LAPEvaluator() 50 : base() { 50 51 Parameters.Add(new LookupParameter<DoubleMatrix>("Costs", LinearAssignmentProblem.CostsDescription)); 51 52 Parameters.Add(new LookupParameter<Permutation>("Assignment", "The assignment solution to evaluate.")); … … 57 58 } 58 59 59 public override IOperation Apply() {60 public override IOperation InstrumentedApply() { 60 61 var costs = CostsParameter.ActualValue; 61 62 var assignment = AssignmentParameter.ActualValue; … … 69 70 70 71 QualityParameter.ActualValue = new DoubleValue(quality); 71 return base. Apply();72 return base.InstrumentedApply(); 72 73 } 73 74 } -
branches/gteufl/HeuristicLab.Problems.LinearAssignment/3.3/LinearAssignmentProblem.cs
r9456 r12969 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 33 33 34 34 namespace HeuristicLab.Problems.LinearAssignment { 35 [Item("Linear AssignmentProblem", "In the linear assignment problem (LAP) an assignment of workers to jobs has to be found such that each worker is assigned to exactly one job, each job is assigned to exactly one worker and the sum of the resulting costs needs to be minimal.")]36 [Creatable( "Problems")]35 [Item("Linear Assignment Problem", "In the linear assignment problem (LAP) an assignment of workers to jobs has to be found such that each worker is assigned to exactly one job, each job is assigned to exactly one worker and the sum of the resulting costs is minimal (or maximal).")] 36 [Creatable(CreatableAttribute.Categories.CombinatorialProblems, Priority = 130)] 37 37 [StorableClass] 38 38 public sealed class LinearAssignmentProblem : SingleObjectiveHeuristicOptimizationProblem<ILAPEvaluator, IPermutationCreator>, IStorableContent { … … 153 153 } 154 154 } 155 private void Costs_Reset(object sender, EventArgs e) { 156 Parameterize(); 157 } 155 158 private void SolutionCreator_PermutationParameter_ActualNameChanged(object sender, EventArgs e) { 156 159 Parameterize(); … … 167 170 Costs.RowsChanged += new EventHandler(Costs_RowsChanged); 168 171 Costs.ColumnsChanged += new EventHandler(Costs_ColumnsChanged); 172 Costs.Reset += new EventHandler(Costs_Reset); 169 173 SolutionCreator.PermutationParameter.ActualNameChanged += new EventHandler(SolutionCreator_PermutationParameter_ActualNameChanged); 170 174 } … … 178 182 private void Parameterize() { 179 183 SolutionCreator.LengthParameter.Value = new IntValue(Costs.Rows); 180 SolutionCreator.LengthParameter.Hidden = false; 184 SolutionCreator.LengthParameter.Hidden = true; 185 SolutionCreator.PermutationTypeParameter.Value = new PermutationType(PermutationTypes.Absolute); 186 SolutionCreator.PermutationTypeParameter.Hidden = true; 181 187 Evaluator.CostsParameter.ActualName = CostsParameter.Name; 182 188 Evaluator.CostsParameter.Hidden = true; -
branches/gteufl/HeuristicLab.Problems.LinearAssignment/3.3/LinearAssignmentProblemSolver.cs
r9456 r12969 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 25 25 using HeuristicLab.Encodings.PermutationEncoding; 26 26 using HeuristicLab.Operators; 27 using HeuristicLab.Optimization; 27 28 using HeuristicLab.Parameters; 28 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 31 32 [Item("LinearAssignmentProblemSolver", "Uses the hungarian algorithm to solve linear assignment problems.")] 32 33 [StorableClass] 33 public sealed class LinearAssignmentProblemSolver : SingleSuccessorOperator {34 public sealed class LinearAssignmentProblemSolver : SingleSuccessorOperator, ISingleObjectiveOperator { 34 35 private const int UNASSIGNED = -1; 35 36 37 public IValueLookupParameter<BoolValue> MaximizationParameter { 38 get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; } 39 } 36 40 public ILookupParameter<DoubleMatrix> CostsParameter { 37 41 get { return (ILookupParameter<DoubleMatrix>)Parameters["Costs"]; } … … 49 53 public LinearAssignmentProblemSolver() 50 54 : base() { 55 Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "Whether the costs should be maximized or minimized.")); 51 56 Parameters.Add(new LookupParameter<DoubleMatrix>("Costs", LinearAssignmentProblem.CostsDescription)); 52 57 Parameters.Add(new LookupParameter<Permutation>("Assignment", "The assignment solution to create.")); … … 58 63 } 59 64 65 [StorableHook(HookType.AfterDeserialization)] 66 private void AfterDeserialization() { 67 // BackwardsCompatibility3.3 68 #region Backwards compatible code, remove with 3.4 69 if (!Parameters.ContainsKey("Maximization")) 70 Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "Whether the costs should be maximized or minimized.")); 71 #endregion 72 } 73 60 74 public override IOperation Apply() { 61 75 var costs = CostsParameter.ActualValue; 76 var maximization = MaximizationParameter.ActualValue.Value; 77 if (maximization) { 78 costs = (DoubleMatrix)costs.Clone(); 79 for (int i = 0; i < costs.Rows; i++) 80 for (int j = 0; j < costs.Rows; j++) 81 costs[i, j] = -costs[i, j]; 82 } 62 83 double quality; 63 84 var solution = Solve(costs, out quality); 64 85 65 86 AssignmentParameter.ActualValue = new Permutation(PermutationTypes.Absolute, solution); 87 if (maximization) quality = -quality; 66 88 QualityParameter.ActualValue = new DoubleValue(quality); 67 89 -
branches/gteufl/HeuristicLab.Problems.LinearAssignment/3.3/Plugin.cs.frame
r10037 r12969 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 24 24 namespace HeuristicLab.Problems.LinearAssignment { 25 [Plugin("HeuristicLab.Problems.LinearAssignment", "3.3. 9.$WCREV$")]25 [Plugin("HeuristicLab.Problems.LinearAssignment", "3.3.12.$WCREV$")] 26 26 [PluginFile("HeuristicLab.Problems.LinearAssignment-3.3.dll", PluginFileType.Assembly)] 27 27 [PluginDependency("HeuristicLab.Analysis", "3.3")] -
branches/gteufl/HeuristicLab.Problems.LinearAssignment/3.3/Properties/AssemblyInfo.cs.frame
r10037 r12969 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 32 32 [assembly: AssemblyCompany("HEAL")] 33 33 [assembly: AssemblyProduct("HeuristicLab")] 34 [assembly: AssemblyCopyright("(c) 2002-201 3HEAL")]34 [assembly: AssemblyCopyright("(c) 2002-2015 HEAL")] 35 35 [assembly: AssemblyTrademark("")] 36 36 [assembly: AssemblyCulture("")] … … 55 55 // [assembly: AssemblyVersion("1.0.*")] 56 56 [assembly: AssemblyVersion("3.3.0.0")] 57 [assembly: AssemblyFileVersion("3.3. 9.$WCREV$")]57 [assembly: AssemblyFileVersion("3.3.12.$WCREV$")]
Note: See TracChangeset
for help on using the changeset viewer.