Version 1.2 (June 2013)
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Public Attributes | Protected Attributes | List of all members
simulator.agent.Species Class Reference

Creates and manages the species that are to be included in an iDynoMiCS simulation. More...

Inheritance diagram for simulator.agent.Species:

Public Member Functions

 Species (Simulator aSimulator, XMLParser aSpRoot)
 Creates a species object from that specified in the XML protocol file. More...
 
 Species (SpecialisedAgent aProgenitor)
 Create a species from a set progenitor. More...
 
void register (Simulator aSimulator, XMLParser aSpRoot)
 Registers the created species to the simulation speciesManager. More...
 
void createPop (XMLParser spRoot)
 Used in 'one-time' attachment scenarios, where clones of the progenitor are created in the birth area of the substratum. More...
 
void createBoundaryLayerPop (XMLParser spRoot, double numberAttachedInjectedAgents)
 For self-attachment scenarios, initialises agents on the boundary layer rather than substrarum, and models their swim to the surface or biofilm. More...
 
int performRunAndTumble (XMLParser spRoot)
 For self-attachment scenarios, performs the run and tumble motion of a swimming cell, and the required position checks and corrections. More...
 
void setAgentAngleOfMovement ()
 Set the angles an agent is to move in this tumble. If the domain is 3D, a move will involve calculation of. More...
 
void calculateNewAgentPosition (double distanceAgentMoves)
 For self-attachment scenarios, calculates the new position of the agent based on XY and XZ angles and a distance to move. More...
 
int agentMoveBorderCheck (double distanceMoving)
 For self-attachment scenarios, determines whether a swimming agents move has taken it across a boundary, correcting the coordinate accordingly. More...
 
int checkAgentMove (double distanceMoving)
 Used for self-attachment scenarios, to check the move of a swimming agent (crossed boundaries, hit surface, or hit biofilm) More...
 
double determineDistanceOverBoundary (double newCoordinate, double lengthOfSide, AllBC boundaryCrossed)
 Utility for determining how far a moving agent has moved past a boundary. Used in cyclic boundaries. More...
 
void correctCrossedLeftRightBoundaries (AllBC boundaryCrossed, double distanceMoving)
 For self-attach scenarios, corrects 2D coordinates that have crossed the left of right boundary (x0z and xNz) More...
 
void correctCrossedFrontBackBoundaries (AllBC boundaryCrossed, double distanceMoving)
 For self-attach scenarios, corrects 3D coordinates that have crossed the front or back boundary (x0y and xNy) More...
 
boolean isNewCoordAboveBoundaryLayer ()
 Determine if a swimming agent has left the boundary layer and returned to the bulk. More...
 
int checkForBioFilmContact (double distanceMoving)
 Determines whether a swimming agent has come into contact with the forming biofilm. More...
 
boolean isAgentInContactWithAgentInBiofilm (int gridIndex, double distanceSeekingAgent)
 Examines all the agents within a voxel of the agent-grid, to determine if a swimming agent is in contact with an agent in the biofilm. More...
 
void notifyBirth ()
 Increases the population of this species when one agent is added. More...
 
void notifyDeath ()
 Reduces the population of this species when one agent is removed. More...
 
SpecialisedAgent sendNewAgent () throws CloneNotSupportedException
 Returns a clone of the progenitor of this species. More...
 
int getPopulation ()
 Returns the population count of this species. More...
 
SpecialisedAgent getProgenitor ()
 Return the progenitor of this species object. More...
 
SpeciesParam getSpeciesParam ()
 Return the parameters associated with this species (a SpeciesParam object) More...
 
Species getSpecies (String speciesName)
 Return the species object for a given species name. More...
 
ContinuousVector[] defineSquareArea (XMLParser spRoot)
 Defines a region of the computation domain where a new species may be created, using restrictions in the protocol file. More...
 
void shuffleCoordinates (ContinuousVector cc, ContinuousVector[] area)
 Select random coordinates for the new agent within a restricted birth area. More...
 

Public Attributes

Simulator currentSimulator
 
String speciesName
 
int speciesIndex
 
Color color
 
Domain domain
 
ContinuousVector swimmingAgentPosition
 
double cellInjectionStartHour
 
double injectionOnAttachmentFrequency
 
double cellInjectionEndHour
 
double injectionOffAttachmentFrequency
 
double newAgentCounter
 
double angleOfMovingAgentXY
 
double angleOfMovingAgentXZ
 

Protected Attributes

SpecialisedAgent _progenitor
 
int _population = 0
 

Detailed Description

Creates and manages the species that are to be included in an iDynoMiCS simulation.

The Species class creates and manages the species that are to be included in an iDynoMiCS simulation. This includes the creation of the required number of agents, registering that this agent has been born, and reducing the count of active agents when the agent dies. The species each exist on their own grid, again initialised here. From version 1.2 of iDynoMiCS, this class also manages agent input for both one-time and self attachment scenarios.

Author
Andreas Dötsch (andre.nosp@m.as.d.nosp@m.oetsc.nosp@m.h@he.nosp@m.lmhol.nosp@m.tz-h.nosp@m.zi.de), Helmholtz Centre for Infection Research (Germany)
Laurent Lardon (lardo.nosp@m.nl@s.nosp@m.upagr.nosp@m.o.in.nosp@m.ra.fr), INRA, France
Sónia Martins (SCM80.nosp@m.8@bh.nosp@m.am.ac.nosp@m..uk), Centre for Systems Biology, University of Birmingham (UK)
Kieran Alden (k.j.a.nosp@m.lden.nosp@m.@bham.nosp@m..ac..nosp@m.uk), Centre for Systems Biology, University of Birmingham (UK)

Constructor & Destructor Documentation

simulator.agent.Species.Species ( Simulator  aSimulator,
XMLParser  aSpRoot 
)

Creates a species object from that specified in the XML protocol file.

This method takes an object specified in the SPECIES mark-up and creates a simulation object for that species

Parameters
aSimulatorThe simulation object used to simulate the conditions specified in the protocol file
aSpRootA Species mark-up within the specified protocol file
simulator.agent.Species.Species ( SpecialisedAgent  aProgenitor)

Create a species from a set progenitor.

Create a species from a set progenitor

Parameters
aProgenitorProgenitor from which the species is being created

Member Function Documentation

int simulator.agent.Species.agentMoveBorderCheck ( double  distanceMoving)

For self-attachment scenarios, determines whether a swimming agents move has taken it across a boundary, correcting the coordinate accordingly.

For self-attachment scenarios, the agents are swimming through the domain, and we need to ensure that they perform the correct behaviour when the boundary is met. This method checks whether an agents move has taken it over the boundary and applies the relevant correction (either a bounce off the boundary or a reappearance on the other side). If the cell has hit the surface, the cell is deemed to have adhered to that surface and a relevant x coordinate generated to note that this is the case. The top of the domain is dealt with differently, as this is checked by the call to isNewCoordAboveBoundaryLayer, which determines if the agent has moved out of the boundary layer. If this is the case we assume this cell to have returned to the bulk and do no further action with that cell. An integer is returned noting the fate of this move - a 0 if the move is ok (after adjustment if required), a 1 if the agent has met the substratum and attached, and a 2 if the cell has returned to the bulk

Parameters
distanceMovingDistance the agent is moving (in microns) in this move
Returns
Integer noting the fate of this move (0 move ok (after adjustment if required), 1 if attached to surface, 2 if returned to bulk
void simulator.agent.Species.calculateNewAgentPosition ( double  distanceAgentMoves)

For self-attachment scenarios, calculates the new position of the agent based on XY and XZ angles and a distance to move.

For self-attachment scenarios, calculates the new position of the agent based on XY and XZ angles and a distance to move. No return value as the global swimmingAgentPosition is altered. The angles XY and XZ are also global parameters as these can also be altered by other methods in the swimming agent position checks

Parameters
distanceAgentMovesDistance that the agent is to move
int simulator.agent.Species.checkAgentMove ( double  distanceMoving)

Used for self-attachment scenarios, to check the move of a swimming agent (crossed boundaries, hit surface, or hit biofilm)

In self-attachment scenarios, the cells move about a lot in each step. This method is employed to check whether the determined move is suitable. Any move may take the agent across a boundary, which needs to be detected, and across the biofilm surface, which is what we are aiming to hit. We also need to detect any contact with agents that are already part of a forming biofilm. This method calls others that checks whether the generated move is suitable. The return is an integer value: 0 noting that the move is ok but there is no attachment (to biofilm or surface), 1 that notes the agent has met the surface or biofilm, and 2 noting that the agent has returned to the bulk

Parameters
distanceMovingDistance that the swimming agent is moving in this particular move
Returns
Integer value denoting the result of this move (0 no attachment, 1 attachment, 2 return to bulk)
int simulator.agent.Species.checkForBioFilmContact ( double  distanceMoving)

Determines whether a swimming agent has come into contact with the forming biofilm.

For self-attachment scenarios, iDynoMiCS will have so far checked whether the swimming agent has crossed any of the boundaries, or hit the substratum. Now we need to determine if the agent has met any other agents that are on the biofilm surface. If this is the case, we assume that the agent sticks and becomes part of the biofilm structure. If not, the run and tumble motion continues. An integer is returned noting the result - 0 if there is no attachment to any part of the biofilm, 1 if the agent is either in contact with the biofilm or has hit the substratum surface, and 2 if the agents move results in a return to the bulk

Author
Kieran Alden
Parameters
distanceMovingThe distance (in microns) that the agent is swimming through the domain
Returns
Integer between 0 and 2, noting no attachment (0), contact with the biofilm or surface (1), or return to the bulk (2)
void simulator.agent.Species.correctCrossedFrontBackBoundaries ( AllBC  boundaryCrossed,
double  distanceMoving 
)

For self-attach scenarios, corrects 3D coordinates that have crossed the front or back boundary (x0y and xNy)

For self-attach scenarios, corrects 3D coordinates that have crossed the front or back boundary (x0y and xNy). The coordinate is either placed on the opposite side for cyclic boundaries, or bounces off the boundary at the required angle

Parameters
boundaryCrossedThe boundary that has been detected to have been crossed
distanceMovingThe distance that the cell is moving in this step of its repositioning
void simulator.agent.Species.correctCrossedLeftRightBoundaries ( AllBC  boundaryCrossed,
double  distanceMoving 
)

For self-attach scenarios, corrects 2D coordinates that have crossed the left of right boundary (x0z and xNz)

For self-attach scenarios, corrects 2D coordinates that have crossed the left of right boundary (x0z and xNz). The coordinate is either placed on the opposite side for cyclic boundaries, or bounces off the boundary at the required angle

Parameters
boundaryCrossedThe boundary that has been detected to have been crossed
distanceMovingThe distance that the cell is moving in this step of its repositioning
void simulator.agent.Species.createBoundaryLayerPop ( XMLParser  spRoot,
double  numberAttachedInjectedAgents 
)

For self-attachment scenarios, initialises agents on the boundary layer rather than substrarum, and models their swim to the surface or biofilm.

For self-attachment scenarios, the agents are initialised at the top of the boundary layer rather than on the substratum. These agents then perform a 'run and tumble' motion until they either attach to the substratum or forming biofilm. This method captures this behaviour for cells that are created for a time step. Once this swimming action has been performed, the agent is created at its final position. Note that input of agents onto the boundary layer is decided by a parameter set in the protocol file, cellAttachmentFrequency, measured in hours. The number of cells is adjusted to suit the global time step that is being used. Also note that this injection of cells can be for a set period (specified in the protocol file as parameter cellInjectionPeriod), or can be stopped and started (modelling a 'settling' period) using parameters cellInjectionOffPeriod and cellInjectionStopHour. This is explained in detail in the tutorial for version 1.2 of iDynoMiCS.

Parameters
spRootThe Species markup from the protocol file for one particular species being initialised
numberAttachedInjectedAgentsThe number of agents of this type that need to be created in this global timestep
void simulator.agent.Species.createPop ( XMLParser  spRoot)

Used in 'one-time' attachment scenarios, where clones of the progenitor are created in the birth area of the substratum.

Used in 'one-time' attachment scenarios, where clones of the progenitor are created in the birth area of the substratum

Parameters
spRootThe XML mark-up group for a particular species being created
ContinuousVector [] simulator.agent.Species.defineSquareArea ( XMLParser  spRoot)

Defines a region of the computation domain where a new species may be created, using restrictions in the protocol file.

Defines a region of the computation domain where a new species may be created, using restrictions in the protocol file. These restrictions for a particular species are specified in 'coordinates' tags. There should be two such tags where this is used - one to start the restriction and one to end it. Example of use: <coordinates x="0" y="0" z="0"/> <coordinates x="1" y="264" z="0"/>. This method will read these in and create an array that represents this area

Parameters
spRootThe information within the 'initArea' tags of the protocol file
Returns
A continuous vector representing the area of the domain specified in these tags
double simulator.agent.Species.determineDistanceOverBoundary ( double  newCoordinate,
double  lengthOfSide,
AllBC  boundaryCrossed 
)

Utility for determining how far a moving agent has moved past a boundary. Used in cyclic boundaries.

Utility for determining how far a moving agent has moved past a boundary. Used in cyclic boundaries where if an agent has moved past a boundary yet should appear that distance on the other side

Parameters
newCoordinateThe new coordinate that is over the boundary
lengthOfSideThe length of that side of the domain
boundaryCrossedThe boundary that has been crossed in this agents move
Returns
Double noting the distance that this agent should reappear on the opposite side
int simulator.agent.Species.getPopulation ( )

Returns the population count of this species.

Returns the population count of this species

Returns
Integer value noting the population of this species
SpecialisedAgent simulator.agent.Species.getProgenitor ( )

Return the progenitor of this species object.

Return the progenitor of this species object

Returns
The progenitor of this species object
Species simulator.agent.Species.getSpecies ( String  speciesName)

Return the species object for a given species name.

Return the species object for a given species name

Parameters
speciesNameText string containing the name of this species
Returns
Species object named with the given text string
SpeciesParam simulator.agent.Species.getSpeciesParam ( )

Return the parameters associated with this species (a SpeciesParam object)

Return the parameters associated with this species. These are contained within a SpeciesParam object

Returns
SpeciesParam object associated with this Species
boolean simulator.agent.Species.isAgentInContactWithAgentInBiofilm ( int  gridIndex,
double  distanceSeekingAgent 
)

Examines all the agents within a voxel of the agent-grid, to determine if a swimming agent is in contact with an agent in the biofilm.

To determine if a swimming cell is near contact with the biofilm surface, the agent checks the status of the agent grid voxel it resides within. If this is 1, this is noted as having agents within it that are within the biofilm structure. The agent now examines how close it is to each of these agents. If within a certain distance (radius + stickiness constant), then the agent is deemed to have adhered to the structure. Any overlap will be addressed during shoving analysis. If not, the agent will perform another move.

Author
Kieran Alden
Parameters
gridIndexThe index of the agent grid to be checked
distanceSeekingAgentThe distance within which two cells are deemed to be in contact
Returns
Boolean noting whether the agent is in contact with an agent in the biofilm
boolean simulator.agent.Species.isNewCoordAboveBoundaryLayer ( )

Determine if a swimming agent has left the boundary layer and returned to the bulk.

For self attachment, an agent starts at the top of the boundary layer and swims in a random direction until it attaches somewhere. If however it returns to the bulk, we assume this cell does not return. This method checks the move to determine if the cell is moving in a trajectory that has returned it to the bulk

Returns
Boolean stating whether the cell has returned to the bulk
void simulator.agent.Species.notifyBirth ( )

Increases the population of this species when one agent is added.

Increases the population of this species when one agent is added

void simulator.agent.Species.notifyDeath ( )

Reduces the population of this species when one agent is removed.

Reduces the population of this species when one agent is removed

int simulator.agent.Species.performRunAndTumble ( XMLParser  spRoot)

For self-attachment scenarios, performs the run and tumble motion of a swimming cell, and the required position checks and corrections.

For self-attachment scenarios, the agents enter the system on top of the boundary layer and perform a run and tumble motion, swimming through the biofilm. This method captures that motion. A random angle is chosen and the cell moves at a certain distance, set by cell tumble speed in the protocol file. The agent may move back into the bulk, where we assume it will go back into the mix and thus we take no further action with it. The aim is for that cell to swim around until it either hits the substratum surface or biofilm surface, where it will attach. If the agent does not attach in this distance, a new angle is chosen (a 'tumble') and this is repeated. This method takes care of all checks to the coordinates (such as a crossed boundary and hitting the surface/biofilm). An integer value is returned that states the fate of this move - the cell has either not attached anywhere (0), and thus needs to tumble, the cell has attached (1), or the cell has returned to the bulk (2).

Author
Kieran Alden
Parameters
spRootThe Species markup from the protocol file for one particular species being initialised
Returns
Integer value noting the fate of this move (0 no attachment, 1 attachment, 2 returned to bulk)
void simulator.agent.Species.register ( Simulator  aSimulator,
XMLParser  aSpRoot 
)

Registers the created species to the simulation speciesManager.

Registers the created species to the simulation speciesManager

Parameters
aSimulatorThe simulator object being used to create the conditions specified in the protocol file
aSpRootXML markup for the species being created. Taken from the protocol file
SpecialisedAgent simulator.agent.Species.sendNewAgent ( ) throws CloneNotSupportedException

Returns a clone of the progenitor of this species.

Returns a clone of the progenitor of this species. Throws an exception if this clone cannot be found

Returns
a clone of the progenitor
Exceptions
CloneNotSupportedException
void simulator.agent.Species.setAgentAngleOfMovement ( )

Set the angles an agent is to move in this tumble. If the domain is 3D, a move will involve calculation of.

Set the angles an agent is to move in this tumble. If the domain is 3D, a move will involve calculation of two angles. This is done using a random number generator

void simulator.agent.Species.shuffleCoordinates ( ContinuousVector  cc,
ContinuousVector[]  area 
)

Select random coordinates for the new agent within a restricted birth area.

Select random coordinates for the new agent within a restricted birth area. This restricted area is set within the protocol file, and defined as a ContinuousVector by the method defineSquareArea

Parameters
ccContinuousVector that will hold the coordinates of this agent
areaArea within which these coordinates should be restricted

Member Data Documentation

int simulator.agent.Species._population = 0
protected

Count of the population of this particular species in the simulation

SpecialisedAgent simulator.agent.Species._progenitor
protected

Specialised agent from which objects of this species are created

double simulator.agent.Species.angleOfMovingAgentXY

For self-attaching species, this holds the XY angle the cell is moving. This is global as this may change due to bouncing of boundaries

double simulator.agent.Species.angleOfMovingAgentXZ

For self-attaching species, this holds the XZ angle the cell is moving (if 3D). This is global as this may change due to bouncing of boundaries

double simulator.agent.Species.cellInjectionEndHour

For self-attachment scenarios, the hour at which the injection of cells into the domain will stop

double simulator.agent.Species.cellInjectionStartHour

For self-attachment scenarios, the hour at which the injection of cells into the domain will start

Color simulator.agent.Species.color

Colour used to distinguish this species in POV-Ray output images

Simulator simulator.agent.Species.currentSimulator

Local copy of the simulation object that is creating the state specified in the protocol file

Domain simulator.agent.Species.domain

Computational domain that this species is associated with

double simulator.agent.Species.injectionOffAttachmentFrequency

For self-attachment scenarios, the frequency (agents per hour) that attach to the substratum surface when entering from the boundary layer, when cells are being injected into the domain

double simulator.agent.Species.injectionOnAttachmentFrequency

For self-attachment scenarios, the frequency (agents per hour) that attach to the substratum surface when entering from the boundary layer, when cells are being injected into the domain

double simulator.agent.Species.newAgentCounter

Used in self-attachment cases where the number of agents specified in the protocol file leaves a remainder per timestep. When this remainder reaches 1, a new cell is introduced to the simulation

int simulator.agent.Species.speciesIndex

The number of species in the simulation

String simulator.agent.Species.speciesName

Name of the species associated with this object. Specified in the protocol file

ContinuousVector simulator.agent.Species.swimmingAgentPosition

Stores the position of agents that are swimming below the boundary until they meet the surface or the biofilm. Used in self-attach simulations


The documentation for this class was generated from the following file: