Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11234


Ignore:
Timestamp:
07/30/14 02:01:41 (10 years ago)
Author:
bburlacu
Message:

#2215: Updated tests project. Fixed a couple of bugs when adding arcs to a vertex. Removed useless events from the directed graph. Worked around invalid operation exception when removing arcs.

Location:
branches/HeuristicLab.BottomUpTreeDistance
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BottomUpTreeDistance/HeuristicLab.BottomUpTreeDistance.sln

    r11219 r11234  
    55MinimumVisualStudioVersion = 10.0.40219.1
    66Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis.Symbolic-3.4", "HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj", "{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}"
    7 EndProject
    8 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{296A2ED3-637A-4E1E-8C06-170651BF1F04}"
    9   ProjectSection(SolutionItems) = preProject
    10     Performance1.psess = Performance1.psess
    11   EndProjectSection
    127EndProject
    138Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Tests", "HeuristicLab.Tests\HeuristicLab.Tests.csproj", "{07C05C8F-0769-4607-96C6-D90A219F4C85}"
     
    4742    HideSolutionNode = FALSE
    4843  EndGlobalSection
    49   GlobalSection(Performance) = preSolution
    50     HasPerformanceSessions = true
    51   EndGlobalSection
    5244EndGlobal
  • branches/HeuristicLab.BottomUpTreeDistance/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/DirectedGraph/DirectedGraph.cs

    r11229 r11234  
    9494      vertex.ArcAdded += OnArcAdded;
    9595      vertex.ArcRemoved += OnArcRemoved;
    96       OnVertexAdded(this, EventArgs.Empty);
    9796    }
    9897
     
    10099      vertices.Remove(vertex);
    101100      // remove connections to/from the removed vertex
    102       foreach (var arc in vertex.InArcs.Concat(vertex.OutArcs))
     101      var arcList = vertex.InArcs.Concat(vertex.OutArcs).ToList();
     102      foreach (var arc in arcList)
    103103        RemoveArc(arc);
    104104      // deregister event handlers
     
    106106      vertex.ArcRemoved -= OnArcRemoved;
    107107      vertex.Changed -= OnVertexChanged;
    108       OnVertexRemoved(this, EventArgs.Empty);
    109108    }
    110109
     
    131130    }
    132131
    133     public event EventHandler VertexAdded;
    134     protected virtual void OnVertexAdded(object sender, EventArgs args) {
    135       var added = VertexAdded;
    136       if (added != null)
    137         added(sender, args);
    138     }
    139 
    140     public event EventHandler VertexChanged;
    141     protected virtual void OnVertexChanged(object sender, EventArgs args) {
    142       var changed = VertexChanged;
    143       if (changed != null)
    144         changed(sender, args);
    145     }
    146 
    147     public event EventHandler VertexRemoved;
    148     protected virtual void OnVertexRemoved(object sender, EventArgs args) {
    149       var removed = VertexRemoved;
    150       if (removed != null)
    151         removed(sender, args);
    152     }
     132    protected virtual void OnVertexChanged(object sender, EventArgs args) { }
    153133
    154134    protected virtual void OnArcAdded(object sender, EventArgs<IArc> args) {
  • branches/HeuristicLab.BottomUpTreeDistance/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/DirectedGraph/Vertex.cs

    r11229 r11234  
    126126        if (outArcs == null)
    127127          outArcs = new List<IArc>();
    128         else if (outArcs.Contains(arc) || outArcs.Any(a => a.Target == arc.Target && a.Source == arc.Source))
     128        else if (outArcs.Contains(arc) || outArcs.Any(a => a.Target == arc.Target))
    129129          throw new InvalidOperationException("Arc already added.");
    130130        outArcs.Add(arc);
     
    132132        if (inArcs == null)
    133133          inArcs = new List<IArc>();
    134         else if (inArcs.Contains(arc) || inArcs.Any(a => a.Target == arc.Target && a.Source == arc.Source))
     134        else if (inArcs.Contains(arc) || inArcs.Any(a => a.Source == arc.Source))
    135135          throw new InvalidOperationException("Arc already added.");
    136136        inArcs.Add(arc);
  • branches/HeuristicLab.BottomUpTreeDistance/HeuristicLab.Tests/HeuristicLab.Tests.csproj

    r11219 r11234  
    9797  </Choose>
    9898  <ItemGroup>
     99    <Compile Include="MaxCommonSubtreeSimilarityCalculatorTest.cs" />
    99100    <Compile Include="BottomUpSimilarityCalculatorTest.cs" />
    100101    <Compile Include="Properties\AssemblyInfo.cs" />
Note: See TracChangeset for help on using the changeset viewer.