Class DataPoint¶
- Defined in File DataPoint.h
Inheritance Relationships¶
Base Type¶
public necsim::MapLocation
(Struct MapLocation)
Class Documentation¶
-
class
DataPoint
: public virtual necsim::MapLocation¶ A data object used in coalescence simulations for calculating the output. Data from this object is outputted to an SQLite database after simulations are complete.
Public Functions
-
DataPoint
()¶ Standard constructor.
-
~DataPoint
()¶ Standard destructor.
-
void
setup
(unsigned long x, unsigned long y, long xwrap_in, long ywrap_in, unsigned long reference_in, unsigned long list_position_in, double min_max_in)¶ Setup of lineage data with any information that’s wanted. Note that nwrap is set to 0 in this routine.
- Parameters
x
: the x position on the gridy
: the y position on the gridxwrap_in
: the number of wraps of the location on the grid in the x directionywrap_in
: the number of wraps of the location on the grid in the y directionreference_in
: the position in the TreeNode reference objectlist_position_in
: the position within the SpeciesList object at the relevant x,y positionmin_max_in
: the input maximum minimum speciation rate required for speciation to have occured
-
void
setup
(unsigned long reference_in, unsigned long list_position_in, double min_max_in)¶ Setup of lineage data with any information that’s wanted.
- Parameters
reference_in
: the reference point for the TreeNode reference objectlist_position_in
: the list position of this lineage in SpeciesList objectmin_max_in
: the input maximum minimum speciation rate required for speciation to have occured
-
void
setup
(const DataPoint &datin)¶ Copy constructor from another Datapoint object.
- Parameters
datin
: a Datapoint object to copy the data from.
-
void
setReference
(unsigned long z)¶ Sets the mpos (the position within the Row of TreeNode objects.).
- Parameters
z
: the desired mpos.
-
void
setNext
(unsigned long x)¶ Set the next link in the linked list.
- Parameters
x
: the next Datapoint object.
-
void
setListPosition
(unsigned long l)¶ Sets the list position within the SpeciesList object.
- Parameters
l
: the input list position.
-
void
setNwrap
(unsigned long n)¶ Sets the number of wraps from the first SpeciesList wrapped lineage. If and only if this is 0, the lineage is within the main grid (i.e xwrap and ywrap should be 0).
- Parameters
n
: the desired nwrap.
-
void
setMinmax
(double d)¶ Sets the minmax variable. This is the minimum maximum speciation rate required for speciation to have occured on this branch.
- Parameters
d
: the minmax to set.
-
unsigned long
getXpos
() const¶ Get the x position.
- Return
- the xpos.
-
unsigned long
getYpos
() const¶ Get the y position.
- Return
- the ypos.
-
long
getXwrap
() const¶ Get the x wrapping.
- Return
- the xwrap.
-
long
getYwrap
() const¶ Get the y wrapping.
- Return
- the ywrap.
-
unsigned long
getReference
() const¶ Get the reference position variable.
- Return
- the mpos.
-
unsigned long
getNext
() const¶ Gets the next element linked to this DataPoint.
- Return
- the reference of the next individual in the linked list
-
unsigned long
getListpos
() const¶ Gets the list position with the SpeciesList object at the relevant x,y position.
- Return
- the listpos.
-
unsigned long
getNwrap
() const¶ Get the position in the linked list from the SpeciesList object. If this is 0, indicates the lineage lies on the original grid, and xwrap and ywrap should be 0.
- Return
- the nwrap.
-
double
getMinmax
() const¶ Get the maximum minimum speciation rate required for speciation to have occured on this branch.
- Return
- the minmax.
-
void
decreaseNwrap
()¶ Decreases the nwrap by 1 (to a minimum of 0).
-
template<class
T
>
voidsetEndpoint
(const T &location)¶ Sets the position in space.
- Parameters
location
: the location of the new end point
-
bool
isOnGrid
() const Checks if the location is directly on the grid without wrapping (i.e. xwrap and ywrap are 0).
- Return
- true if on the grid
-
bool
operator==
(MapLocation const &m) const Equality operator for MapLocation.
- Return
- true if the x, y, xwrap and ywrap are identical
- Parameters
m
: the MapLocation object to compare against
-
bool
operator!=
(MapLocation const &m) const Inequality operator for MapLocation.
- Return
- true if locations are not identical
- Parameters
m
: the MapLocation object to compare against
Public Members
-
long
x
-
long
y
-
long
xwrap
-
long
ywrap
Friends
-
ostream &
operator<<
(ostream &os, const DataPoint &d)¶ An operator for piping the variables of the Datapoint object to the output stream.
- Return
- returns the output stream at the end.
- Parameters
os
: the output stream.d
: the Datapoint object to output.
-
istream &
operator>>
(istream &is, DataPoint &d)¶ An operator for piping the variables in to the Datapoint object from the input stream.
- Return
- returns the input stream at the end.
- Parameters
is
: the input streamd
: the Datapoint object to input to.
-