Browse files

Another process initialization between second and third initialization.

  • Loading branch information...
1 parent 017b340 commit bd3463cda2fdf17139beab2ab26ea88284802fdf @satya-arjunan satya-arjunan committed Apr 9, 2012
View
2 CompartmentGrowthProcess.hpp
@@ -58,7 +58,7 @@ LIBECS_DM_CLASS(CompartmentGrowthProcess, SpatiocyteProcess)
}
SpatiocyteProcess::initialize();
}
- virtual void initializeThird()
+ virtual void initializeFifth()
{
theComp = theSpatiocyteStepper->system2Comp(getSuperSystem());
theStepInterval = 1;
View
14 DiffusionInfluencedReactionProcess.cpp
@@ -34,7 +34,7 @@
LIBECS_DM_INIT(DiffusionInfluencedReactionProcess, Process);
-void DiffusionInfluencedReactionProcess::initializeSecond()
+void DiffusionInfluencedReactionProcess::initializeThird()
{
ReactionProcess::initializeSecond();
A->setDiffusionInfluencedReactantPair(B);
@@ -53,10 +53,6 @@ void DiffusionInfluencedReactionProcess::initializeSecond()
}
}
-void DiffusionInfluencedReactionProcess::initializeThird()
-{
-}
-
//Do the reaction A + B -> C + D. So that A <- C and B <- D.
//We need to consider that the source molecule can be either A or B.
//If A and C belong to the same Comp, A <- C.
@@ -242,6 +238,14 @@ void DiffusionInfluencedReactionProcess::finalizeReaction()
void DiffusionInfluencedReactionProcess::calculateReactionProbability()
{
+ /*
+ std::cout << "theSizes:" << getIDString(A->getComp()) << std::endl;
+ for(unsigned int i(0);
+ i != theSpatiocyteStepper->getAdjoiningVoxelSize(); ++i)
+ {
+ std::cout << A->getComp()->adjoinCount[i] << std::endl;
+ }
+ */
//Refer to the paper for the description of the variables used in this
//method.
if(A->getIsVolume() && B->getIsVolume())
View
1 DiffusionInfluencedReactionProcess.hpp
@@ -62,7 +62,6 @@ LIBECS_DM_CLASS_EXTRA_1(DiffusionInfluencedReactionProcess, ReactionProcess, vir
"diffusion influenced reactions.");
}
}
- virtual void initializeSecond();
virtual void initializeThird();
virtual bool react(Voxel*, Voxel*);
virtual void printParameters();
View
2 DiffusionProcess.hpp
@@ -124,7 +124,7 @@ LIBECS_DM_CLASS(DiffusionProcess, SpatiocyteProcess)
theDiffusionSpecies->setVacantSpecies(theVacantSpecies);
}
}
- virtual void initializeThird()
+ virtual void initializeFourth()
{
double rho(theDiffusionSpecies->getMaxReactionProbability());
if(rho > P)
View
2 H5VisualizationLogProcess.cpp
@@ -207,7 +207,7 @@ LIBECS_DM_CLASS(H5VisualizationLogProcess, SpatiocyteProcess)
SIMPLE_SET_GET_METHOD(Real, LogInterval);
SIMPLE_SET_GET_METHOD(String, FileName);
- virtual void initializeFourth()
+ virtual void initializeFifth()
{
if(LogInterval > 0)
{
View
2 IteratingLogProcess.hpp
@@ -95,7 +95,7 @@ LIBECS_DM_CLASS(IteratingLogProcess, SpatiocyteProcess)
theLogCnt = 0;
thePriority = -10;
}
- virtual void initializeFourth()
+ virtual void initializeFifth()
{
for(std::vector<Species*>::const_iterator i(theProcessSpecies.begin());
i != theProcessSpecies.end(); ++i)
View
2 MicroscopyTrackingProcess.hpp
@@ -51,7 +51,7 @@ LIBECS_DM_CLASS(MicroscopyTrackingProcess, VisualizationLogProcess)
virtual ~MicroscopyTrackingProcess() {}
SIMPLE_SET_GET_METHOD(Integer, MeanCount);
SIMPLE_SET_GET_METHOD(Real, ExposureTime);
- virtual void initializeFourth()
+ virtual void initializeFifth()
{
theLatticeSize = theSpatiocyteStepper->getLatticeSize();
theStartCoord = theSpatiocyteStepper->getStartCoord();
View
2 MoleculePopulateProcess.hpp
@@ -78,7 +78,7 @@ LIBECS_DM_CLASS_EXTRA_1(MoleculePopulateProcess, SpatiocyteProcess, MoleculePopu
virtual void populateUniformRanged(Species* aSpecies);
virtual void populateUniformOnDiffuseVacant(Species* aSpecies);
virtual void fire();
- virtual void initializeFourth()
+ virtual void initializeFifth()
{
theStepInterval = ResetTime;
theTime = theStepInterval;
View
4 PeriodicBoundaryDiffusionProcess.hpp
@@ -52,9 +52,9 @@ LIBECS_DM_CLASS(PeriodicBoundaryDiffusionProcess, DiffusionProcess)
DiffusionProcess::initialize();
theSpatiocyteStepper->setPeriodicEdge();
}
- void initializeThird()
+ void initializeFourth()
{
- DiffusionProcess::initializeThird();
+ DiffusionProcess::initializeFourth();
for(std::vector<Species*>::const_iterator i(theProcessSpecies.begin());
i != theProcessSpecies.end(); ++i)
{
View
2 PolymerizationParameterProcess.hpp
@@ -71,7 +71,7 @@ LIBECS_DM_CLASS(PolymerizationParameterProcess, SpatiocyteProcess)
theBendAngles.push_back(aValueVector[i].as<double>());
}
}
- virtual void initializeThird()
+ virtual void initializeFourth()
{
for(std::vector<Species*>::const_iterator i(theProcessSpecies.begin());
i != theProcessSpecies.end(); ++i)
View
2 PolymerizationProcess.cpp
@@ -259,7 +259,7 @@ void PolymerizationProcess::pinStep(double* currX, double *fixedDcm,
ypr2dcm(ypr, resDcm);
}
-void PolymerizationProcess::initializeThird()
+void PolymerizationProcess::initializeFourth()
{
theMinX = C->getWestPoint().x;
theMaxX = C->getEastPoint().x;
View
2 PolymerizationProcess.hpp
@@ -59,7 +59,7 @@ LIBECS_DM_CLASS(PolymerizationProcess, DiffusionInfluencedReactionProcess)
{
DiffusionInfluencedReactionProcess::initialize();
}
- virtual void initializeThird();
+ virtual void initializeFourth();
virtual bool react(Voxel*, Voxel**);
virtual bool isInterrupting(Process*);
virtual void finalizeReaction();
View
4 ReactionProcess.hpp
@@ -98,9 +98,9 @@ LIBECS_DM_CLASS_EXTRA_1(ReactionProcess, SpatiocyteProcess, ReactionProcessInter
SpatiocyteProcess::initializeSecond();
theInterruptingProcesses.resize(0);
}
- virtual void initializeThird()
+ virtual void initializeFourth()
{
- SpatiocyteProcess::initializeThird();
+ SpatiocyteProcess::initializeFourth();
}
//This method is called whenever the substrate (-1 and 0 coefficients)
//value of the process listed in isInterrupting method has changed:
View
1 SpatiocyteCommon.hpp
@@ -164,6 +164,7 @@ struct Comp
std::vector<Comp*> lineSubs;
std::vector<Species*> species;
std::vector<unsigned int> coords; //coords[x] = aVoxel->coord - theStartCoord
+ std::vector<unsigned int> adjoinCount;
};
struct Origin
View
4 SpatiocyteNextReactionProcess.cpp
@@ -483,9 +483,9 @@ Voxel* SpatiocyteNextReactionProcess::reactvAvBC(Species* c)
return moleculeC;
}
-void SpatiocyteNextReactionProcess::initializeThird()
+void SpatiocyteNextReactionProcess::initializeFourth()
{
- ReactionProcess::initializeThird();
+ ReactionProcess::initializeFourth();
if(p != -1)
{
return;
View
2 SpatiocyteNextReactionProcess.hpp
@@ -147,7 +147,7 @@ LIBECS_DM_CLASS(SpatiocyteNextReactionProcess, ReactionProcess)
}
virtual GET_METHOD(Real, StepInterval);
virtual void fire();
- virtual void initializeThird();
+ virtual void initializeFourth();
virtual void printParameters();
protected:
virtual void calculateOrder();
View
1 SpatiocyteProcess.hpp
@@ -57,6 +57,7 @@ LIBECS_DM_CLASS_EXTRA_1(SpatiocyteProcess, Process, virtual SpatiocyteProcessInt
}
virtual void initializeThird() {}
virtual void initializeFourth() {}
+ virtual void initializeFifth() {}
virtual void initializeLastOnce() {}
virtual void printParameters() {}
virtual void substrateValueChanged(Time) {}
View
1 SpatiocyteProcessInterface.hpp
@@ -41,6 +41,7 @@ class SpatiocyteProcessInterface
virtual void initializeSecond() = 0;
virtual void initializeThird() = 0;
virtual void initializeFourth() = 0;
+ virtual void initializeFifth() = 0;
virtual void initializeLastOnce() = 0;
virtual void printParameters() = 0;
virtual void substrateValueChanged(Time) = 0;
View
25 SpatiocyteStepper.cpp
@@ -79,17 +79,18 @@ void SpatiocyteStepper::initialize()
compartmentalizeLattice();
std::cout << "8. setting up compartment voxels properties..." << std::endl;
setCompVoxelProperties();
+ initProcessThird();
std::cout << "9. printing simulation parameters..." << std::endl;
storeSimulationParameters();
printSimulationParameters();
std::cout << "10. populating compartments with molecules..." << std::endl;
populateComps();
std::cout << "11. initializing processes the third time..." << std::endl;
- initProcessThird();
+ initProcessFourth();
std::cout << "12. initializing the priority queue..." << std::endl;
initPriorityQueue();
std::cout << "13. initializing processes the fourth time..." << std::endl;
- initProcessFourth();
+ initProcessFifth();
std::cout << "14. initializing processes the last time..." << std::endl;
initProcessLastOnce();
std::cout << "15. printing final process parameters..." << std::endl <<
@@ -422,6 +423,17 @@ void SpatiocyteStepper::initProcessFourth()
aProcess(dynamic_cast<SpatiocyteProcessInterface*>(*i));
aProcess->initializeFourth();
}
+}
+
+void SpatiocyteStepper::initProcessFifth()
+{
+ for(std::vector<Process*>::const_iterator i(theProcessVector.begin());
+ i != theProcessVector.end(); ++i)
+ {
+ SpatiocyteProcessInterface*
+ aProcess(dynamic_cast<SpatiocyteProcessInterface*>(*i));
+ aProcess->initializeFifth();
+ }
setStepInterval(thePriorityQueue.getTop()->getTime()-getCurrentTime());
}
@@ -749,6 +761,11 @@ void SpatiocyteStepper::registerCompSpecies(Comp* aComp)
}
}
+unsigned int SpatiocyteStepper::getAdjoiningVoxelSize()
+{
+ return theAdjoiningVoxelSize;
+}
+
void SpatiocyteStepper::setLatticeProperties()
{
Comp* aRootComp(theComps[0]);
@@ -1866,7 +1883,7 @@ void SpatiocyteStepper::setCompVoxelProperties()
break;
case 3:
default:
- setVolumeCompProperties(*i);
+ setVolumeCompProperties(*i);
}
}
}
@@ -1982,6 +1999,7 @@ void SpatiocyteStepper::optimizeSurfaceVoxel(Voxel* aVoxel,
Comp* aComp)
{
unsigned short surfaceID(aComp->vacantID);
+ aComp->adjoinCount.resize(theAdjoiningVoxelSize);
aVoxel->surfaceVoxels = new std::vector<std::vector<Voxel*> >;
aVoxel->surfaceVoxels->resize(4);
std::vector<Voxel*>& immediateSurface((*aVoxel->surfaceVoxels)[IMMEDIATE]);
@@ -2005,6 +2023,7 @@ void SpatiocyteStepper::optimizeSurfaceVoxel(Voxel* aVoxel,
if((*l) != aVoxel && (*l)->id != theNullID
&& id2Comp((*l)->id)->dimension <= aComp->dimension)
{
+ ++aComp->adjoinCount[l-adjoiningCopy.begin()];
(*forward) = (*l);
++forward;
//immediateSurface contains all adjoining surface voxels except the
View
2 SpatiocyteStepper.hpp
@@ -83,6 +83,7 @@ LIBECS_DM_CLASS(SpatiocyteStepper, Stepper)
unsigned int getLayerSize();
unsigned int getColSize();
unsigned int getLatticeSize();
+ unsigned int getAdjoiningVoxelSize();
Point getCenterPoint();
double getNormalizedVoxelRadius();
Voxel* point2voxel(Point);
@@ -101,6 +102,7 @@ LIBECS_DM_CLASS(SpatiocyteStepper, Stepper)
void initProcessSecond();
void initProcessThird();
void initProcessFourth();
+ void initProcessFifth();
void initProcessLastOnce();
void storeSimulationParameters();
void printSimulationParameters();
View
2 VisualizationLogProcess.hpp
@@ -73,7 +73,7 @@ LIBECS_DM_CLASS(VisualizationLogProcess, SpatiocyteProcess)
thePriority = -1;
}
- virtual void initializeFourth()
+ virtual void initializeFifth()
{
if(LogInterval > 0)
{

0 comments on commit bd3463c

Please sign in to comment.