Changeset 2981
- Timestamp:
- 03/09/10 18:14:06 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.TS/3.3
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.TS/3.3/HeuristicLab.Algorithms.TS-3.3.csproj
r2976 r2981 83 83 <Compile Include="HeuristicLabAlgorithmsTSPlugin.cs" /> 84 84 <Compile Include="Properties\AssemblyInfo.cs" /> 85 <Compile Include="TabuSelector.cs" /> 85 86 <Compile Include="TSOperator.cs" /> 86 87 </ItemGroup> … … 110 111 <Name>HeuristicLab.Operators-3.3</Name> 111 112 </ProjectReference> 113 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 114 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project> 115 <Name>HeuristicLab.Optimization-3.3</Name> 116 </ProjectReference> 112 117 <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj"> 113 118 <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project> 114 119 <Name>HeuristicLab.Parameters-3.3</Name> 115 120 </ProjectReference> 121 <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj"> 122 <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project> 123 <Name>HeuristicLab.Persistence-3.3</Name> 124 </ProjectReference> 116 125 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj"> 117 126 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project> 118 127 <Name>HeuristicLab.PluginInfrastructure</Name> 128 </ProjectReference> 129 <ProjectReference Include="..\..\HeuristicLab.Selection\3.3\HeuristicLab.Selection-3.3.csproj"> 130 <Project>{2C36CD4F-E5F5-43A4-801A-201EA895FE17}</Project> 131 <Name>HeuristicLab.Selection-3.3</Name> 119 132 </ProjectReference> 120 133 </ItemGroup> -
trunk/sources/HeuristicLab.Algorithms.TS/3.3/HeuristicLabAlgorithmsTSPlugin.cs.frame
r2976 r2981 32 32 [PluginDependency("HeuristicLab.Core", "3.3")] 33 33 [PluginDependency("HeuristicLab.Data", "3.3")] 34 //[PluginDependency("HeuristicLab.Evolutionary", "3.3")]35 34 [PluginDependency("HeuristicLab.Operators", "3.3")] 36 //[PluginDependency("HeuristicLab.Optimization", "3.3")]35 [PluginDependency("HeuristicLab.Optimization", "3.3")] 37 36 [PluginDependency("HeuristicLab.Parameters", "3.3")] 38 //[PluginDependency("HeuristicLab.Persistence", "3.3")]37 [PluginDependency("HeuristicLab.Persistence", "3.3")] 39 38 //[PluginDependency("HeuristicLab.Random", "3.3")] 40 //[PluginDependency("HeuristicLab.Selection", "3.3")]39 [PluginDependency("HeuristicLab.Selection", "3.3")] 41 40 public class HeuristicLabAlgorithmsTSPlugin : PluginBase { 42 41 } -
trunk/sources/HeuristicLab.Algorithms.TS/3.3/TSOperator.cs
r2976 r2981 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Data; 25 //using HeuristicLab.Evolutionary;26 25 using HeuristicLab.Operators; 27 26 using HeuristicLab.Parameters; 28 //using HeuristicLab.Selection;29 27 30 28 namespace HeuristicLab.Algorithms.TS { … … 47 45 get { return (ValueLookupParameter<IntData>)Parameters["MaximumIterations"]; } 48 46 } 47 public ValueLookupParameter<IntData> TabuTenureParameter { 48 get { return (ValueLookupParameter<IntData>)Parameters["TabuTenure"]; } 49 } 49 50 public ValueLookupParameter<VariableCollection> ResultsParameter { 50 51 get { return (ValueLookupParameter<VariableCollection>)Parameters["Results"]; } … … 66 67 Parameters.Add(new SubScopesLookupParameter<DoubleData>("Quality", "The value which represents the quality of a solution.")); 67 68 Parameters.Add(new ValueLookupParameter<IntData>("MaximumIterations", "The maximum number of generations which should be processed.")); 69 Parameters.Add(new ValueLookupParameter<IntData>("TabuTenure", "The length of the tabu list, and also means the number of iterations a move is kept tabu")); 68 70 Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored.")); 69 71 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the TS should be applied.")); 70 72 #endregion 71 73 72 #region Create operator graph74 #region Create operators 73 75 VariableCreator variableCreator = new VariableCreator(); 74 76 ResultsCollector resultsCollector = new ResultsCollector(); 75 76 OperatorGraph.InitialOperator = variableCreator; 77 Placeholder moveGenerator = new Placeholder(); 78 UniformSequentialSubScopesProcessor moveEvaluationProcessor = new UniformSequentialSubScopesProcessor(); 79 Placeholder moveQualityEvaluator = new Placeholder(); 80 Placeholder moveTabuEvaluator = new Placeholder(); 81 SubScopesSorter moveQualitySorter = new SubScopesSorter(); 82 Placeholder tabuSelector = new Placeholder(); 83 SequentialSubScopesProcessor moveMakingProcessor = new SequentialSubScopesProcessor(); 84 EmptyOperator emptyOp = new EmptyOperator(); 85 UniformSequentialSubScopesProcessor actualMoveMakingProcessor = new UniformSequentialSubScopesProcessor(); 86 Placeholder moveMaker = new Placeholder(); 87 Placeholder moveTabuMaker = new Placeholder(); 88 SubScopesRemover subScopesRemover = new SubScopesRemover(); 89 IntCounter iterationsCounter = new IntCounter(); 90 Comparator iterationsComparator = new Comparator(); 91 ConditionalBranch iterationsTermination = new ConditionalBranch(); 92 EmptyOperator finished = new EmptyOperator(); 77 93 78 94 variableCreator.CollectedValues.Add(new ValueParameter<IntData>("Iterations", new IntData(0))); … … 83 99 variableCreator.CollectedValues.Add(new ValueParameter<DataTable>("Qualities", new DataTable("Qualities"))); 84 100 variableCreator.CollectedValues.Add(new ValueParameter<DataTable>("MoveQualities", new DataTable("MoveQualities"))); 85 variableCreator.Successor = resultsCollector;86 101 87 102 resultsCollector.CollectedValues.Add(new LookupParameter<IntData>("Iterations")); … … 93 108 resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("MoveQualities")); 94 109 resultsCollector.ResultsParameter.ActualName = "Results"; 95 resultsCollector.Successor = null; 110 111 moveGenerator.Name = "MoveGenerator (placeholder)"; 112 moveGenerator.OperatorParameter.ActualName = "MoveGenerator"; 113 114 moveQualityEvaluator.Name = "MoveQualityEvaluator (placeholder)"; 115 moveQualityEvaluator.OperatorParameter.ActualName = "MoveQualityEvaluator"; 116 117 moveTabuEvaluator.Name = "MoveTabuEvaluator (placeholder)"; 118 moveTabuEvaluator.OperatorParameter.ActualName = "MoveTabuEvaluator"; 119 120 moveQualitySorter.DescendingParameter.ActualName = "Maximization"; 121 moveQualitySorter.ValueParameter.ActualName = "MoveQuality"; 122 123 tabuSelector.Name = "TabuSelector (placeholder)"; 124 tabuSelector.OperatorParameter.ActualName = "TabuSelector"; 125 126 moveMaker.Name = "MoveMaker (placeholder)"; 127 moveMaker.OperatorParameter.ActualName = "MoveMaker"; 128 129 moveTabuMaker.Name = "MoveTabuMaker (placeholder)"; 130 moveTabuMaker.OperatorParameter.ActualName = "MoveTabuMaker"; 131 132 subScopesRemover.RemoveAllSubScopes = true; 133 134 iterationsCounter.Increment = new IntData(1); 135 iterationsCounter.IncrementParameter.ActualName = "Iterations"; 136 137 iterationsComparator.Comparison = new ComparisonData(Comparison.Less); 138 iterationsComparator.LeftSideParameter.ActualName = "Iterations"; 139 iterationsComparator.RightSideParameter.ActualName = "MaximumIterations"; 140 iterationsComparator.ResultParameter.ActualName = "IterationsCondition"; 141 142 iterationsTermination.ConditionParameter.ActualName = "IterationsCondition"; 143 #endregion 144 145 #region Create operator graph 146 OperatorGraph.InitialOperator = variableCreator; 147 variableCreator.Successor = resultsCollector; 148 resultsCollector.Successor = moveGenerator; 149 moveGenerator.Successor = moveEvaluationProcessor; 150 moveEvaluationProcessor.Operator = moveQualityEvaluator; 151 moveQualityEvaluator.Successor = moveTabuEvaluator; 152 moveEvaluationProcessor.Successor = moveQualitySorter; 153 moveQualitySorter.Successor = tabuSelector; 154 tabuSelector.Successor = moveMakingProcessor; 155 moveMakingProcessor.Operators.AddRange(new Operator[] { emptyOp, actualMoveMakingProcessor }); 156 actualMoveMakingProcessor.Operator = moveMaker; 157 moveMaker.Successor = moveTabuMaker; 158 moveMakingProcessor.Successor = subScopesRemover; 159 subScopesRemover.Successor = iterationsCounter; 160 iterationsCounter.Successor = iterationsComparator; 161 iterationsComparator.Successor = iterationsTermination; 162 iterationsTermination.TrueBranch = resultsCollector; 163 iterationsTermination.FalseBranch = finished; 96 164 #endregion 97 165 }
Note: See TracChangeset
for help on using the changeset viewer.