Changeset 365 for trunk/sources/HeuristicLab.Functions
- Timestamp:
- 07/07/08 15:10:51 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Functions
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Functions/BakedTreeEvaluator.cs
r363 r365 96 96 return currInstr.d_arg0; 97 97 } 98 case EvaluatorSymbolTable.DIFFERENTIAL: { 99 int row = sampleIndex + currInstr.i_arg1; 100 if(row < 1 || row >= dataset.Rows) return double.NaN; 101 else return currInstr.d_arg0 * (dataset.GetValue(row, currInstr.i_arg0) - dataset.GetValue(row - 1, currInstr.i_arg0)); 102 } 98 103 case EvaluatorSymbolTable.MULTIPLICATION: { 99 104 double result = EvaluateBakedCode(); -
trunk/sources/HeuristicLab.Functions/FunctionView.cs
r308 r365 168 168 public void Visit(Cosinus cosinus) { 169 169 name = "Sin"; 170 } 171 172 public void Visit(Differential diff) { 173 string timeOffset = ""; 174 int sampleOffset = ((ConstrainedIntData)currentBranch.GetLocalVariable(HeuristicLab.Functions.Differential.OFFSET).Value).Data; 175 int variableIndex = ((ConstrainedIntData)currentBranch.GetLocalVariable(HeuristicLab.Functions.Differential.INDEX).Value).Data; 176 double weight = ((ConstrainedDoubleData)currentBranch.GetLocalVariable(HeuristicLab.Functions.Differential.WEIGHT).Value).Data; 177 if(sampleOffset < 0) { 178 timeOffset = "(t" + sampleOffset + ")"; 179 } else if(sampleOffset > 0) { 180 timeOffset = "(t+" + sampleOffset + ")"; 181 } else { 182 timeOffset = ""; 183 } 184 name = "Diff" + variableIndex + timeOffset + " * " + weight; 170 185 } 171 186 -
trunk/sources/HeuristicLab.Functions/HeuristicLab.Functions.csproj
r308 r365 56 56 <Compile Include="BakedTreeEvaluator.cs" /> 57 57 <Compile Include="Constant.cs" /> 58 <Compile Include="Differential.cs" /> 58 59 <Compile Include="GreaterThan.cs" /> 59 60 <Compile Include="IfThenElse.cs"> -
trunk/sources/HeuristicLab.Functions/IFunctionVisitor.cs
r308 r365 33 33 void Visit(Constant constant); 34 34 void Visit(Cosinus cosinus); 35 void Visit(Differential differential); 35 36 void Visit(Division division); 36 37 void Visit(Equal equal); -
trunk/sources/HeuristicLab.Functions/ModelAnalyzerExporter.cs
r344 r365 59 59 public void Visit(Cosinus cosinus) { 60 60 VisitFunction("Trigonometrics[1]", cosinus); 61 } 62 63 public void Visit(Differential differential) { 64 double weight = ((ConstrainedDoubleData)currentBranch.GetLocalVariable(HeuristicLab.Functions.Differential.WEIGHT).Value).Data; 65 double index = ((ConstrainedIntData)currentBranch.GetLocalVariable(HeuristicLab.Functions.Differential.INDEX).Value).Data; 66 double offset = ((ConstrainedIntData)currentBranch.GetLocalVariable(HeuristicLab.Functions.Differential.OFFSET).Value).Data; 67 68 prefix += currentIndend + "[T]Differential(" + weight.ToString("r") + ";" + index + ";" + -offset + ")"; 61 69 } 62 70 -
trunk/sources/HeuristicLab.Functions/SymbolTable.cs
r319 r365 34 34 public const int CONSTANT = 4; 35 35 public const int COSINUS = 5; 36 public const int DIFFERENTIAL = 25; 36 37 public const int DIVISION = 6; 37 38 public const int EQU = 7; … … 82 83 staticTypes[typeof(Variable)] = VARIABLE; 83 84 staticTypes[typeof(Xor)] = XOR; 85 staticTypes[typeof(Differential)] = DIFFERENTIAL; 84 86 } 85 87
Note: See TracChangeset
for help on using the changeset viewer.