- Timestamp:
- 07/08/16 14:40:02 (8 years ago)
- Location:
- branches/crossvalidation-2434
- Files:
-
- 10 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/crossvalidation-2434
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Problems.GeneticProgramming/3.3/ArtificialAnt/Interpreter.cs
r12911 r14029 32 32 public int FoodEaten { get; private set; } 33 33 public BoolMatrix World { get; private set; } 34 35 34 public ISymbolicExpressionTree Expression { get; private set; } 36 35 36 public int ElapsedTime { get; set; } 37 37 38 public int ElapsedTime { get; set; }39 38 private int currentDirection; 40 39 private int currentAntLocationRow; -
branches/crossvalidation-2434/HeuristicLab.Problems.GeneticProgramming/3.3/ArtificialAnt/Problem.cs
r12911 r14029 22 22 using System; 23 23 using System.Diagnostics.Contracts; 24 using System.Drawing.Text;25 24 using System.Linq; 26 25 using HeuristicLab.Common; … … 38 37 [StorableClass] 39 38 public sealed class Problem : SymbolicExpressionTreeProblem, IStorableContent { 40 public string Filename { get; set; }41 39 42 40 #region constant for default world (Santa Fe) … … 104 102 } 105 103 104 #region item cloning and persistence 105 // persistence 106 [StorableConstructor] 107 private Problem(bool deserializing) : base(deserializing) { } 108 [StorableHook(HookType.AfterDeserialization)] 109 private void AfterDeserialization() { } 110 111 // cloning 112 private Problem(Problem original, Cloner cloner) : base(original, cloner) { } 113 public override IDeepCloneable Clone(Cloner cloner) { 114 return new Problem(this, cloner); 115 } 116 #endregion 117 106 118 public Problem() 107 119 : base() { … … 114 126 g.AddSymbols(new string[] { "IfFoodAhead", "Prog2" }, 2, 2); 115 127 g.AddSymbols(new string[] { "Prog3" }, 3, 3); 116 g.AddTerminalSymbols(new string[] { " Left", "Right", "Move" });128 g.AddTerminalSymbols(new string[] { "Move", "Left", "Right" }); 117 129 base.Encoding = new SymbolicExpressionTreeEncoding(g, 20, 10); 118 130 } … … 137 149 } 138 150 139 // persistence140 [StorableConstructor]141 private Problem(bool deserializing) : base(deserializing) { }142 [StorableHook(HookType.AfterDeserialization)]143 private void AfterDeserialization() {144 }145 146 // cloning147 private Problem(Problem original, Cloner cloner)148 : base(original, cloner) {149 }150 public override IDeepCloneable Clone(Cloner cloner) {151 return new Problem(this, cloner);152 }153 154 151 #region helpers 155 152 private bool[,] ToBoolMatrix(char[][] ch) { -
branches/crossvalidation-2434/HeuristicLab.Problems.GeneticProgramming/3.3/ArtificialAnt/Trail.cs
r12911 r14029 20 20 #endregion 21 21 22 using System;23 22 using System.Drawing; 24 23 using HeuristicLab.Common; … … 54 53 } 55 54 55 #region item cloning and persistence 56 56 [StorableConstructor] 57 57 private Solution(bool deserializing) : base(deserializing) { } … … 70 70 return new Solution(this, cloner); 71 71 } 72 #endregion 72 73 } 73 74 } -
branches/crossvalidation-2434/HeuristicLab.Problems.GeneticProgramming/3.3/HeuristicLab.Problems.GeneticProgramming-3.3.csproj
r12911 r14029 104 104 </Reference> 105 105 <Reference Include="System.Drawing" /> 106 <Reference Include="System.IO.Compression" /> 107 <Reference Include="System.IO.Compression.FileSystem" /> 106 108 </ItemGroup> 107 109 <ItemGroup> … … 109 111 <Compile Include="ArtificialAnt\Problem.cs" /> 110 112 <Compile Include="ArtificialAnt\Trail.cs" /> 113 <Compile Include="BasicSymbolicRegression\Problem.cs" /> 114 <Compile Include="Boolean\MultiplexerProblem.cs" /> 115 <Compile Include="Boolean\EvenParityProblem.cs" /> 111 116 <Compile Include="LawnMower\Interpreter.cs" /> 112 117 <Compile Include="LawnMower\Problem.cs" /> … … 114 119 <Compile Include="Plugin.cs" /> 115 120 <Compile Include="Properties\AssemblyInfo.cs" /> 121 <Compile Include="robocode\EnemyCollection.cs" /> 122 <Compile Include="robocode\Grammar.cs" /> 123 <Compile Include="robocode\Interpreter.cs" /> 124 <Compile Include="robocode\Problem.cs" /> 125 <Compile Include="robocode\Solution.cs" /> 126 <Compile Include="robocode\Symbols\BooleanTreeNode.cs" /> 127 <Compile Include="robocode\Symbols\BooleanValue.cs" /> 128 <Compile Include="robocode\Symbols\CodeSymbol.cs" /> 129 <Compile Include="robocode\Symbols\Number.cs" /> 130 <Compile Include="robocode\Symbols\NumberTreeNode.cs" /> 131 <Compile Include="robocode\Symbols\ShotPower.cs" /> 132 <Compile Include="robocode\Symbols\ShotPowerTreeNode.cs" /> 116 133 </ItemGroup> 117 134 <ItemGroup> … … 119 136 <None Include="Plugin.cs.frame" /> 120 137 <None Include="Properties\AssemblyInfo.cs.frame" /> 138 <None Include="robocode\BattleObserver.class"> 139 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 140 </None> 141 <None Include="robocode\BattleRunner.class"> 142 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 143 </None> 144 <None Include="robocode\robocode.zip"> 145 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 146 </None> 121 147 </ItemGroup> 122 148 <ItemGroup> … … 174 200 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project> 175 201 <Name>HeuristicLab.PluginInfrastructure-3.3</Name> 202 <Private>False</Private> 203 </ProjectReference> 204 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj"> 205 <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project> 206 <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name> 207 <Private>False</Private> 208 </ProjectReference> 209 <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj"> 210 <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project> 211 <Name>HeuristicLab.Problems.Instances-3.3</Name> 176 212 <Private>False</Private> 177 213 </ProjectReference> … … 198 234 <Install>true</Install> 199 235 </BootstrapperPackage> 236 </ItemGroup> 237 <ItemGroup> 238 <Content Include="robocode\BattleRunner.java" /> 200 239 </ItemGroup> 201 240 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/crossvalidation-2434/HeuristicLab.Problems.GeneticProgramming/3.3/LawnMower/Interpreter.cs
r12911 r14029 26 26 27 27 namespace HeuristicLab.Problems.GeneticProgramming.LawnMower { 28 public class Interpreter {28 public static class Interpreter { 29 29 private enum Heading { 30 30 South, … … 45 45 } 46 46 47 48 47 public static bool[,] EvaluateLawnMowerProgram(int length, int width, ISymbolicExpressionTree tree) { 49 50 48 bool[,] lawn = new bool[length, width]; 51 49 var mowerState = new MowerState(); … … 56 54 return lawn; 57 55 } 58 59 56 60 57 private static Tuple<int, int> EvaluateLawnMowerProgram(ISymbolicExpressionTreeNode node, MowerState mowerState, bool[,] lawn, IEnumerable<ISymbolicExpressionTreeNode> adfs) { -
branches/crossvalidation-2434/HeuristicLab.Problems.GeneticProgramming/3.3/LawnMower/Problem.cs
r12911 r14029 50 50 } 51 51 52 #region item cloning and persistence 52 53 [StorableConstructor] 53 protected Problem(bool deserializing) 54 : base(deserializing) { 54 protected Problem(bool deserializing) : base(deserializing) { } 55 [StorableHook(HookType.AfterDeserialization)] 56 private void AfterDeserialization() { } 57 58 protected Problem(Problem original, Cloner cloner) : base(original, cloner) { } 59 public override IDeepCloneable Clone(Cloner cloner) { 60 return new Problem(this, cloner); 55 61 } 56 protected Problem(Problem original, Cloner cloner) 57 : base(original, cloner) { 58 } 62 #endregion 63 59 64 public Problem() 60 65 : base() { … … 87 92 } 88 93 89 90 [StorableHook(HookType.AfterDeserialization)]91 private void AfterDeserialization() { }92 93 94 public override double Evaluate(ISymbolicExpressionTree tree, IRandom random) { 94 95 var length = LawnLengthParameter.Value.Value; … … 105 106 return numberOfMowedCells; 106 107 } 107 108 public override IDeepCloneable Clone(Cloner cloner) {109 return new Problem(this, cloner);110 }111 108 } 112 109 } -
branches/crossvalidation-2434/HeuristicLab.Problems.GeneticProgramming/3.3/LawnMower/Solution.cs
r12911 r14029 37 37 public double Quality { get; private set; } 38 38 39 #region item cloning and persistence 39 40 [StorableConstructor] 40 41 private Solution(bool deserializing) : base(deserializing) { } 42 [StorableHook(HookType.AfterDeserialization)] 43 private void AfterDeserialization() { } 44 41 45 private Solution(Solution original, Cloner cloner) 42 46 : base(original, cloner) { … … 46 50 this.Quality = original.Quality; 47 51 } 52 public override IDeepCloneable Clone(Cloner cloner) { 53 return new Solution(this, cloner); 54 } 55 #endregion 48 56 49 57 public Solution(ISymbolicExpressionTree tree, int length, int width, double quality) … … 54 62 this.Quality = quality; 55 63 } 56 [StorableHook(HookType.AfterDeserialization)]57 private void AfterDeserialization() {58 }59 public override IDeepCloneable Clone(Cloner cloner) {60 return new Solution(this, cloner);61 }62 64 } 63 65 } -
branches/crossvalidation-2434/HeuristicLab.Problems.GeneticProgramming/3.3/Plugin.cs.frame
r12915 r14029 21 21 22 22 using System; 23 using System.Collections.Generic; 24 using System.Text; 23 using System.IO; 24 using System.IO.Compression; 25 using System.Linq; 25 26 using HeuristicLab.PluginInfrastructure; 26 27 27 28 namespace HeuristicLab.Problems.GeneticProgramming { 28 [Plugin("HeuristicLab.Problems.GeneticProgramming","Provides implementations for genetic programming problems such as the artificial ant problem.", "3.3. 0.$WCREV$")]29 [Plugin("HeuristicLab.Problems.GeneticProgramming","Provides implementations for genetic programming problems such as the artificial ant problem.", "3.3.13.$WCREV$")] 29 30 [PluginFile("HeuristicLab.Problems.GeneticProgramming-3.3.dll", PluginFileType.Assembly)] 31 [PluginFile("Robocode/robocode.zip", PluginFileType.Data)] 32 [PluginFile("Robocode/BattleRunner.class", PluginFileType.Data)] 33 [PluginFile("Robocode/BattleObserver.class", PluginFileType.Data)] 30 34 [PluginDependency("HeuristicLab.Collections", "3.3")] 31 35 [PluginDependency("HeuristicLab.Common", "3.3")] … … 37 41 [PluginDependency("HeuristicLab.Parameters", "3.3")] 38 42 [PluginDependency("HeuristicLab.Persistence", "3.3")] 43 [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")] 44 [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] 39 45 [PluginDependency("HeuristicLab.Random", "3.3")] 40 46 public class HeuristicLabProblemsGeneticProgrammingPlugin : PluginBase { 47 public override void OnLoad() { 48 base.OnLoad(); 49 if (!Directory.EnumerateDirectories(AppDomain.CurrentDomain.BaseDirectory, Path.Combine("Robocode", "libs"), SearchOption.TopDirectoryOnly).Any()) { 50 ZipFile.ExtractToDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Path.Combine("Robocode", "robocode.zip")), AppDomain.CurrentDomain.BaseDirectory); 51 } 52 } 41 53 } 42 54 } -
branches/crossvalidation-2434/HeuristicLab.Problems.GeneticProgramming/3.3/Properties/AssemblyInfo.cs.frame
r12911 r14029 53 53 // by using the '*' as shown below: 54 54 [assembly: AssemblyVersion("3.3.0.0")] 55 [assembly: AssemblyFileVersion("3.3. 0.$WCREV$")]55 [assembly: AssemblyFileVersion("3.3.13.$WCREV$")]
Note: See TracChangeset
for help on using the changeset viewer.