Skip to content

Commit c8cd127

Browse files
committed
Multiple application of the readonly modifier.
1 parent 3dba645 commit c8cd127

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+5747
-5756
lines changed

src/SharpNeatDomains/BoxesVisualDiscrimination/BoxesVisualDiscriminationEvaluator.cs

+268-268
Large diffs are not rendered by default.

src/SharpNeatDomains/BoxesVisualDiscrimination/BoxesVisualDiscriminationView.cs

+346-346
Large diffs are not rendered by default.
+59-59
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,59 @@
1-
/* ***************************************************************************
2-
* This file is part of SharpNEAT - Evolution of Neural Networks.
3-
*
4-
* Copyright 2004-2016 Colin Green ([email protected])
5-
*
6-
* SharpNEAT is free software; you can redistribute it and/or modify
7-
* it under the terms of The MIT License (MIT).
8-
*
9-
* You should have received a copy of the MIT License
10-
* along with SharpNEAT; if not, see https://opensource.org/licenses/MIT.
11-
*/
12-
using SharpNeat.View.Graph;
13-
using SharpNeat.Genomes.Neat;
14-
using SharpNeat.Network;
15-
16-
namespace SharpNeat.Domains
17-
{
18-
/// <summary>
19-
/// GUI control for visualizing CPPN genomes.
20-
/// </summary>
21-
public partial class CppnGenomeView : AbstractGenomeView
22-
{
23-
NetworkGraphFactory _graphFactory = new NetworkGraphFactory();
24-
IOGraphViewportPainter _viewportPainter;
25-
26-
#region Constructor
27-
28-
/// <summary>
29-
/// Construct with the provided CPPN activation function library to draw CPPNs with (genome nodes contain an index into this library).
30-
/// </summary>
31-
/// <param name="actFnLib"></param>
32-
public CppnGenomeView(IActivationFunctionLibrary actFnLib)
33-
{
34-
InitializeComponent();
35-
graphControl1.ViewportPainter = _viewportPainter = new IOGraphViewportPainter(new CppnGraphPainter(actFnLib));
36-
}
37-
38-
#endregion
39-
40-
#region Public Methods
41-
42-
/// <summary>
43-
/// Refresh/update the view with the provided genome.
44-
/// </summary>
45-
public override void RefreshView(object genome)
46-
{
47-
NeatGenome neatGenome = genome as NeatGenome;
48-
if(null == neatGenome) {
49-
return;
50-
}
51-
52-
IOGraph graph = _graphFactory.CreateGraph(neatGenome);
53-
_viewportPainter.IOGraph = graph;
54-
graphControl1.RefreshImage();
55-
}
56-
57-
#endregion
58-
}
59-
}
1+
/* ***************************************************************************
2+
* This file is part of SharpNEAT - Evolution of Neural Networks.
3+
*
4+
* Copyright 2004-2016 Colin Green ([email protected])
5+
*
6+
* SharpNEAT is free software; you can redistribute it and/or modify
7+
* it under the terms of The MIT License (MIT).
8+
*
9+
* You should have received a copy of the MIT License
10+
* along with SharpNEAT; if not, see https://opensource.org/licenses/MIT.
11+
*/
12+
using SharpNeat.View.Graph;
13+
using SharpNeat.Genomes.Neat;
14+
using SharpNeat.Network;
15+
16+
namespace SharpNeat.Domains
17+
{
18+
/// <summary>
19+
/// GUI control for visualizing CPPN genomes.
20+
/// </summary>
21+
public partial class CppnGenomeView : AbstractGenomeView
22+
{
23+
readonly NetworkGraphFactory _graphFactory = new NetworkGraphFactory();
24+
readonly IOGraphViewportPainter _viewportPainter;
25+
26+
#region Constructor
27+
28+
/// <summary>
29+
/// Construct with the provided CPPN activation function library to draw CPPNs with (genome nodes contain an index into this library).
30+
/// </summary>
31+
/// <param name="actFnLib"></param>
32+
public CppnGenomeView(IActivationFunctionLibrary actFnLib)
33+
{
34+
InitializeComponent();
35+
graphControl1.ViewportPainter = _viewportPainter = new IOGraphViewportPainter(new CppnGraphPainter(actFnLib));
36+
}
37+
38+
#endregion
39+
40+
#region Public Methods
41+
42+
/// <summary>
43+
/// Refresh/update the view with the provided genome.
44+
/// </summary>
45+
public override void RefreshView(object genome)
46+
{
47+
NeatGenome neatGenome = genome as NeatGenome;
48+
if(null == neatGenome) {
49+
return;
50+
}
51+
52+
IOGraph graph = _graphFactory.CreateGraph(neatGenome);
53+
_viewportPainter.IOGraph = graph;
54+
graphControl1.RefreshImage();
55+
}
56+
57+
#endregion
58+
}
59+
}

0 commit comments

Comments
 (0)