Skip to content
Browse files

Make IteratingLogProcess as the parent class of HistogramLogProcess

  • Loading branch information...
1 parent 6a16bcc commit 0247056d97f042ba0102fe69237e0f4d1bbc1b2c @satya-arjunan satya-arjunan committed Jun 19, 2012
View
51 HistogramLogProcess.hpp
@@ -34,22 +34,16 @@
#include <fstream> //provides ofstream
#include <math.h>
-#include "SpatiocyteProcess.hpp"
+#include "IteratingLogProcess.hpp"
#include "SpatiocyteSpecies.hpp"
-LIBECS_DM_CLASS(HistogramLogProcess, SpatiocyteProcess)
+LIBECS_DM_CLASS(HistogramLogProcess, IteratingLogProcess)
{
public:
LIBECS_DM_OBJECT(HistogramLogProcess, Process)
{
- INHERIT_PROPERTIES(Process);
- PROPERTYSLOT_SET_GET(Real, LogEnd);
- PROPERTYSLOT_SET_GET(Real, LogStart);
- PROPERTYSLOT_SET_GET(Real, LogInterval);
- PROPERTYSLOT_SET_GET(Integer, Iterations);
- PROPERTYSLOT_SET_GET(Integer, SaveCounts);
+ INHERIT_PROPERTIES(IteratingLogProcess);
PROPERTYSLOT_SET_GET(Integer, Bins);
- PROPERTYSLOT_SET_GET(String, FileName);
PROPERTYSLOT_SET_GET(Real, Radius);
PROPERTYSLOT_SET_GET(Real, Length);
PROPERTYSLOT_SET_GET(Real, OriginX);
@@ -59,13 +53,7 @@ LIBECS_DM_CLASS(HistogramLogProcess, SpatiocyteProcess)
PROPERTYSLOT_SET_GET(Real, RotateY);
PROPERTYSLOT_SET_GET(Real, RotateZ);
}
- SIMPLE_SET_GET_METHOD(Real, LogEnd);
- SIMPLE_SET_GET_METHOD(Real, LogStart);
- SIMPLE_SET_GET_METHOD(Real, LogInterval);
- SIMPLE_SET_GET_METHOD(Integer, Iterations);
- SIMPLE_SET_GET_METHOD(Integer, SaveCounts);
SIMPLE_SET_GET_METHOD(Integer, Bins);
- SIMPLE_SET_GET_METHOD(String, FileName);
SIMPLE_SET_GET_METHOD(Real, Radius);
SIMPLE_SET_GET_METHOD(Real, Length);
SIMPLE_SET_GET_METHOD(Real, OriginX);
@@ -75,47 +63,30 @@ LIBECS_DM_CLASS(HistogramLogProcess, SpatiocyteProcess)
SIMPLE_SET_GET_METHOD(Real, RotateY);
SIMPLE_SET_GET_METHOD(Real, RotateZ);
HistogramLogProcess():
- SpatiocyteProcess(false),
- Iterations(1),
- SaveCounts(0),
Bins(1),
- LogStart(0),
- LogInterval(0),
OriginX(0),
OriginY(0),
OriginZ(0),
Radius(12.5e-9),
RotateX(0),
RotateY(0),
- RotateZ(0),
- FileName("HisLog.csv") {}
+ RotateZ(0)
+ {
+ FileName = "HisLog.csv";
+ }
virtual ~HistogramLogProcess() {}
- virtual void initializeSecond()
- {
- SpatiocyteProcess::initializeSecond();
- timePointCnt = 0;
- thePriority = -10;
- }
virtual void initializeFifth();
virtual void initializeLastOnce();
virtual void fire();
- void saveFile();
- void saveBackup();
- void logValues();
+ virtual void saveFile();
+ virtual void saveBackup();
+ virtual void logValues();
void initializeVectors();
bool isInside(unsigned int&, Point);
protected:
- int Iterations;
- int SaveCounts;
- int timePointCnt;
- int theTotalIterations;
unsigned int Bins;
- unsigned int timePoints;
double binInterval;
double Length;
- double LogEnd;
- double LogStart;
- double LogInterval;
double OriginX;
double OriginY;
double OriginZ;
@@ -127,8 +98,6 @@ LIBECS_DM_CLASS(HistogramLogProcess, SpatiocyteProcess)
Point C;
Point E;
Point D;
- String FileName;
- std::ofstream theLogFile;
Comp* theComp;
std::vector<std::vector<std::vector<double> > > theLogValues;
};
View
8 IteratingLogProcess.hpp
@@ -106,11 +106,9 @@ LIBECS_DM_CLASS(IteratingLogProcess, SpatiocyteProcess)
virtual void initializeFifth();
virtual void initializeLastOnce();
virtual void fire();
- void saveFile();
- void saveBackup();
- void logValues();
- void initializeVectors();
- bool isInside(unsigned int&, Point);
+ virtual void saveFile();
+ virtual void saveBackup();
+ virtual void logValues();
protected:
bool isSurviving;
int Centered;
View
4 Makefile
@@ -9,14 +9,14 @@ ReactionProcess\
VisualizationLogProcess\
MicrotubuleProcess\
ErythrocyteProcess\
-HistogramLogProcess\
H5VisualizationLogProcess\
IteratingLogProcess\
DiffusionInfluencedReactionProcess\
OscillationAnalysisProcess\
SpatiocyteNextReactionProcess\
MicroscopyTrackingProcess\
CoordinateLogProcess\
+HistogramLogProcess\
MoleculePopulateProcess\
DiffusionProcess\
PolymerFragmentationProcess\
@@ -65,7 +65,7 @@ ErythrocyteProcess.so: ErythrocyteProcess.cpp
$(ECELL3_DMC) -o ErythrocyteProcess.so --ldflags="SpatiocyteProcess.so" ErythrocyteProcess.cpp
HistogramLogProcess.so: HistogramLogProcess.cpp
- $(ECELL3_DMC) -o HistogramLogProcess.so --ldflags="SpatiocyteProcess.so" HistogramLogProcess.cpp
+ $(ECELL3_DMC) -o HistogramLogProcess.so --ldflags="SpatiocyteProcess.so IteratingLogProcess.so" HistogramLogProcess.cpp
OscillationAnalysisProcess.so: OscillationAnalysisProcess.cpp
$(ECELL3_DMC) -o OscillationAnalysisProcess.so --ldflags="SpatiocyteProcess.so" OscillationAnalysisProcess.cpp
View
0 plotHistogram.example.py → plotHistogramLogProcess.example.py
File renamed without changes.
View
41 plotIteratingLogProcess.example.py
@@ -0,0 +1,41 @@
+import numpy
+import csv
+import math
+from matplotlib import rc
+from pylab import *
+from matplotlib.ticker import MaxNLocator
+
+labelFontSize = 14
+tickFontSize = 14
+legendFontSize = 14
+lineFontSize = 14
+
+fileNames = ['Log.csv']
+legendTitles = ['State 2', 'State 1']
+speciesList = ['E']
+lines = ['-', '--', '-', '-']
+colors = ['r', 'b', '#000000', 'black', 'c', 'k', '#009955', '#ff9933', '#ff00ff', '#11dd00']
+data = genfromtxt(fileNames[0], delimiter=',').T
+
+colSize = len(data)-1
+for i in range(colSize):
+ plot(data[0], data[i+1], ls=lines[0], color=colors[i], label=legendTitles[0], linewidth=1)
+
+ax = gca()
+ax.grid(color='b', linestyle='--')
+#ax.yaxis.set_major_locator(MaxNLocator(14))
+leg = legend(loc=0, labelspacing=0.2, handletextpad=0.2, fancybox=True)
+for t in leg.get_texts():
+ t.set_fontsize(legendFontSize)
+xticks(fontsize=tickFontSize)
+yticks(fontsize=tickFontSize)
+frame = leg.get_frame()
+frame.set_linewidth(None)
+frame.set_facecolor('0.95')
+frame.set_edgecolor('0.75')
+xlabel('site')
+ylabel('density')
+show()
+
+
+

0 comments on commit 0247056

Please sign in to comment.
Something went wrong with that request. Please try again.