Changeset 9160
- Timestamp:
- 01/15/13 10:47:09 (12 years ago)
- Location:
- branches/LearningClassifierSystems
- Files:
-
- 10 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LearningClassifierSystems/HeuristicLab.Algorithms.LearningClassifierSystems/3.3/HeuristicLab.Algorithms.LearningClassifierSystems-3.3.csproj
r9154 r9160 87 87 <Private>False</Private> 88 88 </Reference> 89 <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 89 90 <Reference Include="HeuristicLab.Random-3.3"> 90 91 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath> -
branches/LearningClassifierSystems/HeuristicLab.Algorithms.LearningClassifierSystems/3.3/LCSAdaptedGeneticAlgorithm.cs
r9154 r9160 63 63 get { return (ValueLookupParameter<PercentValue>)Parameters["MutationProbability"]; } 64 64 } 65 public ValueLookupParameter<PercentValue> CrossoverProbabilityParameter { 66 get { return (ValueLookupParameter<PercentValue>)Parameters["CrossoverProbability"]; } 67 } 65 68 public ValueLookupParameter<IOperator> MutatorParameter { 66 69 get { return (ValueLookupParameter<IOperator>)Parameters["Mutator"]; } … … 111 114 Parameters.Add(new ValueLookupParameter<IOperator>("Crossover", "The operator used to cross solutions.")); 112 115 Parameters.Add(new ValueLookupParameter<IOperator>("AfterCrossover", "The operator executed after crossing the solutions.")); 113 Parameters.Add(new ValueLookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.")); 116 Parameters.Add(new ValueLookupParameter<PercentValue>("CrossoverProbability", "The probability that the crossover operator is applied on a solution.")); 117 Parameters.Add(new ValueLookupParameter<PercentValue>("MutationProbability", "The probability that druing the mutation operator a mutation takes place.")); 114 118 Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions.")); 115 119 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.")); … … 128 132 ChildrenCreator childrenCreator = new ChildrenCreator(); 129 133 UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor(); 134 StochasticBranch crossoverStochasticBranch = new StochasticBranch(); 135 RandomSelector randomSelector = new RandomSelector(); 136 PreservingRightReducer preservingRightReducer = new PreservingRightReducer(); 137 Assigner numerosityAssigner = new Assigner(); 138 Assigner experienceAssigner = new Assigner(); 130 139 Placeholder crossover = new Placeholder(); 131 140 Placeholder afterCrossover = new Placeholder(); … … 167 176 childrenCreator.ParentsPerChild = new IntValue(2); 168 177 178 crossoverStochasticBranch.ProbabilityParameter.ActualName = CrossoverProbabilityParameter.ActualName; 179 crossoverStochasticBranch.RandomParameter.ActualName = "Random"; 180 181 randomSelector.CopySelected.Value = true; 182 randomSelector.NumberOfSelectedSubScopesParameter.Value = new IntValue(1); 183 169 184 crossover.Name = "Crossover"; 170 185 crossover.OperatorParameter.ActualName = "Crossover"; 186 187 numerosityAssigner.LeftSideParameter.ActualName = "Numerosity"; 188 numerosityAssigner.RightSideParameter.Value = new IntValue(1); 189 190 experienceAssigner.LeftSideParameter.ActualName = "Experience"; 191 experienceAssigner.RightSideParameter.Value = new IntValue(0); 171 192 172 193 afterCrossover.Name = "AfterCrossover"; … … 228 249 subScopesProcessor1.Successor = mergingReducer; 229 250 childrenCreator.Successor = uniformSubScopesProcessor1; 230 uniformSubScopesProcessor1.Operator = crossover ;251 uniformSubScopesProcessor1.Operator = crossoverStochasticBranch; 231 252 uniformSubScopesProcessor1.Successor = subScopesCounter; 253 crossoverStochasticBranch.FirstBranch = crossover; 254 crossoverStochasticBranch.SecondBranch = randomSelector; 255 randomSelector.Successor = preservingRightReducer; 256 preservingRightReducer.Successor = numerosityAssigner; 257 numerosityAssigner.Successor = experienceAssigner; 258 experienceAssigner.Successor = null; 259 crossoverStochasticBranch.Successor = mutator; 232 260 crossover.Successor = afterCrossover; 233 afterCrossover.Successor = mutator;234 261 mutator.Successor = doGASubsumptionBranch1; 235 262 doGASubsumptionBranch1.TrueBranch = checkGASubsumptionOperator; -
branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/HeuristicLab.Encodings.ConditionActionEncoding-3.3.csproj
r9154 r9160 68 68 <Private>False</Private> 69 69 </Reference> 70 <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 70 71 <Reference Include="HeuristicLab.Selection-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 71 72 <Private>False</Private> … … 120 121 <Compile Include="Selectors\IMatchSelector.cs" /> 121 122 <Compile Include="Selectors\MatchSelector.cs" /> 123 <Compile Include="Selectors\PreservingRightReducer.cs" /> 122 124 <Compile Include="Subsumption\ActionSetSubsumptionOperator.cs" /> 123 125 <Compile Include="Subsumption\CheckGASubsumptionOperator.cs" /> -
branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Interfaces/IConditionActionProblemData.cs
r9154 r9160 34 34 IEnumerable<string> AllowedActionVariables { get; } 35 35 36 IntValue Length { get; }37 IntValue ActionLength { get; }38 IntMatrix Bounds { get; }39 40 36 IClassifier FetchClassifier(int rowNumber); 41 37 -
branches/LearningClassifierSystems/HeuristicLab.Problems.ConditionActionClassification/3.3
- Property svn:ignore
-
old new 1 1 obj 2 2 Plugin.cs 3 *.user
-
- Property svn:ignore
-
branches/LearningClassifierSystems/HeuristicLab.Problems.ConditionActionClassification/3.3/HeuristicLab.Problems.ConditionActionClassification-3.3.csproj
r9154 r9160 78 78 <Private>False</Private> 79 79 </Reference> 80 <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 80 81 <Reference Include="System" /> 81 82 <Reference Include="System.Core" /> -
branches/LearningClassifierSystems/HeuristicLab.Problems.ConditionActionClassification/3.3/Implementation/ConditionActionClassificationProblem.cs
r9154 r9160 30 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 31 using HeuristicLab.Problems.DataAnalysis; 32 using HeuristicLab.Problems.Instances; 32 33 33 34 namespace HeuristicLab.Problems.ConditionActionClassification { 34 35 [StorableClass] 35 public class ConditionActionClassificationProblem : HeuristicOptimizationProblem<XCSEvaluator, UniformRandomCombinedIntegerVectorCreator>, IConditionActionProblem { 36 public class ConditionActionClassificationProblem : HeuristicOptimizationProblem<XCSEvaluator, UniformRandomCombinedIntegerVectorCreator>, IConditionActionProblem, 37 IProblemInstanceConsumer<ConditionActionClassificationProblemData> { 36 38 private const string ClassifierFetcherParameterName = "ClassifierFetcher"; 37 39 private const string ActionExecuterParameterName = "ActionExecuter"; … … 87 89 public ConditionActionClassificationProblemData ProblemData { 88 90 get { return ProblemDataParameter.Value; } 91 protected set { 92 ProblemDataParameter.Value = value; 93 if (value != null) { 94 SetProblemDataSpecificParameters(); 95 } 96 } 89 97 } 90 98 IParameter IConditionActionProblem.PossibleActionsConcreteClassParameter { … … 185 193 Evaluator.InitialPredictionParameter.ActualName = "InitialPrediction"; 186 194 195 coveringSolutionCreator.ChangeSymbolProbabilityParameter.ActualName = ChangeSymbolProbabilityInCoveringParameter.Name; 196 coveringSolutionCreator.CoverClassifierParameter.ActualName = ClassifierFetcher.CurrentClassifierToMatchParameter.ActualName; 197 coveringSolutionCreator.CreatedClassifierParameter.ActualName = "CombinedIntegerVector"; 198 199 ClassifierFetcher.ProblemDataParameter.ActualName = ProblemDataParameter.Name; 200 201 ActionExecuter.CurrentClassifierToMatchParameter.ActualName = ClassifierFetcher.CurrentClassifierToMatchParameter.ActualName; 202 ActionExecuter.NegativeRewardParameter.ActualName = NegativeRewardParameter.Name; 203 ActionExecuter.PositiveRewardParameter.ActualName = PositiveRewardParameter.Name; 204 205 ActionSetSubsumptionOperator.ClassifiersParameter.ActualName = "CombinedIntegerVector"; 206 207 SetProblemDataSpecificParameters(); 208 ThetaMinimalNumberOfActions.Value = PossibleActions.Count; 209 210 InitializeOperators(); 211 212 problemData.Changed += new System.EventHandler(problemData_Changed); 213 } 214 215 private void problemData_Changed(object sender, System.EventArgs e) { 216 SetProblemDataSpecificParameters(); 217 } 218 219 private void SetProblemDataSpecificParameters() { 187 220 SolutionCreator.ActionPartLengthParameter.ActualName = ProblemData.ActionLengthParameter.Name; 188 221 SolutionCreator.LengthParameter.ActualName = ProblemData.LengthParameter.Name; 189 222 SolutionCreator.BoundsParameter.ActualName = ProblemData.BoundsParameter.Name; 190 223 191 coveringSolutionCreator.ChangeSymbolProbabilityParameter.ActualName = ChangeSymbolProbabilityInCoveringParameter.Name;192 coveringSolutionCreator.CoverClassifierParameter.ActualName = ClassifierFetcher.CurrentClassifierToMatchParameter.ActualName;193 coveringSolutionCreator.CreatedClassifierParameter.ActualName = "CombinedIntegerVector";194 195 ClassifierFetcher.ProblemDataParameter.ActualName = ProblemDataParameter.Name;196 197 ActionExecuter.CurrentClassifierToMatchParameter.ActualName = ClassifierFetcher.CurrentClassifierToMatchParameter.ActualName;198 ActionExecuter.NegativeRewardParameter.ActualName = NegativeRewardParameter.Name;199 ActionExecuter.PositiveRewardParameter.ActualName = PositiveRewardParameter.Name;200 201 ActionSetSubsumptionOperator.ClassifiersParameter.ActualName = "CombinedIntegerVector";202 203 SetPossibleActions();204 ThetaMinimalNumberOfActions.Value = PossibleActions.Count;205 206 InitializeOperators();207 208 problemData.Changed += new System.EventHandler(problemData_Changed);209 }210 211 private void problemData_Changed(object sender, System.EventArgs e) {212 224 SetPossibleActions(); 213 225 } … … 282 294 return actionBounds; 283 295 } 296 297 public void Load(ConditionActionClassificationProblemData data) { 298 Name = data.Name; 299 Description = data.Description; 300 ProblemData = data; 301 } 284 302 } 285 303 } -
branches/LearningClassifierSystems/HeuristicLab.Problems.ConditionActionClassification/3.3/Implementation/ConditionActionClassificationProblemData.cs
r9154 r9160 40 40 {0,0,1,1,0,0,0}, 41 41 {0,1,1,1,0,0,0}, 42 {0,0,1,0,0,0, 0},42 {0,0,1,0,0,0,1}, 43 43 {1,0,1,0,1,1,0} 44 44 }; … … 117 117 Parameters.Add(new FixedValueParameter<ReadOnlyCheckedItemList<StringValue>>("ActionVariables", "", actionVariables.AsReadOnly())); 118 118 Parameters.Add(new FixedValueParameter<ReadOnlyCheckedItemList<StringValue>>("ConditionVariables", "", conditionVariables.AsReadOnly())); 119 Parameters.Add(new FixedValueParameter<IntValue>("Length", "", new IntValue(7))); 120 Parameters.Add(new FixedValueParameter<IntValue>("ActionLength", "", new IntValue(1))); 121 int[,] elements = new int[,] { { 0, 3 }, { 0, 3 }, { 0, 3 }, { 0, 3 }, { 0, 3 }, { 0, 3 }, { 0, 2 } }; 122 Parameters.Add(new FixedValueParameter<IntMatrix>("Bounds", "", new IntMatrix(elements))); 119 Parameters.Add(new FixedValueParameter<IntValue>("Length", "", new IntValue(allowedConditionVariables.Count() + allowedActionVariables.Count()))); 120 Parameters.Add(new FixedValueParameter<IntValue>("ActionLength", "", new IntValue(allowedActionVariables.Count()))); 121 Parameters.Add(new FixedValueParameter<IntMatrix>("Bounds", "", GetBoundsMatrix(dataset, allowedConditionVariables, allowedActionVariables))); 123 122 124 123 ((ValueParameter<Dataset>)DatasetParameter).ReactOnValueToStringChangedAndValueItemImageChanged = false; 124 } 125 126 private IntMatrix GetBoundsMatrix(Dataset dataset, IEnumerable<string> conditionVariables, IEnumerable<string> actionVariables) { 127 IntMatrix bounds = new IntMatrix(conditionVariables.Count() + actionVariables.Count(), 2); 128 int index = 0; 129 foreach (var variable in conditionVariables) { 130 var values = dataset.GetDoubleValues(variable); 131 bounds[index, 0] = (int)values.Min(); 132 bounds[index, 1] = (int)values.Max() + 2; 133 index++; 134 } 135 foreach (var variable in actionVariables) { 136 var values = dataset.GetDoubleValues(variable); 137 bounds[index, 0] = (int)values.Min(); 138 bounds[index, 1] = (int)values.Max() + 1; 139 index++; 140 } 141 return bounds; 125 142 } 126 143 -
branches/LearningClassifierSystems/HeuristicLab.Problems.XCS.Views/3.3
-
Property
svn:ignore
set to
Plugin.cs
*.user
-
Property
svn:ignore
set to
-
branches/LearningClassifierSystems/HeuristicLab.Problems.XCS.Views/3.3/Properties
-
Property
svn:ignore
set to
AssemblyInfo.cs
-
Property
svn:ignore
set to
-
branches/LearningClassifierSystems/HeuristicLab.Problems.XCS.Views/3.3/XCSModelView.cs
r9154 r9160 52 52 if (Content == null) { 53 53 dataGridView.Rows.Clear(); 54 } else { 55 56 dataGridView.RowCount = Content.Count; 57 58 int row = 0; 59 foreach (var xcsClassifier in Content) { 60 dataGridView[0, row].Value = xcsClassifier.Classifier.ToString(); 61 dataGridView[1, row].Value = xcsClassifier.Prediction.ToString(); 62 dataGridView[2, row].Value = xcsClassifier.PredictionError.ToString(); 63 dataGridView[3, row].Value = xcsClassifier.Fitness.ToString(); 64 dataGridView[4, row].Value = xcsClassifier.Numerosity.ToString(); 65 dataGridView[5, row].Value = xcsClassifier.Timestamp.ToString(); 66 dataGridView[6, row].Value = xcsClassifier.Experience.ToString(); 67 dataGridView[7, row].Value = xcsClassifier.AverageActionSetSize.ToString(); 68 row++; 69 } 70 71 dataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.ColumnHeader); 72 dataGridView.AutoResizeRowHeadersWidth(DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders); 54 73 } 55 56 dataGridView.RowCount = Content.Count;57 58 int row = 0;59 foreach (var xcsClassifier in Content) {60 dataGridView[0, row].Value = xcsClassifier.Classifier.ToString();61 dataGridView[1, row].Value = xcsClassifier.Prediction.ToString();62 dataGridView[2, row].Value = xcsClassifier.PredictionError.ToString();63 dataGridView[3, row].Value = xcsClassifier.Fitness.ToString();64 dataGridView[4, row].Value = xcsClassifier.Numerosity.ToString();65 dataGridView[5, row].Value = xcsClassifier.Timestamp.ToString();66 dataGridView[6, row].Value = xcsClassifier.Experience.ToString();67 dataGridView[7, row].Value = xcsClassifier.AverageActionSetSize.ToString();68 row++;69 }70 71 dataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.ColumnHeader);72 dataGridView.AutoResizeRowHeadersWidth(DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders);73 74 } 74 75 } -
branches/LearningClassifierSystems/LearningClassifierSystem.sln
r9154 r9160 17 17 EndProject 18 18 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.XCS.Views-3.3", "HeuristicLab.Problems.XCS.Views\3.3\HeuristicLab.Problems.XCS.Views-3.3.csproj", "{8FFB8E0F-BC17-4D72-AF0F-E67A22F8EDE5}" 19 EndProject 20 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.Instances.ConditionActionClassification", "HeuristicLab.Problems.Instances.ConditionActionClassification\3.3\HeuristicLab.Problems.Instances.ConditionActionClassification.csproj", "{1CC7585E-DD22-41FA-869B-93DE41EA8936}" 19 21 EndProject 20 22 Global … … 72 74 {8FFB8E0F-BC17-4D72-AF0F-E67A22F8EDE5}.Release|x64.ActiveCfg = Release|Any CPU 73 75 {8FFB8E0F-BC17-4D72-AF0F-E67A22F8EDE5}.Release|x86.ActiveCfg = Release|Any CPU 76 {1CC7585E-DD22-41FA-869B-93DE41EA8936}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 77 {1CC7585E-DD22-41FA-869B-93DE41EA8936}.Debug|Any CPU.Build.0 = Debug|Any CPU 78 {1CC7585E-DD22-41FA-869B-93DE41EA8936}.Debug|x64.ActiveCfg = Debug|Any CPU 79 {1CC7585E-DD22-41FA-869B-93DE41EA8936}.Debug|x86.ActiveCfg = Debug|Any CPU 80 {1CC7585E-DD22-41FA-869B-93DE41EA8936}.Release|Any CPU.ActiveCfg = Release|Any CPU 81 {1CC7585E-DD22-41FA-869B-93DE41EA8936}.Release|Any CPU.Build.0 = Release|Any CPU 82 {1CC7585E-DD22-41FA-869B-93DE41EA8936}.Release|x64.ActiveCfg = Release|Any CPU 83 {1CC7585E-DD22-41FA-869B-93DE41EA8936}.Release|x86.ActiveCfg = Release|Any CPU 74 84 EndGlobalSection 75 85 GlobalSection(SolutionProperties) = preSolution
Note: See TracChangeset
for help on using the changeset viewer.