36#include "AbstractOnLatticeCellPopulation.hpp"
40 std::vector<CellPtr>& rCells,
41 const std::vector<unsigned> locationIndices,
44 mDeleteMesh(deleteMesh),
45 mUpdateNodesInRandomOrder(true),
46 mIterateRandomlyOverUpdateRuleCollection(false)
48 std::list<CellPtr>::iterator it = this->
mCells.begin();
49 for (
unsigned i=0; it != this->
mCells.end(); ++it, ++i)
51 unsigned index = locationIndices.empty() ? i : locationIndices[i];
60 mUpdateNodesInRandomOrder(true),
61 mIterateRandomlyOverUpdateRuleCollection(false)
73 return mUpdateNodesInRandomOrder;
79 mUpdateNodesInRandomOrder = updateNodesInRandomOrder;
85 mIterateRandomlyOverUpdateRuleCollection = iterateRandomly;
91 return mIterateRandomlyOverUpdateRuleCollection;
97 EXCEPTION(
"SetNode() cannot be called on a subclass of AbstractOnLatticeCellPopulation.");
100template<
unsigned DIM>
103 EXCEPTION(
"Cannot call GetNeighbouringNodeIndices() on a subclass of AbstractOnLatticeCellPopulation, need to go through the PottsMesh instead");
104 std::set<unsigned> neighbouring_node_indices;
105 return neighbouring_node_indices;
108template<
unsigned DIM>
111 *rParamsFile <<
"\t\t<UpdateNodesInRandomOrder>" << mUpdateNodesInRandomOrder <<
"</UpdateNodesInRandomOrder>\n";
112 *rParamsFile <<
"\t\t<IterateRandomlyOverUpdateRuleCollection>" << mIterateRandomlyOverUpdateRuleCollection <<
"</IterateRandomlyOverUpdateRuleCollection>\n";
118template<
unsigned DIM>
124template<
unsigned DIM>
127 return mUpdateRuleCollection;
130template<
unsigned DIM>
133 mUpdateRuleCollection.clear();
#define EXCEPTION(message)
virtual void AddCellUsingLocationIndex(unsigned index, CellPtr pCell)
std::list< CellPtr > mCells
virtual void OutputCellPopulationParameters(out_stream &rParamsFile)=0
void SetUpdateNodesInRandomOrder(bool updateNodesInRandomOrder)
bool GetUpdateNodesInRandomOrder()
virtual void OutputCellPopulationParameters(out_stream &rParamsFile)
virtual double GetDefaultTimeStep()
virtual ~AbstractOnLatticeCellPopulation()
AbstractOnLatticeCellPopulation(AbstractMesh< DIM, DIM > &rMesh)
void SetNode(unsigned index, ChastePoint< DIM > &rNewLocation)
virtual const std::vector< boost::shared_ptr< AbstractUpdateRule< DIM > > > GetUpdateRuleCollection() const
std::set< unsigned > GetNeighbouringNodeIndices(unsigned index)
virtual void RemoveAllUpdateRules()
bool GetIterateRandomlyOverUpdateRuleCollection()
void SetIterateRandomlyOverUpdateRuleCollection(bool iterateRandomly)