- Timestamp:
- 07/19/17 12:55:58 (7 years ago)
- Location:
- branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis
- Files:
-
- 13 added
- 3 deleted
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/HeuristicLab.Problems.ProgramSynthesis.csproj
r15189 r15273 122 122 <DependentUpon>Resources.resx</DependentUpon> 123 123 </Compile> 124 <Compile Include="Push\Analyzer\IIndividualZeroErrorAnalyzer.cs" /> 125 <Compile Include="Push\Analyzer\IndividualZeroErrorAnalyzer.cs" /> 124 126 <Compile Include="Push\Analyzer\IPushExpressionAnalyzer.cs" /> 125 127 <Compile Include="Push\Analyzer\PushExpressionFrequencyAnalyzer.cs" /> … … 195 197 <Compile Include="Push\Extensions\ControlExntensions.cs" /> 196 198 <Compile Include="Push\Extensions\EnumExtensions.cs" /> 197 <Compile Include="Push\Extensions\ProblemDataExtensions.cs" />198 199 <Compile Include="Push\Extensions\LongExtensions.cs" /> 199 200 <Compile Include="Push\Extensions\RandomExtensions.cs" /> … … 212 213 <Compile Include="Push\Interpreter\PushInterpreter.cs" /> 213 214 <Compile Include="Push\Interpreter\PushInterpreterPool.cs" /> 215 <Compile Include="Push\ObjectPools\Random\SeededRandomPool.cs" /> 214 216 <Compile Include="Push\ObjectPools\StringBuilderPool.cs" /> 215 217 <Compile Include="Push\Parser\PushParser.cs" /> … … 228 230 <Compile Include="Push\Selector\LexicaseSelector.cs" /> 229 231 <Compile Include="Push\Simplifier\Simplifier.cs" /> 232 <Compile Include="Push\SolutionCreator\PushSolutionCreator.cs" /> 233 <Compile Include="Push\SolutionCreator\PushSolutionEncoding.cs" /> 230 234 <Compile Include="Push\Stack\IPrintStack.cs" /> 231 235 <Compile Include="Push\Stack\IPushStack.cs" /> -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Analyzer/PushExpressionFrequencyAnalyzer.cs
r15189 r15273 12 12 using HeuristicLab.Parameters; 13 13 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 14 using HeuristicLab.Problems.ProgramSynthesis.Push.Attributes; 14 15 using HeuristicLab.Problems.ProgramSynthesis.Push.Configuration; 15 16 using HeuristicLab.Problems.ProgramSynthesis.Push.Expressions; 16 17 using HeuristicLab.Problems.ProgramSynthesis.Push.Individual; 18 using HeuristicLab.Problems.ProgramSynthesis.Push.ObjectPools.Random; 17 19 18 20 /// <summary> … … 22 24 [StorableClass] 23 25 public class PushExpressionFrequencyAnalyzer : SingleSuccessorOperator, IPushExpressionAnalyzer { 26 private readonly SeededRandomPool randomPool = new SeededRandomPool(); 24 27 25 private const string PushConfigurationParameterName = "PushConfiguration"; 26 private const string IntegerVectorParameterName = "IntegerVector"; 27 private const string ResultsParameterName = "Results"; 28 private const string ExpressionFrequenciesParameterName = "InstructionFrequencies"; 29 private const string AggregateStackTypesParameterName = "Aggregate stack types"; 28 private const string PUSH_CONFIGURATION_PARAMETER_NAME = "PushConfiguration"; 29 private const string INTEGER_VECTOR_PARAMETER_NAME = "IntegerVector"; 30 private const string RESULTS_PARAMETER_NAME = "Results"; 31 private const string EXPRESSION_FREQUENCIES_PARAMETER_NAME = "InstructionFrequencies"; 32 private const string AGGREGATE_STACK_TYPES_PARAMETER_NAME = "Aggregate stack types"; 33 private const string IN_EXPRESSION_GROUP_NAME = "IN"; 34 private const string RANDOM_PARAMETER_NAME = "Random"; 35 private const string RESULT_PARAMETER_NAME = "Instruction frequencies"; 36 private const string RESULT_PARAMETER_DESCRIPTION = "Relative frequency of instructions aggregated over the whole population."; 37 private const string Y_AXIS_TITLE = "Relative Instruction Frequency"; 30 38 31 39 public PushExpressionFrequencyAnalyzer() { 32 Parameters.Add(new LookupParameter<IReadOnlyPushConfiguration>(P ushConfigurationParameterName, "The current specified push configuration."));33 Parameters.Add(new ScopeTreeLookupParameter<IntegerVector>(I ntegerVectorParameterName, "The integer vectors to analyze."));34 Parameters.Add(new LookupParameter<DataTable>(E xpressionFrequenciesParameterName, "The data table to store the instruction frequencies."));35 Parameters.Add(new LookupParameter<ResultCollection>(R esultsParameterName, "The result collection where the symbol frequencies should be stored."));40 Parameters.Add(new LookupParameter<IReadOnlyPushConfiguration>(PUSH_CONFIGURATION_PARAMETER_NAME, "The current specified push configuration.")); 41 Parameters.Add(new ScopeTreeLookupParameter<IntegerVector>(INTEGER_VECTOR_PARAMETER_NAME, "The integer vectors to analyze.")); 42 Parameters.Add(new LookupParameter<DataTable>(EXPRESSION_FREQUENCIES_PARAMETER_NAME, "The data table to store the instruction frequencies.")); 43 Parameters.Add(new LookupParameter<ResultCollection>(RESULTS_PARAMETER_NAME, "The result collection where the symbol frequencies should be stored.")); 36 44 37 Parameters.Add(new FixedValueParameter<BoolValue>(A ggregateStackTypesParameterName, "Determines if expressions should be aggregated by their primary stack type.", new BoolValue(true)));45 Parameters.Add(new FixedValueParameter<BoolValue>(AGGREGATE_STACK_TYPES_PARAMETER_NAME, "Determines if expressions should be aggregated by their primary stack type.", new BoolValue(true))); 38 46 } 39 47 … … 51 59 public ILookupParameter<IReadOnlyPushConfiguration> PushConfigurationParameter 52 60 { 53 get { return (ILookupParameter<IReadOnlyPushConfiguration>)Parameters[P ushConfigurationParameterName]; }61 get { return (ILookupParameter<IReadOnlyPushConfiguration>)Parameters[PUSH_CONFIGURATION_PARAMETER_NAME]; } 54 62 } 55 63 56 64 public IScopeTreeLookupParameter<IntegerVector> IntegerVectorParameter 57 65 { 58 get { return (IScopeTreeLookupParameter<IntegerVector>)Parameters[I ntegerVectorParameterName]; }66 get { return (IScopeTreeLookupParameter<IntegerVector>)Parameters[INTEGER_VECTOR_PARAMETER_NAME]; } 59 67 } 60 68 61 69 public ILookupParameter<DataTable> ExpressionFrequenciesParameter 62 70 { 63 get { return (ILookupParameter<DataTable>)Parameters[ExpressionFrequenciesParameterName]; } 71 get { return (ILookupParameter<DataTable>)Parameters[EXPRESSION_FREQUENCIES_PARAMETER_NAME]; } 72 } 73 74 public ILookupParameter<IRandom> RandomParameter 75 { 76 get { return (ILookupParameter<IRandom>)Parameters[RANDOM_PARAMETER_NAME]; } 64 77 } 65 78 66 79 public ILookupParameter<ResultCollection> ResultsParameter 67 80 { 68 get { return (ILookupParameter<ResultCollection>)Parameters[R esultsParameterName]; }81 get { return (ILookupParameter<ResultCollection>)Parameters[RESULTS_PARAMETER_NAME]; } 69 82 } 70 83 71 84 public IValueParameter<BoolValue> AggregateStackTypesParameter 72 85 { 73 get { return (IValueParameter<BoolValue>)Parameters[A ggregateStackTypesParameterName]; }86 get { return (IValueParameter<BoolValue>)Parameters[AGGREGATE_STACK_TYPES_PARAMETER_NAME]; } 74 87 } 75 88 … … 80 93 } 81 94 82 83 95 public override IOperation Apply() { 84 96 var config = PushConfigurationParameter.ActualValue; 85 97 var integerVectors = IntegerVectorParameter.ActualValue; 86 var pushPrograms = integerVectors.Select(iv => iv.ToPushProgram(config)); 98 99 randomPool.Seed = config.Seed; 100 101 var pushPrograms = integerVectors.Select(iv => { 102 var random = randomPool.ResetAndAllocate(); 103 var program = iv.ToPushProgram(config, random); 104 randomPool.Free(random); 105 106 return program; 107 }); 87 108 88 109 var results = ResultsParameter.ActualValue; … … 91 112 if (frequencies == null) { 92 113 frequencies = new DataTable( 93 "Instruction frequencies",94 "Relative frequency of instructions aggregated over the whole population.") {114 RESULT_PARAMETER_NAME, 115 RESULT_PARAMETER_DESCRIPTION) { 95 116 VisualProperties = { 96 YAxisTitle = "Relative Instruction Frequency"117 YAxisTitle = Y_AXIS_TITLE 97 118 } 98 119 }; 99 120 100 121 ExpressionFrequenciesParameter.ActualValue = frequencies; 101 results.Add(new Result( "Instruction frequencies", frequencies));122 results.Add(new Result(RESULT_PARAMETER_NAME, frequencies)); 102 123 } 103 124 … … 110 131 111 132 var expressionFrequencies = allExpressions 112 .GroupBy(x => AggregateStackTypes 113 ? x.Attribute.StackType.ToString() 114 : x.Attribute.Name) 133 .GroupBy(x => GetGroupName(x.Attribute, AggregateStackTypes)) 115 134 .ToDictionary( 116 135 group => group.Key, … … 126 145 var row = new DataRow(pair.Key, string.Empty, Enumerable.Repeat(0.0, numberOfValues)) { 127 146 VisualProperties = { 128 StartIndexZero = true 147 StartIndexZero = true, 129 148 } 130 149 }; … … 142 161 return base.Apply(); 143 162 } 163 164 private string GetGroupName(PushExpressionAttribute attribute, bool aggregateStackTypes) { 165 if (aggregateStackTypes) { 166 return attribute.IsInExpression 167 ? IN_EXPRESSION_GROUP_NAME 168 : attribute.StackType.ToString(); 169 } 170 171 return attribute.Name; 172 } 144 173 } 145 174 } -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Attributes/PushExpressionAttriubte.cs
r15032 r15273 10 10 public readonly string Name; 11 11 public readonly string Description; 12 public readonly int? InExpressionNr; 12 13 13 14 /// <summary> … … 32 33 StackTypes additionalStackDependencies = default(StackTypes), 33 34 uint execIn = 0, 34 bool isHidden = false) { 35 bool isHidden = false, 36 int inExpressionNr = -1) { 35 37 36 38 StackType = stackType; … … 40 42 ExecIn = execIn; 41 43 IsHidden = isHidden; 44 InExpressionNr = inExpressionNr > 0 ? inExpressionNr : default(int?); 42 45 ManipulatesExec = stackType == StackTypes.Exec || AdditionalStackDependencies.HasFlag(StackTypes.Exec); 43 46 } 47 48 public bool IsInExpression { get { return this.InExpressionNr.HasValue; } } 44 49 } 45 50 } -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Configuration/IEnabledExpressionsConfiguration.cs
r15032 r15273 17 17 } 18 18 19 public interface IEnabledExpressionsConfiguration : INamedItem { 19 public interface IReadOnlyExpressionsConfiguration : INamedItem { 20 int InExpressionCount { get; } 21 22 IReadOnlyList<string> EnabledExpressions { get; } 23 IReadOnlyDictionary<StackTypes, int> ExpressionsPerStackCount { get; } 24 } 25 26 public interface IExpressionsConfiguration : IReadOnlyExpressionsConfiguration { 20 27 event EventHandler<EnabledExpressionsChangedEventArgs> EnabledExpressionsChanged; 21 28 22 IReadOnlyList<string> EnabledExpressions { get; }23 24 29 void EnableStack(StackTypes types, bool enableDependencies = false); 25 void DisableStack(StackTypes type, bool enableDepen encies = false);30 void DisableStack(StackTypes type, bool enableDependencies = false); 26 31 void SetStack(StackTypes type, bool state, bool setDependencies = false); 27 32 void EnableExpressionOfStack(StackTypes types); -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Configuration/IReadonlyPushConfiguration.cs
r15032 r15273 2 2 using System.Collections.Generic; 3 3 using Base.Erc; 4 using Common;5 6 using HeuristicLab.Core;7 4 8 5 using Stack; 9 6 10 public interface IReadOnlyPushConfiguration : IItem { 7 public interface IReadOnlyPushConfiguration : IReadOnlyExpressionsConfiguration { 8 int Seed { get; } 11 9 int EvalPushLimit { get; } 12 10 int MaxDepth { get; } -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Configuration/PushConfigurationBase.cs
r15189 r15273 12 12 13 13 [StorableClass] 14 public abstract class PushConfigurationBase : NamedItem, IE nabledExpressionsConfiguration {14 public abstract class PushConfigurationBase : NamedItem, IExpressionsConfiguration { 15 15 16 16 protected PushConfigurationBase() { … … 28 28 enabledExpressions = origin.EnabledExpressions.ToList(); 29 29 expressionsPerStackCount = origin.expressionsPerStackCount.ToDictionary(x => x.Key, x => x.Value); 30 } 30 InExpressionCount = origin.InExpressionCount; 31 Seed = origin.Seed; 32 } 33 34 [Storable] 35 public int Seed { get; set; } 36 37 [Storable] 38 public int InExpressionCount { get; private set; } 31 39 32 40 [Storable] 33 41 private readonly Dictionary<StackTypes, int> expressionsPerStackCount; 42 43 public IReadOnlyDictionary<StackTypes, int> ExpressionsPerStackCount { get { return expressionsPerStackCount; } } 34 44 35 45 public event EventHandler<EnabledExpressionsChangedEventArgs> EnabledExpressionsChanged; … … 112 122 113 123 private void EnableExpressions(IEnumerable<string> expressionNames) { 114 foreach (var expressionName in expressionNames.Except(EnabledExpressions)) 124 var addedExpressions = expressionNames as IList<string> ?? expressionNames.ToList(); 125 126 foreach (var expressionName in addedExpressions.Except(EnabledExpressions)) 115 127 EnableExpression(expressionName, false); 116 128 117 129 if (EnabledExpressionsChanged != null) { 118 EnabledExpressionsChanged(this, new EnabledExpressionsChangedEventArgs( expressionNames, new string[0]));130 EnabledExpressionsChanged(this, new EnabledExpressionsChangedEventArgs(addedExpressions, new string[0])); 119 131 } 120 132 } … … 133 145 134 146 private void DisableExpressions(IEnumerable<string> expressionNames) { 135 foreach (var expressionName in expressionNames.Intersect(EnabledExpressions)) 147 var removedExpressions = expressionNames as IList<string> ?? expressionNames.ToList(); 148 149 foreach (var expressionName in removedExpressions.Intersect(EnabledExpressions)) 136 150 DisableExpression(expressionName, false); 137 151 138 152 if (EnabledExpressionsChanged != null) { 139 EnabledExpressionsChanged(this, new EnabledExpressionsChangedEventArgs(new string[0], expressionNames));153 EnabledExpressionsChanged(this, new EnabledExpressionsChangedEventArgs(new string[0], removedExpressions)); 140 154 } 141 155 } … … 229 243 else DisableStack(type, setDependencies); 230 244 } 245 246 public void InitInExpressions(int totalInputArgumentCount) { 247 InExpressionCount = totalInputArgumentCount; 248 249 for (var i = 0; i < ExpressionTable.InExpressionTable.Count; i++) { 250 var expression = ExpressionTable.InExpressionTable[i]; 251 var expressionName = ExpressionTable.TypeToNameTable[expression.GetType()]; 252 253 DisableExpression(expressionName); 254 } 255 256 if (totalInputArgumentCount > ExpressionTable.InExpressionTable.Count) 257 throw new InvalidOperationException("More input arguments defined as InExpression types"); 258 259 for (var i = 0; i < totalInputArgumentCount; i++) { 260 var expression = ExpressionTable.InExpressionTable[i]; 261 var expressionName = ExpressionTable.TypeToNameTable[expression.GetType()]; 262 263 EnableExpression(expressionName); 264 } 265 } 231 266 } 232 267 } -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Configuration/PushConfigurationParameterCollection.cs
r15032 r15273 11 11 [StorableClass] 12 12 public class PushConfigurationParameterCollection : PushConfigurationBase, IReadOnlyPushConfiguration { 13 private const string I nstructionsParameterName= "Instructions";14 private const string I nstructionsParameterDescription= "Enables/Disables Instructions";15 private const string E valPushLimitParameterName= "EvalPushLimit";16 private const string E valPushLimitParameterDescription= "This is the maximum allowed number of \"executions\" in a single top-level call to the interpreter. The execution of a single Push instruction counts as one execution, as does the processing of a single literal, as does the descent into one layer of parentheses (that is, the processing of the \"(\" counts as one execution).";17 private const string M axPointsInProgramParameterName= "MaxProgramLength";18 private const string M axProgramLengthParameterDescription= "This is the maximum size of an item on the CODE/EXEC stack, expressed as a number of points. A point is an instruction, a literal, or a pair of parentheses.";19 private const string T opLevelPushCodeParameterName= "TopLevelPushCode";20 private const string T opLevelPushCodeParameterDescription= "When TRUE (which is the default), code passed to the top level of the interpreter will be pushed onto the CODE stack prior to execution.";21 private const string T opLevelPopCodeParameterName= "TopLevelPopCode";22 private const string T opLevelPopCodeParameterDescription= "When TRUE, the CODE stack will be popped at the end of top level calls to the interpreter. The default is FALSE.";23 private const string M axPointsInRandomInstructionParameterName= "MaxPointsInRandomInstruction";24 private const string M axPointsInRandomInstructionParameterDescription= "MaxPointsInRandomInstruction";25 private const string E rcOptionsParameterName= "ERC options";26 private const string M axStringLengthParameterName= "Max. string length";27 private const string M axDepthParameterName= "Max. program recursion";28 private const string M axParenthesesCloseParameterName= "Max. parentheses close";29 private const string M axParenthesesCloseParameterDescription= "Specifies how many sub programs are closed if open during the recursive translation of an individual to a push program. Value is exclusive.";30 private const string P arenthesesCloseBiasLevelParameterName= "Parentheses close bias level";31 private const string P arenthesesCloseBiasLevelParameterDescription= "Specifies how strong a random value between 0 .. 'Max. parentheses close' is biased towards 0. In other words, this parameter controls the length of sub programs.";32 private const string M axVectorLengthParameterName= "Max. vector length";13 private const string INSTRUCTIONS_PARAMETER_NAME = "Instructions"; 14 private const string INSTRUCTIONS_PARAMETER_DESCRIPTION = "Enables/Disables Instructions"; 15 private const string EVAL_PUSH_LIMIT_PARAMETER_NAME = "EvalPushLimit"; 16 private const string EVAL_PUSH_LIMIT_PARAMETER_DESCRIPTION = "This is the maximum allowed number of \"executions\" in a single top-level call to the interpreter. The execution of a single Push instruction counts as one execution, as does the processing of a single literal, as does the descent into one layer of parentheses (that is, the processing of the \"(\" counts as one execution)."; 17 private const string MAX_POINTS_IN_PROGRAM_PARAMETER_NAME = "MaxProgramLength"; 18 private const string MAX_PROGRAM_LENGTH_PARAMETER_DESCRIPTION = "This is the maximum size of an item on the CODE/EXEC stack, expressed as a number of points. A point is an instruction, a literal, or a pair of parentheses."; 19 private const string TOP_LEVEL_PUSH_CODE_PARAMETER_NAME = "TopLevelPushCode"; 20 private const string TOP_LEVEL_PUSH_CODE_PARAMETER_DESCRIPTION = "When TRUE (which is the default), code passed to the top level of the interpreter will be pushed onto the CODE stack prior to execution."; 21 private const string TOP_LEVEL_POP_CODE_PARAMETER_NAME = "TopLevelPopCode"; 22 private const string TOP_LEVEL_POP_CODE_PARAMETER_DESCRIPTION = "When TRUE, the CODE stack will be popped at the end of top level calls to the interpreter. The default is FALSE."; 23 private const string MAX_POINTS_IN_RANDOM_INSTRUCTION_PARAMETER_NAME = "MaxPointsInRandomInstruction"; 24 private const string MAX_POINTS_IN_RANDOM_INSTRUCTION_PARAMETER_DESCRIPTION = "MaxPointsInRandomInstruction"; 25 private const string ERC_OPTIONS_PARAMETER_NAME = "ERC options"; 26 private const string MAX_STRING_LENGTH_PARAMETER_NAME = "Max. string length"; 27 private const string MAX_DEPTH_PARAMETER_NAME = "Max. program recursion"; 28 private const string MAX_PARENTHESES_CLOSE_PARAMETER_NAME = "Max. parentheses close"; 29 private const string MAX_PARENTHESES_CLOSE_PARAMETER_DESCRIPTION = "Specifies how many sub programs are closed if open during the recursive translation of an individual to a push program. Value is exclusive."; 30 private const string PARENTHESES_CLOSE_BIAS_LEVEL_PARAMETER_NAME = "Parentheses close bias level"; 31 private const string PARENTHESES_CLOSE_BIAS_LEVEL_PARAMETER_DESCRIPTION = "Specifies how strong a random value between 0 .. 'Max. parentheses close' is biased towards 0. In other words, this parameter controls the length of sub programs."; 32 private const string MAX_VECTOR_LENGTH_PARAMETER_NAME = "Max. vector length"; 33 33 34 34 public PushConfigurationParameterCollection() { … … 62 62 63 63 private void InitParameters() { 64 if (!Parameters.ContainsKey(I nstructionsParameterName))65 Parameters.Add(new ValueParameter<IE nabledExpressionsConfiguration>(66 I nstructionsParameterName,67 I nstructionsParameterDescription,64 if (!Parameters.ContainsKey(INSTRUCTIONS_PARAMETER_NAME)) 65 Parameters.Add(new ValueParameter<IExpressionsConfiguration>( 66 INSTRUCTIONS_PARAMETER_NAME, 67 INSTRUCTIONS_PARAMETER_DESCRIPTION, 68 68 this)); 69 69 70 if (!Parameters.ContainsKey(E rcOptionsParameterName))71 Parameters.Add(new ValueParameter<ErcOptions>(E rcOptionsParameterName));72 73 if (!Parameters.ContainsKey(M axVectorLengthParameterName))74 Parameters.Add(new FixedValueParameter<IntValue>( 75 M axVectorLengthParameterName,70 if (!Parameters.ContainsKey(ERC_OPTIONS_PARAMETER_NAME)) 71 Parameters.Add(new ValueParameter<ErcOptions>(ERC_OPTIONS_PARAMETER_NAME)); 72 73 if (!Parameters.ContainsKey(MAX_VECTOR_LENGTH_PARAMETER_NAME)) 74 Parameters.Add(new FixedValueParameter<IntValue>( 75 MAX_VECTOR_LENGTH_PARAMETER_NAME, 76 76 new IntValue(500)) { Hidden = true }); 77 77 78 if (!Parameters.ContainsKey(E valPushLimitParameterName))79 Parameters.Add(new FixedValueParameter<IntValue>( 80 E valPushLimitParameterName,81 E valPushLimitParameterDescription,78 if (!Parameters.ContainsKey(EVAL_PUSH_LIMIT_PARAMETER_NAME)) 79 Parameters.Add(new FixedValueParameter<IntValue>( 80 EVAL_PUSH_LIMIT_PARAMETER_NAME, 81 EVAL_PUSH_LIMIT_PARAMETER_DESCRIPTION, 82 82 new IntValue(1000))); 83 83 84 if (!Parameters.ContainsKey(M axPointsInProgramParameterName))85 Parameters.Add(new FixedValueParameter<IntValue>( 86 M axPointsInProgramParameterName,87 M axProgramLengthParameterDescription,84 if (!Parameters.ContainsKey(MAX_POINTS_IN_PROGRAM_PARAMETER_NAME)) 85 Parameters.Add(new FixedValueParameter<IntValue>( 86 MAX_POINTS_IN_PROGRAM_PARAMETER_NAME, 87 MAX_PROGRAM_LENGTH_PARAMETER_DESCRIPTION, 88 88 new IntValue(200))); 89 89 90 if (!Parameters.ContainsKey(M axParenthesesCloseParameterName))91 Parameters.Add(new FixedValueParameter<IntValue>( 92 M axParenthesesCloseParameterName,93 M axParenthesesCloseParameterDescription,90 if (!Parameters.ContainsKey(MAX_PARENTHESES_CLOSE_PARAMETER_NAME)) 91 Parameters.Add(new FixedValueParameter<IntValue>( 92 MAX_PARENTHESES_CLOSE_PARAMETER_NAME, 93 MAX_PARENTHESES_CLOSE_PARAMETER_DESCRIPTION, 94 94 new IntValue(4)) { Hidden = true }); 95 95 96 if (!Parameters.ContainsKey(P arenthesesCloseBiasLevelParameterName))96 if (!Parameters.ContainsKey(PARENTHESES_CLOSE_BIAS_LEVEL_PARAMETER_NAME)) 97 97 Parameters.Add(new FixedValueParameter<DoubleValue>( 98 P arenthesesCloseBiasLevelParameterName,99 P arenthesesCloseBiasLevelParameterDescription,98 PARENTHESES_CLOSE_BIAS_LEVEL_PARAMETER_NAME, 99 PARENTHESES_CLOSE_BIAS_LEVEL_PARAMETER_DESCRIPTION, 100 100 new DoubleValue(4)) { Hidden = true }); 101 101 102 if (!Parameters.ContainsKey(T opLevelPushCodeParameterName))102 if (!Parameters.ContainsKey(TOP_LEVEL_PUSH_CODE_PARAMETER_NAME)) 103 103 Parameters.Add(new FixedValueParameter<BoolValue>( 104 T opLevelPushCodeParameterName,105 T opLevelPushCodeParameterDescription,104 TOP_LEVEL_PUSH_CODE_PARAMETER_NAME, 105 TOP_LEVEL_PUSH_CODE_PARAMETER_DESCRIPTION, 106 106 new BoolValue(true)) { Hidden = true }); 107 107 108 if (!Parameters.ContainsKey(T opLevelPopCodeParameterName))108 if (!Parameters.ContainsKey(TOP_LEVEL_POP_CODE_PARAMETER_NAME)) 109 109 Parameters.Add(new FixedValueParameter<BoolValue>( 110 T opLevelPopCodeParameterName,111 T opLevelPopCodeParameterDescription,110 TOP_LEVEL_POP_CODE_PARAMETER_NAME, 111 TOP_LEVEL_POP_CODE_PARAMETER_DESCRIPTION, 112 112 new BoolValue(false)) { Hidden = true }); 113 113 114 if (!Parameters.ContainsKey(M axPointsInRandomInstructionParameterName))115 Parameters.Add(new FixedValueParameter<IntValue>( 116 M axPointsInRandomInstructionParameterName,117 M axPointsInRandomInstructionParameterDescription,114 if (!Parameters.ContainsKey(MAX_POINTS_IN_RANDOM_INSTRUCTION_PARAMETER_NAME)) 115 Parameters.Add(new FixedValueParameter<IntValue>( 116 MAX_POINTS_IN_RANDOM_INSTRUCTION_PARAMETER_NAME, 117 MAX_POINTS_IN_RANDOM_INSTRUCTION_PARAMETER_DESCRIPTION, 118 118 new IntValue(50)) { Hidden = true }); 119 119 120 if (!Parameters.ContainsKey(M axStringLengthParameterName))121 Parameters.Add(new FixedValueParameter<IntValue>( 122 M axStringLengthParameterName,120 if (!Parameters.ContainsKey(MAX_STRING_LENGTH_PARAMETER_NAME)) 121 Parameters.Add(new FixedValueParameter<IntValue>( 122 MAX_STRING_LENGTH_PARAMETER_NAME, 123 123 new IntValue(1000)) { Hidden = true }); 124 124 125 if (!Parameters.ContainsKey(M axDepthParameterName))126 Parameters.Add(new FixedValueParameter<IntValue>( 127 M axDepthParameterName,125 if (!Parameters.ContainsKey(MAX_DEPTH_PARAMETER_NAME)) 126 Parameters.Add(new FixedValueParameter<IntValue>( 127 MAX_DEPTH_PARAMETER_NAME, 128 128 new IntValue(1000)) { Hidden = true }); 129 129 } 130 130 131 public IValueParameter<IE nabledExpressionsConfiguration> InstructionsParameter132 { 133 get { return (IValueParameter<IE nabledExpressionsConfiguration>)Parameters[InstructionsParameterName]; }134 } 135 136 public IE nabledExpressionsConfiguration Instructions131 public IValueParameter<IExpressionsConfiguration> InstructionsParameter 132 { 133 get { return (IValueParameter<IExpressionsConfiguration>)Parameters[INSTRUCTIONS_PARAMETER_NAME]; } 134 } 135 136 public IExpressionsConfiguration Instructions 137 137 { 138 138 get { return InstructionsParameter.Value; } … … 142 142 public IValueParameter<ErcOptions> ErcOptionsParameter 143 143 { 144 get { return (IValueParameter<ErcOptions>)Parameters[E rcOptionsParameterName]; }144 get { return (IValueParameter<ErcOptions>)Parameters[ERC_OPTIONS_PARAMETER_NAME]; } 145 145 } 146 146 … … 181 181 public IValueParameter<IntValue> EvalPushLimitParameter 182 182 { 183 get { return (IValueParameter<IntValue>)Parameters[E valPushLimitParameterName]; }183 get { return (IValueParameter<IntValue>)Parameters[EVAL_PUSH_LIMIT_PARAMETER_NAME]; } 184 184 } 185 185 … … 198 198 public IValueParameter<DoubleValue> ParenthesesCloseBiasLevelParameter 199 199 { 200 get { return (IValueParameter<DoubleValue>)Parameters[P arenthesesCloseBiasLevelParameterName]; }200 get { return (IValueParameter<DoubleValue>)Parameters[PARENTHESES_CLOSE_BIAS_LEVEL_PARAMETER_NAME]; } 201 201 } 202 202 … … 212 212 public IValueParameter<IntValue> MaxParenthesesCloseParameter 213 213 { 214 get { return (IValueParameter<IntValue>)Parameters[M axParenthesesCloseParameterName]; }214 get { return (IValueParameter<IntValue>)Parameters[MAX_PARENTHESES_CLOSE_PARAMETER_NAME]; } 215 215 } 216 216 … … 229 229 public IValueParameter<IntValue> MaxDepthParameter 230 230 { 231 get { return (IValueParameter<IntValue>)Parameters[M axDepthParameterName]; }231 get { return (IValueParameter<IntValue>)Parameters[MAX_DEPTH_PARAMETER_NAME]; } 232 232 } 233 233 … … 249 249 public IValueParameter<IntValue> MaxPointsInProgramParameter 250 250 { 251 get { return (IValueParameter<IntValue>)Parameters[M axPointsInProgramParameterName]; }251 get { return (IValueParameter<IntValue>)Parameters[MAX_POINTS_IN_PROGRAM_PARAMETER_NAME]; } 252 252 } 253 253 … … 263 263 public IValueParameter<IntValue> MaxVectorLengthParameter 264 264 { 265 get { return (IValueParameter<IntValue>)Parameters[M axVectorLengthParameterName]; }265 get { return (IValueParameter<IntValue>)Parameters[MAX_VECTOR_LENGTH_PARAMETER_NAME]; } 266 266 } 267 267 … … 277 277 public IValueParameter<IntValue> MaxPointsInRandomExpressionParameter 278 278 { 279 get { return (IValueParameter<IntValue>)Parameters[M axPointsInRandomInstructionParameterName]; }279 get { return (IValueParameter<IntValue>)Parameters[MAX_POINTS_IN_RANDOM_INSTRUCTION_PARAMETER_NAME]; } 280 280 } 281 281 … … 295 295 public IValueParameter<BoolValue> TopLevelPushCodeParameter 296 296 { 297 get { return (IValueParameter<BoolValue>)Parameters[T opLevelPushCodeParameterName]; }297 get { return (IValueParameter<BoolValue>)Parameters[TOP_LEVEL_PUSH_CODE_PARAMETER_NAME]; } 298 298 } 299 299 … … 312 312 public IValueParameter<BoolValue> TopLevelPopCodeParameter 313 313 { 314 get { return (IValueParameter<BoolValue>)Parameters[T opLevelPopCodeParameterName]; }314 get { return (IValueParameter<BoolValue>)Parameters[TOP_LEVEL_POP_CODE_PARAMETER_NAME]; } 315 315 } 316 316 … … 326 326 public IValueParameter<IntValue> MaxStringLengthParameter 327 327 { 328 get { return (IValueParameter<IntValue>)Parameters[M axStringLengthParameterName]; }328 get { return (IValueParameter<IntValue>)Parameters[MAX_STRING_LENGTH_PARAMETER_NAME]; } 329 329 } 330 330 -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/ExpressionTable.cs
r15189 r15273 20 20 private static readonly Dictionary<StackTypes, IList<string>> stackDependencyToNamesTable = new Dictionary<StackTypes, IList<string>>(); 21 21 private static readonly Dictionary<Type, PushExpressionAttribute> typeToAttributeTable = new Dictionary<Type, PushExpressionAttribute>(); 22 private static readonly List<Expression> inExpressionTable = new List<Expression>(); 22 23 23 24 public static readonly IReadOnlyList<Type> StatelessExpressionTypes; … … 43 44 public static IReadOnlyDictionary<Type, string> TypeToNameTable { get { return typeToNameTable; } } 44 45 public static IReadOnlyDictionary<string, Type> NameToTypeTable { get { return nameToTypeTable; } } 46 public static IReadOnlyList<Expression> InExpressionTable { get { return inExpressionTable; } } 45 47 public static IReadOnlyDictionary<StackTypes, IList<string>> StackTypeToNamesTable { get { return stackTypeToNamesTable; } } 46 48 public static IReadOnlyDictionary<StackTypes, IList<string>> StackDependencyToNamesTable { get { return stackDependencyToNamesTable; } } … … 57 59 dictionary.Add(type, expression); 58 60 59 //// do not index hidden expressions like push expression in tables60 //if (attribute.IsHidden) continue;61 62 61 indexToNameTable.Add(indexToNameTable.Keys.Count, attribute.Name); 63 62 typeToNameTable.Add(type, attribute.Name); 64 63 nameToTypeTable.Add(attribute.Name, type); 64 65 if (attribute.IsInExpression) { 66 // ReSharper disable once AssignNullToNotNullAttribute 67 // ReSharper disable once PossibleInvalidOperationException 68 inExpressionTable.Insert(attribute.InExpressionNr.Value - 1, expression); 69 } 65 70 66 71 if (!stackTypeToNamesTable.ContainsKey(attribute.StackType)) { -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/InExpressions.cs
r15189 r15273 13 13 14 14 protected InExpression(int nr) { 15 this.index = nr - 1;15 index = nr - 1; 16 16 } 17 17 … … 20 20 21 21 public override bool IsNoop(IInternalPushInterpreter interpreter) { 22 return false; 22 var expression = interpreter.InputExpressions[index]; 23 24 return expression.IsNoop(interpreter); 23 25 } 24 26 25 27 public override void Eval(IInternalPushInterpreter interpreter) { 26 var inputArgument= interpreter.InputExpressions[index];28 var expression = interpreter.InputExpressions[index]; 27 29 28 inputArgument.Eval(interpreter);30 expression.Eval(interpreter); 29 31 } 30 32 } … … 34 36 "IN1", 35 37 "Pushes first input parameter.", 36 isHidden: true)] 38 isHidden: true, 39 inExpressionNr: 1)] 37 40 [StorableClass] 38 41 public class In1Expression : InExpression { … … 47 50 "IN2", 48 51 "Pushes second input parameter.", 49 isHidden: true)] 52 isHidden: true, 53 inExpressionNr: 2)] 50 54 [StorableClass] 51 55 public class In2Expression : InExpression { … … 60 64 "IN3", 61 65 "Pushes third input parameter.", 62 isHidden: true)] 66 isHidden: true, 67 inExpressionNr: 3)] 63 68 [StorableClass] 64 69 public class In3Expression : InExpression { … … 73 78 "IN4", 74 79 "Pushes fourth input parameter.", 75 isHidden: true)] 80 isHidden: true, 81 inExpressionNr: 4)] 76 82 [StorableClass] 77 83 public class In4Expression : InExpression { … … 86 92 "IN5", 87 93 "Pushes fifth input parameter.", 88 isHidden: true)] 94 isHidden: true, 95 inExpressionNr: 5)] 89 96 [StorableClass] 90 97 public class In5Expression : InExpression { … … 99 106 "IN6", 100 107 "Pushes sixth input parameter.", 101 isHidden: true)] 108 isHidden: true, 109 inExpressionNr: 6)] 102 110 [StorableClass] 103 111 public class In6Expression : InExpression { … … 112 120 "IN7", 113 121 "Pushes seventh input parameter.", 114 isHidden: true)] 122 isHidden: true, 123 inExpressionNr: 7)] 115 124 [StorableClass] 116 125 public class In7Expression : InExpression { … … 125 134 "IN8", 126 135 "Pushes eighth input parameter.", 127 isHidden: true)] 136 isHidden: true, 137 inExpressionNr: 8)] 128 138 [StorableClass] 129 139 public class In8Expression : InExpression { … … 138 148 "IN9", 139 149 "Pushes nineth input parameter.", 140 isHidden: true)] 150 isHidden: true, 151 inExpressionNr: 9)] 141 152 [StorableClass] 142 153 public class In9Expression : InExpression { … … 151 162 "IN10", 152 163 "Pushes tenth input parameter.", 153 isHidden: true)] 164 isHidden: true, 165 inExpressionNr: 10)] 154 166 [StorableClass] 155 167 public class In10Expression : InExpression { -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Generators/CodeGenerator/CodeGeneratorUtils.cs
r15189 r15273 7 7 8 8 using HeuristicLab.Problems.ProgramSynthesis.Base.Erc; 9 using HeuristicLab.Problems.ProgramSynthesis.Base.Extensions; 10 using HeuristicLab.Problems.ProgramSynthesis.Push.Configuration; 11 using HeuristicLab.Problems.ProgramSynthesis.Push.SolutionCreator; 9 12 10 13 using Stack; 11 14 12 15 internal static class CodeGeneratorUtils { 13 internal static Expression CreateExpressionOrErc( 16 private static readonly Expression Noop = ExpressionTable.GetStatelessExpression<ExecNoopExpression>(); 17 18 internal static Expression MapToExpression( 14 19 IRandom random, 15 IReadOnlyList<string> enabledExpressions,16 20 IReadOnlyErcOptions ercOptions, 21 IReadOnlyExpressionsConfiguration config, 17 22 IDictionary<string, Expression> customExpressions = null) { 18 23 var customCount = customExpressions == null ? 0 : customExpressions.Count; 19 var index = random.Next(enabledExpressions.Count + customCount); 24 var enabledExpressionCount = config.EnabledExpressions.Count; 25 var index = random.Next(enabledExpressionCount + customCount); 20 26 21 return index >= enabledExpressions.Count22 ? customExpressions.Values.ElementAt(index - enabledExpression s.Count)23 : CreateExpressionOrErc(index, random, enabledExpressions, ercOptions);27 return index >= config.EnabledExpressions.Count 28 ? customExpressions.Values.ElementAt(index - enabledExpressionCount) 29 : MapToExpression(index, random, ercOptions, config); 24 30 } 25 31 26 internal static Expression CreateExpressionOrErc(32 internal static Expression MapToExpression( 27 33 int index, 28 34 IRandom random, 29 IReadOnlyList<string> enabledExpressions, 30 IReadOnlyErcOptions ercOptions) { 31 var name = enabledExpressions[index]; 35 IReadOnlyErcOptions ercOptions, 36 IReadOnlyExpressionsConfiguration config) { 32 37 33 return CreateExpressionOrErc(name, random, ercOptions); 38 switch (index) { 39 case PushSolutionEncoding.Noop: 40 return Noop; 41 42 case PushSolutionEncoding.Erc: 43 var stackType = config.ExpressionsPerStackCount.RandomWeightedOrDefault(random, pair => pair.Value).Key; 44 45 if (stackType == default(StackTypes)) 46 break; 47 48 return CreateRandomErcExpression(stackType, random, ercOptions); 49 50 case PushSolutionEncoding.In: 51 if (config.InExpressionCount == 0) break; 52 53 var nr = random.Next(0, config.InExpressionCount) + 1; 54 return ExpressionTable.InExpressionTable[nr]; 55 } 56 57 var name = config.EnabledExpressions[index]; 58 return ExpressionTable.GetExpression(name); 34 59 } 35 60 36 private static Expression CreateExpressionOrErc(37 string expressionName,38 IRandom random,39 IReadOnlyErcOptions ercOptions) {40 //var x = random.NextDouble();41 //Expression expression = null;61 //private static Expression CreateExpressionOrErc( 62 // string expressionName, 63 // IRandom random, 64 // IReadOnlyErcOptions ercOptions) { 65 // var x = random.NextDouble(); 66 // Expression expression = null; 42 67 43 //if (x < ercOptions.ErcProbability) {44 //var expressionType = ExpressionTable.NameToTypeTable[expressionName];45 //expression = CreateRandomErcExpression(46 //ExpressionTable.TypeToAttributeTable[expressionType].StackType,47 //random,48 //ercOptions);49 //}68 // if (x < ercOptions.ErcProbability) { 69 // var expressionType = ExpressionTable.NameToTypeTable[expressionName]; 70 // expression = CreateRandomErcExpression( 71 // ExpressionTable.TypeToAttributeTable[expressionType].StackType, 72 // random, 73 // ercOptions); 74 // } 50 75 51 //if (expression == null || expression is ExecNoopExpression) {52 //expression = ExpressionTable.GetExpression(expressionName);53 //}76 // if (expression == null || expression is ExecNoopExpression) { 77 // expression = ExpressionTable.GetExpression(expressionName); 78 // } 54 79 55 //return expression; 80 // return expression; 81 //} 56 82 57 var expression = ExpressionTable.GetExpression(expressionName);58 59 return expression;60 }61 62 private static readonly Expression Noop = ExpressionTable.GetStatelessExpression<ExecNoopExpression>();63 83 /// <summary> 64 84 /// Create a ErcExpression whereby the type of the expression conforms to the passed stack type. -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Generators/CodeGenerator/LinearCodeGenerator.cs
r14834 r15273 31 31 IManagedPool<PooledList<Expression>> expressionListPool = null, 32 32 IRandom random = null, 33 IReadOnlyPushConfiguration pushConfiguration= null,33 IReadOnlyPushConfiguration config = null, 34 34 IDictionary<string, Expression> customExpressions = null) { 35 35 if (maxPoints == 0) 36 36 return new Expression[0]; 37 37 38 random = random ?? new FastRandom();39 pushConfiguration = pushConfiguration?? new PushConfiguration();38 random = random ?? new MersenneTwister(); 39 config = config ?? new PushConfiguration(); 40 40 41 41 var size = maxPoints <= 1 ? 1 : random.Next(1, maxPoints); … … 43 43 44 44 for (var i = 0; i < size; i++) { 45 var expression = CodeGeneratorUtils. CreateExpressionOrErc(45 var expression = CodeGeneratorUtils.MapToExpression( 46 46 random, 47 pushConfiguration.EnabledExpressions,48 pushConfiguration.ErcOptions,47 config.ErcOptions, 48 config, 49 49 customExpressions); 50 50 -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Generators/CodeGenerator/RecursiveCodeGenerator.cs
r15189 r15273 49 49 private static IEnumerable<Expression> RandomCodeWithSize(int points, IRandom random, IReadOnlyPushConfiguration pushConfiguration, IDictionary<string, Expression> customExpressions = null) { 50 50 if (points == 1) { 51 return new[] { CodeGeneratorUtils. CreateExpressionOrErc(51 return new[] { CodeGeneratorUtils.MapToExpression( 52 52 random, 53 pushConfiguration.EnabledExpressions,54 53 pushConfiguration.ErcOptions, 54 pushConfiguration, 55 55 customExpressions) 56 56 }; -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Individual/IndividualExtensions.cs
r15189 r15273 6 6 using HeuristicLab.Optimization; 7 7 using HeuristicLab.Problems.ProgramSynthesis.Push.Configuration; 8 using HeuristicLab.Problems.ProgramSynthesis.Push.Data.Pool;9 8 using HeuristicLab.Problems.ProgramSynthesis.Push.Expressions; 10 9 using HeuristicLab.Problems.ProgramSynthesis.Push.Generators.CodeGenerator; 11 using HeuristicLab. Random;10 using HeuristicLab.Problems.ProgramSynthesis.Push.SolutionCreator; 12 11 13 12 public static class IndividualExtensions { 14 public static PushProgram ToPushProgram(this Individual individual, IReadOnlyPushConfiguration config, ObjectPool<IRandom> randomPool) {15 return individual.IntegerVector().ToPushProgram(config, randomPool);16 }17 18 public static PushProgram ToPushProgram(this Individual individual, IReadOnlyPushConfiguration config) {19 return individual.IntegerVector().ToPushProgram(config);20 }21 13 22 14 public static PushProgram ToPushProgram(this Individual individual, IReadOnlyPushConfiguration config, IRandom random) { 23 15 return individual.IntegerVector().ToPushProgram(config, random); 24 }25 26 public static PushProgram ToPushProgram(this IntegerVector vector, IReadOnlyPushConfiguration config, ObjectPool<IRandom> randomPool) {27 var random = randomPool.Allocate();28 var seed = vector.GetSeed();29 30 random.Reset(seed);31 var program = vector.ToPushProgram(config, random);32 randomPool.Free(random);33 34 return program;35 }36 37 public static PushProgram ToPushProgram(this IntegerVector vector, IReadOnlyPushConfiguration config) {38 var seed = (uint)vector.GetSeed();39 return vector.ToPushProgram(config, new MersenneTwister(seed));40 }41 42 public static int GetSeed(this IntegerVector vector) {43 var seed = 17;44 for (var i = 0; i < vector.Length; i++)45 seed = seed * 23 + vector[i];46 return seed;47 16 } 48 17 … … 53 22 54 23 for (var i = vector.Length - 1; i >= 0; i--) { 55 var expression = CodeGeneratorUtils.CreateExpressionOrErc( 56 vector[i], 24 var index = vector[i]; 25 26 if (index == PushSolutionEncoding.End) 27 break; 28 29 // skip noops 30 if (index == PushSolutionEncoding.Noop) 31 continue; 32 33 var expression = CodeGeneratorUtils.MapToExpression( 34 index, 57 35 random, 58 config.E nabledExpressions,59 config .ErcOptions);36 config.ErcOptions, 37 config); 60 38 61 39 expressions.Add(expression); -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Individual/InduvidualMapper.cs
r15189 r15273 39 39 40 40 for (; currentIndex < vector.Length; currentIndex++) { 41 var expression = CodeGeneratorUtils. CreateExpressionOrErc(41 var expression = CodeGeneratorUtils.MapToExpression( 42 42 vector[currentIndex] % config.EnabledExpressions.Count, 43 43 random, 44 config.E nabledExpressions,45 config .ErcOptions);44 config.ErcOptions, 45 config); 46 46 47 47 var expressionType = expression.GetType(); -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Interpreter/Extensions.cs
r15189 r15273 8 8 9 9 using Attributes; 10 11 using HeuristicLab.BenchmarkSuite; 10 12 11 13 using Stack; … … 60 62 } 61 63 } 64 65 public static void InitExample(this IPushInterpreter interpreter, Example example) { 66 interpreter.BooleanStack.Push(example.InputBoolean); 67 interpreter.IntegerStack.Push(example.InputInteger); 68 interpreter.FloatStack.Push(example.InputFloat); 69 interpreter.CharStack.Push(example.InputChar); 70 interpreter.StringStack.Push(example.InputString); 71 interpreter.StringVectorStack.Push(example.InputStringVector); 72 interpreter.IntegerVectorStack.Push(example.InputIntegerVector); 73 interpreter.FloatVectorStack.Push(example.InputFloatVector); 74 75 interpreter.SetInput( 76 integers: example.InputInteger, 77 floats: example.InputFloat, 78 booleans: example.InputBoolean, 79 chars: example.InputChar, 80 strings: example.InputString, 81 integerVectors: example.InputIntegerVector, 82 floatVectors: example.InputFloatVector, 83 stringVectors: example.InputStringVector); 84 } 62 85 } 63 86 } -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Interpreter/IPushInterpreter.cs
r15189 r15273 11 11 12 12 public interface IPushInterpreter { 13 IRandom Random { get; set;}13 IRandom Random { get; } 14 14 IPushStack<Expression> CodeStack { get; } 15 15 IPushStack<Expression> ExecStack { get; } … … 28 28 IReadOnlyDictionary<StackTypes, IPushStack> Stacks { get; } 29 29 IReadOnlyPushConfiguration Configuration { get; } 30 void Clear ();31 void Reset( );30 void ClearStacks(); 31 void Reset(IRandom random = null); 32 32 33 33 void SetInput( -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Interpreter/PooledPushInterpreter.cs
r15032 r15273 15 15 public override void Dispose() { 16 16 base.Dispose(); 17 Clear ();17 ClearStacks(); 18 18 pool.Free(this); 19 19 } -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Interpreter/PushInterpreter.cs
r15189 r15273 19 19 private Expression currentProgram; 20 20 21 /// <summary> 22 /// An interpreter for Push 23 /// </summary> 24 /// <param name="config">Determines the runtime behavior of the interpreter</param> 25 /// <param name="random">Note that random may be reseted</param> 26 /// <param name="poolContainer">Used to save resources used by the interpreter</param> 21 27 public PushInterpreter(IReadOnlyPushConfiguration config = null, IRandom random = null, InterpreterPoolContainer poolContainer = null) { 22 Random = random ?? new MersenneTwister(); 28 randomOrigin = random ?? new MersenneTwister(); 29 Random = (IRandom)randomOrigin.Clone(); 23 30 Configuration = config ?? new PushConfiguration(); 24 31 … … 69 76 public IReadOnlyDictionary<StackTypes, IPushStack> Stacks { get; private set; } 70 77 71 public IRandom Random { get; set; } 78 private IRandom randomOrigin; 79 public IRandom Random { get; private set; } 72 80 73 81 public long ExecCounter { get; private set; } … … 330 338 331 339 /// <summary> 332 /// Reset while interpreter340 /// Reset interpreter which clears and reconfigures stacks and local variables 333 341 /// </summary> 334 public void Reset() { 342 public void Reset(IRandom random = null) { 343 if (random != null) 344 randomOrigin = random; 345 346 // Reset Random 347 Random = (IRandom)randomOrigin.Clone(); 348 335 349 ExecCounter = 0; 336 350 IsAborted = false; … … 340 354 341 355 inputExpressions.Clear(); 342 Clear ();356 ClearStacks(); 343 357 ConfigureStacks(); 344 358 } … … 357 371 /// Clears Stacks and custom expressions 358 372 /// </summary> 359 public void Clear () {373 public void ClearStacks() { 360 374 for (var i = 0u; i < supportedStackTypes.Length; i++) { 361 375 var key = supportedStackTypes[i]; -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Interpreter/PushInterpreterPool.cs
r15189 r15273 5 5 using HeuristicLab.Problems.ProgramSynthesis.Push.Data.Pool; 6 6 using HeuristicLab.Problems.ProgramSynthesis.Push.Expressions; 7 using HeuristicLab.Random;8 7 9 8 public class PushInterpreterPool { … … 33 32 public PooledPushInterpreter Create(IRandom random = null) { 34 33 var interpreter = pool.Allocate(); 35 interpreter.Random = random ?? new MersenneTwister(); 36 interpreter.Reset(); 34 interpreter.Reset(random); 37 35 38 36 return interpreter; … … 40 38 41 39 public void Free(PooledPushInterpreter interpreter) { 42 interpreter. Random = null;40 interpreter.ClearStacks(); 43 41 pool.Free(interpreter); 44 42 } -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Problem/BenchmarkSuite/BenchmarkSuitePushSolutionView.cs
r15189 r15273 53 53 var example = Evaluator.Data.Examples[exampleComboBox.SelectedIndex]; 54 54 55 interpreter.SetInput( 56 integers: example.InputInteger, 57 floats: example.InputFloat, 58 booleans: example.InputBoolean, 59 chars: example.InputChar, 60 strings: example.InputString, 61 integerVectors: example.InputIntegerVector, 62 floatVectors: example.InputFloatVector, 63 stringVectors: example.InputStringVector); 64 65 //interpreter.BooleanStack.Push(example.InputBoolean); 66 //interpreter.IntegerStack.Push(example.InputInteger); 67 //interpreter.FloatStack.Push(example.InputFloat); 68 //interpreter.CharStack.Push(example.InputChar); 69 //interpreter.StringStack.Push(example.InputString); 70 //interpreter.IntegerVectorStack.Push(example.InputIntegerVector.Select(x => x.ToList()).ToList()); 71 //interpreter.FloatVectorStack.Push(example.InputFloatVector.Select(x => x.ToList()).ToList()); 72 //interpreter.StringVectorStack.Push(example.InputStringVector.Select(x => x.ToList()).ToList()); 73 //interpreter.BooleanVectorStack.Push(example.InputBooleanVector.Select(x => x.ToList()).ToList()); 55 interpreter.InitExample(example); 74 56 } 75 57 … … 92 74 } 93 75 76 94 77 protected override void OnContentChanged() { 95 78 if (Content == null) return; … … 104 87 } 105 88 106 interpreter = pool.Create(Content.Random); 89 var random = Content.GetRandom(); 90 interpreter = pool.Create(random); 107 91 UpdateExamples(Evaluator.Data); 108 92 … … 181 165 grid.Columns.Add(relativeDiffColumn); 182 166 183 using (var pushInterpreter = pool.Create(Content.Random)) { 167 var random = Content.GetRandom(); 168 using (var pushInterpreter = pool.Create(random)) { 184 169 var rowIndex = 1; 185 170 for (var i = start; i < end; i++, rowIndex++) { -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Problem/BenchmarkSuite/PushBenchmarkSuiteEvaluator.cs
r15189 r15273 131 131 var example = Data.Examples[exampleIndex]; 132 132 133 //interpreter.BooleanStack.Push(example.InputBoolean); 134 //interpreter.IntegerStack.Push(example.InputInteger); 135 //interpreter.FloatStack.Push(example.InputFloat); 136 //interpreter.CharStack.Push(example.InputChar); 137 //interpreter.StringStack.Push(example.InputString); 138 //interpreter.StringVectorStack.Push(example.InputStringVector); 139 //interpreter.IntegerVectorStack.Push(example.InputIntegerVector); 140 //interpreter.FloatVectorStack.Push(example.InputFloatVector); 141 142 interpreter.SetInput( 143 integers: example.InputInteger, 144 floats: example.InputFloat, 145 booleans: example.InputBoolean, 146 chars: example.InputChar, 147 strings: example.InputString, 148 integerVectors: example.InputIntegerVector, 149 floatVectors: example.InputFloatVector, 150 stringVectors: example.InputStringVector); 151 133 interpreter.InitExample(example); 152 134 interpreter.Run(program); 153 135 -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Problem/BenchmarkSuite/PushBenchmarkSuiteProblem.cs
r15189 r15273 8 8 using HeuristicLab.BenchmarkSuite.Problems; 9 9 using HeuristicLab.Problems.ProgramSynthesis.Push.Expressions; 10 using HeuristicLab.Problems.ProgramSynthesis.Push.Extensions;11 10 12 11 using Instances; … … 49 48 Description = data.Description; 50 49 BestKnownQuality = data.BestResult; 51 config.MaxPointsInProgram = data.MaxSize;52 config.EvalPushLimit = data.EvalLimit;53 config.ErcOptions = data.ErcOptions;54 config.FloatStringFormat = data.FloatStringFormat;50 Config.MaxPointsInProgram = data.MaxSize; 51 Config.EvalPushLimit = data.EvalLimit; 52 Config.ErcOptions = data.ErcOptions; 53 Config.FloatStringFormat = data.FloatStringFormat; 55 54 56 config.SetEnabledStacks((StackTypes)data.EnabledDataTypes);57 data.InitInExpressions(config);55 Config.SetEnabledStacks((StackTypes)data.EnabledDataTypes); 56 Config.InitInExpressions(data.TotalInputArgumentCount); 58 57 59 58 Encoding.Bounds[0, 0] = 0; 60 Encoding.Bounds[0, 1] = config.EnabledExpressions.Count;59 Encoding.Bounds[0, 1] = Config.EnabledExpressions.Count; 61 60 62 InitProgramLength = data.MaxSize / 2;61 Encoding.Length = data.MaxSize; 63 62 } 64 63 … … 67 66 double bestQuality, 68 67 IRandom random, 69 IReadOnlyPushConfiguration config, 70 IPushEvaluator evaluator) { 71 return new PushBenchmarkSuiteSolution(program, bestQuality, random, (IReadOnlyPushConfiguration)config.Clone(), (PushBenchmarkSuiteEvaluator)PushEvaluator.Clone()); 68 IReadOnlyPushConfiguration config) { 69 return new PushBenchmarkSuiteSolution(program, bestQuality, random, config, (PushBenchmarkSuiteEvaluator)PushEvaluator.Clone()); 72 70 } 73 71 } -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Problem/PushProblem.cs
r15189 r15273 7 7 using Configuration; 8 8 using Core; 9 using Data.Pool;10 9 using HeuristicLab.Data; 11 10 using HeuristicLab.Encodings.IntegerVectorEncoding; … … 13 12 using HeuristicLab.Problems.ProgramSynthesis.Push.Expressions; 14 13 using HeuristicLab.Problems.ProgramSynthesis.Push.Individual; 15 using HeuristicLab.Problems.ProgramSynthesis.Push.Problem.BenchmarkSuite; 14 using HeuristicLab.Problems.ProgramSynthesis.Push.ObjectPools.Random; 15 using HeuristicLab.Problems.ProgramSynthesis.Push.SolutionCreator; 16 16 17 17 using Interpreter; … … 19 19 using Parameters; 20 20 using Persistence.Default.CompositeSerializers.Storable; 21 using Random;22 21 23 22 [StorableClass] 24 23 public abstract class PushProblem : SingleObjectiveBasicProblem<IntegerVectorEncoding> { 25 24 [Storable] 26 protected readonly PushConfigurationParameterCollection config; 27 protected PushInterpreterPool pool; 28 protected readonly ObjectPool<IRandom> randomPool = new ObjectPool<IRandom>(() => new MersenneTwister(), Environment.ProcessorCount * 4); 25 protected readonly PushConfigurationParameterCollection Config; 26 27 protected PushInterpreterPool Pool; 28 protected readonly SeededRandomPool RandomPool = new SeededRandomPool(); 29 29 30 30 [Storable] 31 31 protected readonly IPushEvaluator PushEvaluator; 32 32 33 private const string B estTrainingSolutionResultName= "Best Solution";34 private const string T estQualityResultName= "Test Quality";35 36 protected PushProblem( PushBenchmarkSuiteEvaluator evaluator) {37 config = new PushConfigurationParameterCollection();33 private const string BEST_TRAINING_SOLUTION_RESULT_NAME = "Best Solution"; 34 private const string TEST_QUALITY_RESULT_NAME = "Test Quality"; 35 36 protected PushProblem(IPushEvaluator evaluator) { 37 Config = new PushConfigurationParameterCollection(); 38 38 PushEvaluator = evaluator; 39 39 … … 52 52 protected PushProblem(PushProblem original, Cloner cloner) 53 53 : base(original, cloner) { 54 config = cloner.Clone(original.config);54 Config = cloner.Clone(original.Config); 55 55 PushEvaluator = cloner.Clone(original.PushEvaluator); 56 56 … … 68 68 69 69 private void InitData() { 70 pool = new PushInterpreterPool(Environment.ProcessorCount * 2, 4096, 1024, config);70 Pool = new PushInterpreterPool(Environment.ProcessorCount * 2, 4096, 1024, Config); 71 71 } 72 72 73 73 private void InitEvents() { 74 config.EnabledExpressionsChanged += EnabledExpressionsChanged; 74 Config.EnabledExpressionsChanged += EnabledExpressionsChanged; 75 Reset += PushProblemReset; 75 76 } 76 77 77 78 private void EnabledExpressionsChanged(object sender, EnabledExpressionsChangedEventArgs e) { 78 Encoding.Bounds[0, 1] = config.EnabledExpressions.Count; 79 Encoding.BoundsParameter.Value[0, 1] = config.EnabledExpressions.Count; 80 } 81 82 public ILookupParameter<IntValue> SeedParamater 83 { 84 get { return (ILookupParameter<IntValue>)Parameters["Seed"]; } 85 } 86 87 #region Parameters 88 private const string InitProgramLengthParameterName = "InitProgramLength"; 89 private const string InitProgramLengthParameterDescription = "This is the initial size of a push program."; 90 private const string PushConfigurationParameterName = "PushConfiguration"; 79 Encoding.Bounds[0, 1] = Config.EnabledExpressions.Count; 80 Encoding.BoundsParameter.Value[0, 1] = Config.EnabledExpressions.Count; 81 } 82 83 private const string PUSH_CONFIGURATION_PARAMETER_NAME = "PushConfiguration"; 91 84 92 85 public const string CasesScopeParameterName = "CaseQualities"; … … 94 87 95 88 private void InitParameters() { 96 foreach (var paramater in config.Parameters) {89 foreach (var paramater in Config.Parameters) { 97 90 if (!Parameters.ContainsKey(paramater.Name)) { 98 91 Parameters.Add(paramater); … … 100 93 } 101 94 102 if (!Parameters.ContainsKey(P ushConfigurationParameterName))103 Parameters.Add(new ValueParameter<IReadOnlyPushConfiguration>(P ushConfigurationParameterName, config) {95 if (!Parameters.ContainsKey(PUSH_CONFIGURATION_PARAMETER_NAME)) 96 Parameters.Add(new ValueParameter<IReadOnlyPushConfiguration>(PUSH_CONFIGURATION_PARAMETER_NAME, Config) { 104 97 Hidden = true 105 98 }); 106 99 107 if (!Parameters.ContainsKey(InitProgramLengthParameterName)) {108 Parameters.Add(new FixedValueParameter<IntValue>(109 InitProgramLengthParameterName,110 InitProgramLengthParameterDescription,111 new IntValue(50)));112 }113 114 Encoding.LengthParameter = InitProgramLengthParameter as IFixedValueParameter<IntValue>;115 116 100 if (!Parameters.ContainsKey(CasesScopeParameterName)) 117 101 Parameters.Add(new LookupParameter<BoolArray>(CasesScopeParameterName, "The training cases that have been successfully executed.")); … … 121 105 } 122 106 107 private void PushProblemReset(object sender, EventArgs e) { 108 // clear pools and free reserved memory 109 Pool.Clear(); 110 IndividualMapper.Clear(); 111 RandomPool.Clear(); 112 113 // reset seed 114 Config.Seed = 0; 115 } 116 123 117 protected override void OnReset() { 124 118 base.OnReset(); 125 119 126 120 // clear pools and free reserved memory 127 pool.Clear();121 Pool.Clear(); 128 122 IndividualMapper.Clear(); 123 RandomPool.Clear(); 124 Config.Seed = 0; 129 125 } 130 126 131 127 private void InitEncoding() { 132 128 Encoding.Bounds[0, 0] = 0; 133 Encoding.Bounds[0, 1] = config.EnabledExpressions.Count;134 Encoding.Length = config.MaxPointsInProgram;129 Encoding.Bounds[0, 1] = Config.EnabledExpressions.Count; 130 Encoding.Length = Config.MaxPointsInProgram; 135 131 } 136 132 137 133 private void InitOperators() { 138 Operators.Add(new PushExpressionFrequencyAnalyzer()); 139 } 140 141 /// <summary> 142 /// This is the inital size of an push program generated by a solution creator 143 /// </summary> 144 public IValueParameter<IntValue> InitProgramLengthParameter 145 { 146 get { return (IValueParameter<IntValue>)Parameters[InitProgramLengthParameterName]; } 147 } 148 149 public int InitProgramLength 150 { 151 get { return InitProgramLengthParameter.Value.Value; } 152 set 153 { 154 InitProgramLengthParameter.Value.Value = value; 155 } 156 } 157 #endregion 134 135 var solutionCreator = Operators.OfType<PushSolutionCreator>().FirstOrDefault(); 136 137 if (solutionCreator == null) { 138 solutionCreator = new PushSolutionCreator(); 139 Operators.Add(solutionCreator); 140 } 141 142 solutionCreator.ErcOptions = Config.ErcOptions; 143 144 if (!Operators.OfType<PushExpressionFrequencyAnalyzer>().Any()) { 145 Operators.Add(new PushExpressionFrequencyAnalyzer()); 146 } 147 148 SolutionCreator = solutionCreator; 149 } 158 150 159 151 public override bool Maximization { get { return false; } } … … 165 157 var bestIdx = Array.IndexOf(qualities, bestQuality); 166 158 var vector = individuals[bestIdx].IntegerVector(); 167 var seed = vector.GetSeed(); 168 var rand = randomPool.Allocate(); 169 rand.Reset(seed); 170 171 var program = (PushProgram)vector.ToPushProgram(config, rand).Clone(); 159 160 var rand = RandomPool.ResetAndAllocate(); 161 var program = (PushProgram)vector.ToPushProgram(Config, rand).Clone(); 162 RandomPool.Free(rand); 163 164 rand = RandomPool.ResetAndAllocate(); 172 165 var isIndividualBetter = AnalyzeBestTrainingSolution(program, bestQuality, results, rand); 166 RandomPool.Free(rand); 173 167 174 168 if (isIndividualBetter) { 175 rand .Reset(seed);169 rand = RandomPool.ResetAndAllocate(); 176 170 AnalyzeBestTestSolution(program, results, rand); 177 } 178 179 randomPool.Free(rand); 171 RandomPool.Free(rand); 172 } 180 173 } 181 174 182 175 private void AnalyzeBestTestSolution(PushProgram program, ResultCollection results, IRandom random) { 183 var testResult = PushEvaluator.EvaluateTraining( pool, program, random);184 185 if (!results.ContainsKey(T estQualityResultName)) {186 results.Add(new Result(T estQualityResultName, new DoubleValue(testResult.AvgQuality)));176 var testResult = PushEvaluator.EvaluateTraining(Pool, program, random); 177 178 if (!results.ContainsKey(TEST_QUALITY_RESULT_NAME)) { 179 results.Add(new Result(TEST_QUALITY_RESULT_NAME, new DoubleValue(testResult.AvgQuality))); 187 180 } else { 188 ((DoubleValue)results[T estQualityResultName].Value).Value = testResult.AvgQuality;181 ((DoubleValue)results[TEST_QUALITY_RESULT_NAME].Value).Value = testResult.AvgQuality; 189 182 } 190 183 } 191 184 192 185 private bool AnalyzeBestTrainingSolution(PushProgram program, double bestQuality, ResultCollection results, IRandom random) { 193 if (!results.ContainsKey(B estTrainingSolutionResultName)) {186 if (!results.ContainsKey(BEST_TRAINING_SOLUTION_RESULT_NAME)) { 194 187 var solution = CreatePushSolution( 195 188 program, 196 189 bestQuality, 197 random, 198 config, 199 PushEvaluator); 200 201 results.Add(new Result(BestTrainingSolutionResultName, solution)); 190 (IRandom)random.Clone(), 191 (IReadOnlyPushConfiguration)Config.Clone()); 192 193 results.Add(new Result(BEST_TRAINING_SOLUTION_RESULT_NAME, solution)); 202 194 return true; 203 195 } 204 196 205 var currentBestQuality = ((PushSolution)results[B estTrainingSolutionResultName].Value).Quality;197 var currentBestQuality = ((PushSolution)results[BEST_TRAINING_SOLUTION_RESULT_NAME].Value).Quality; 206 198 207 199 if ((!Maximization && currentBestQuality > bestQuality) || 208 200 (Maximization && currentBestQuality < bestQuality)) { 209 results[B estTrainingSolutionResultName].Value = CreatePushSolution(201 results[BEST_TRAINING_SOLUTION_RESULT_NAME].Value = CreatePushSolution( 210 202 program, 211 203 bestQuality, 212 204 random, 213 config, 214 PushEvaluator); 205 Config); 215 206 return true; 216 207 } 217 208 218 209 return false; 219 }220 221 private EvaluationResult EvaluateIntegerVector(IntegerVector vector) {222 var rand = randomPool.Allocate();223 var seed = vector.GetSeed();224 rand.Reset(seed);225 226 var program = vector.ToPushProgram(config, rand);227 var result = PushEvaluator.EvaluateTraining(pool, program, rand);228 randomPool.Free(rand);229 230 return result;231 210 } 232 211 … … 235 214 double bestQuality, 236 215 IRandom random, 237 IReadOnlyPushConfiguration config, 238 IPushEvaluator evaluator); 216 IReadOnlyPushConfiguration config); 239 217 240 218 public override double Evaluate(Individual individual, IRandom random) { 241 var vector = individual.IntegerVector(); 242 var result = EvaluateIntegerVector(vector); 219 // init seed of random pool 220 //Interlocked.CompareExchange(ref RandomPool.Seed, random.Next(), 0); 221 //Config.Seed = RandomPool.Seed; 222 223 //var rand = RandomPool.ResetAndAllocate(); 224 var program = individual.ToPushProgram(Config, random); 225 //RandomPool.Free(rand); 226 227 //rand = RandomPool.ResetAndAllocate(); 228 var result = PushEvaluator.EvaluateTraining(Pool, program, random); 229 //RandomPool.Free(rand); 243 230 244 231 individual[CaseQualitiesScopeParameterName] = new DoubleArray(result.ExampleQualities); -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Problem/PushSolution.cs
r15017 r15273 11 11 public readonly double Quality; 12 12 [Storable] 13 p ublicreadonly IRandom Random;13 protected readonly IRandom Random; 14 14 [Storable] 15 15 public readonly IReadOnlyPushConfiguration Config; … … 46 46 } 47 47 48 public IRandom GetRandom() { 49 return (IRandom)Random.Clone(); 50 } 51 48 52 public virtual PushSolution Simplify() { 49 53 return new PushSolution(Program, Quality, Random, Config, Evaluator, true); -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Views/ExpressionSelectionView.cs
r15189 r15273 15 15 16 16 [View("Push Expression Selection Editor")] 17 [Content(typeof(IE nabledExpressionsConfiguration), true)]17 [Content(typeof(IExpressionsConfiguration), true)] 18 18 public partial class ExpressionSelectionView : ItemView { 19 19 public ExpressionSelectionView() { … … 24 24 } 25 25 26 public new IE nabledExpressionsConfiguration Content26 public new IExpressionsConfiguration Content 27 27 { 28 get { return (IE nabledExpressionsConfiguration)base.Content; }28 get { return (IExpressionsConfiguration)base.Content; } 29 29 set 30 30 { -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Views/PushDebuggerView.cs
r15032 r15273 54 54 } 55 55 56 interpreter = pool.Create(Content.Random); 56 var random = Content.GetRandom(); 57 interpreter = pool.Create(random); 57 58 58 59 InitDebugLists(Content.Config);
Note: See TracChangeset
for help on using the changeset viewer.