Skip to content

Commit 8f2a932

Browse files
committed
Added comments for debuggin dead code
1 parent 4f0c8d1 commit 8f2a932

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

Simulator/Core/Model.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515

1616
#include "Model.h"
17-
#include "ConnGrowth.h"
17+
// #include "FixedLayout.h"
1818
#include "Connections.h"
1919
#include "Factory.h"
2020
#include "ParameterManager.h"
@@ -106,10 +106,16 @@ void Model::setupSim()
106106
connections_->createEdgeIndexMap();
107107
}
108108

109+
// Note: This method was previously used for debugging, but it is now dead code left behind.
109110
/// Log this simulation step.
110111
void Model::logSimStep() const
111112
{
112-
layout_->printLayout();
113+
FixedLayout *fixedLayout = dynamic_cast<FixedLayout *>(layout_.get());
114+
if (fixedLayout == nullptr) {
115+
return;
116+
}
117+
118+
fixedLayout->printLayout();
113119
}
114120

115121
/// Update the simulation history of every epoch.

Simulator/Core/Model.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class Model {
8080
virtual void updateConnections() = 0;
8181

8282
protected:
83+
// Note: This method was previously used for debugging, but it is now dead code left behind.
8384
/// Prints debug information about the current state of the network.
8485
void logSimStep() const;
8586

Simulator/Layouts/Layout.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@ void Layout::registerGraphProperties()
5858
// initial graph
5959
}
6060

61-
void Layout::printLayout()
62-
{
63-
// Empty implementation because not all Layouts implement it but it is used by the Model
64-
}
65-
6661
/// Setup the internal structure of the class.
6762
/// Allocate memories to store all layout state, no sequential dependency in this method
6863
void Layout::setup()

Simulator/Layouts/Layout.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ class Layout {
6868
/// @return The number of vertices managed by the Layout
6969
virtual int getNumVertices() const;
7070

71-
/// @brief Prints the layout, used for debugging.
72-
virtual void printLayout();
73-
7471
VectorMatrix xloc_; ///< Store neuron i's x location.
7572

7673
VectorMatrix yloc_; ///< Store neuron i's y location.

Simulator/Layouts/Neuro/FixedLayout.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ void FixedLayout::initVerticesLocs()
176176
}
177177
}
178178

179+
// Note: This code was previously used for debugging, but it is now dead code left behind
180+
// and it is never executed.
179181
void FixedLayout::printLayout()
180182
{
181183
ConnGrowth &pConnGrowth

Simulator/Layouts/Neuro/FixedLayout.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ class FixedLayout : public Layout {
5959
/// @return type of the synapse.
6060
virtual edgeType edgType(const int srcVertex, const int destVertex) override;
6161

62-
/// @brief Prints the layout, used for debugging.
63-
virtual void printLayout() override;
62+
/// Prints the layout, used for debugging.
63+
void printLayout();
6464

6565
private:
6666
/// initialize the location maps (xloc and yloc).

0 commit comments

Comments
 (0)