- Timestamp:
- 10/29/17 21:22:21 (7 years ago)
- Location:
- branches/MCTS-SymbReg-2796/HeuristicLab.Algorithms.DataAnalysis/3.4
- Files:
-
- 1 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/MCTS-SymbReg-2796/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis.MCTSSymbReg.csproj
r15438 r15440 104 104 <Compile Include="MctsSymbolicRegression\Disassembler.cs" /> 105 105 <Compile Include="MctsSymbolicRegression\ExpressionEvaluator.cs" /> 106 <Compile Include="MctsSymbolicRegression\ExprHashSymbolic.cs" /> 106 107 <Compile Include="MctsSymbolicRegression\MctsSymbolicRegressionAlgorithm.cs" /> 107 108 <Compile Include="MctsSymbolicRegression\MctsSymbolicRegressionStatic.cs" /> 108 109 <Compile Include="MctsSymbolicRegression\OpCodes.cs" /> 109 <Compile Include="MctsSymbolicRegression\ExprHash.cs" />110 110 <Compile Include="MctsSymbolicRegression\SymbolicExpressionGenerator.cs" /> 111 111 <Compile Include="MctsSymbolicRegression\Tree.cs" /> -
branches/MCTS-SymbReg-2796/HeuristicLab.Algorithms.DataAnalysis/3.4/MctsSymbolicRegression/Automaton.cs
r15438 r15440 424 424 v == StateLogTFEnd || 425 425 v == StateInvTFEnd || 426 v == StateExpFEnd 426 v == StateExpFEnd || 427 v == StateLogTEnd || 428 v == StateInvTEnd || 429 v == StateTermEnd 427 430 ; 428 431 } -
branches/MCTS-SymbReg-2796/HeuristicLab.Algorithms.DataAnalysis/3.4/MctsSymbolicRegression/MctsSymbolicRegressionStatic.cs
r15439 r15440 587 587 // for selected states (EvalStates) we introduce state unification (detection of equivalent states) 588 588 if (automaton.IsEvalState(possibleFollowStates[i])) { 589 var hc = Hashcode(automaton) * (ulong)tree.state; // TODO fix unit test for structure enumeration 589 var hc = Hashcode(automaton); 590 hc = ((hc << 5) + hc) ^ (ulong)tree.state; // TODO fix unit test for structure enumeration 590 591 if (!state.nodes.TryGetValue(hc, out child)) { 592 // Console.WriteLine("New expression (hash: {0}, state: {1})", Hashcode(automaton), automaton.stateNames[possibleFollowStates[i]]); 591 593 child = new Tree() { 592 594 state = possibleFollowStates[i], … … 598 600 // only allow forward edges (don't add the child if we would go back in the graph) 599 601 else if (child.level > tree.level) { 602 // Console.WriteLine("Existing expression (hash: {0}, state: {1})", Hashcode(automaton), automaton.stateNames[possibleFollowStates[i]]); 600 603 // whenever we join paths we need to propagate back the statistics of the existing node through the newly created link 601 604 // to all parents 602 605 BackpropagateStatistics(tree, state, child.visits); 603 606 } else { 607 // Console.WriteLine("Cycle (hash: {0}, state: {1})", Hashcode(automaton), automaton.stateNames[possibleFollowStates[i]]); 604 608 // prevent cycles 605 609 Debug.Assert(child.level <= tree.level); … … 688 692 int nParams; 689 693 automaton.GetCode(out code, out nParams); 690 return ExprHash.GetHash(code, nParams);694 return (ulong)ExprHashSymbolic.GetHash(code, nParams); 691 695 } 692 696
Note: See TracChangeset
for help on using the changeset viewer.