Gadget
Public Member Functions | Protected Attributes | List of all members
Migration Class Referenceabstract

This is the base class used to calculate the migration of a stock within the model. More...

#include <migration.h>

Inheritance diagram for Migration:
Inheritance graph
Collaboration diagram for Migration:
Collaboration graph

Public Member Functions

 Migration (const IntVector &areas, const char *givenname)
 This is the default Migration constructor. More...
 
virtual ~Migration ()
 This is the default Migration destructor. More...
 
virtual void Reset ()=0
 This function will reset the migration data. More...
 
virtual void Print (ofstream &outfile)=0
 This function will print the migration data. More...
 
virtual const DoubleMatrixgetMigrationMatrix (const TimeClass *const TimeInfo)=0
 This will return the migration matrix that has been calculated. More...
 
const DoubleVectorgetPenalty () const
 This will return the penalty that has been calculated due to invalid migration. More...
 
virtual int isMigrationStep (const TimeClass *const TimeInfo)=0
 This will check if the migration process will take place on the current timestep. More...
 
- Public Member Functions inherited from HasName
 HasName ()
 This is the default HasName constructor. More...
 
virtual ~HasName ()
 This is the default HasName destructor. More...
 
 HasName (const char *givenname)
 This is the HasName constructor for a specified name. More...
 
const char * getName () const
 This will return a null terminated text string containing the name of the object. More...
 

Protected Attributes

DoubleVector penalty
 This is the DoubleVector used to store the migration penalty information. More...
 
- Protected Attributes inherited from LivesOnAreas
IntVector areas
 This is the IntVector of internal areas that the object is defined on. More...
 

Additional Inherited Members

- Protected Member Functions inherited from LivesOnAreas
void storeAreas (const IntVector &Areas)
 This function will store the internal areas to be used. More...
 
 LivesOnAreas ()
 This is the default LivesOnAreas constructor. More...
 
virtual ~LivesOnAreas ()
 This is the default LivesOnAreas destructor. More...
 
 LivesOnAreas (const IntVector &Areas)
 This is the LivesOnAreas constructor for a specified vector of areas. More...
 
int isInArea (int area) const
 This function will check whether the object is defined on a specified area. More...
 
IntVectorgetAreas ()
 This function will return the internal areas that the object is defined on. More...
 
int areaNum (int area) const
 This function will return the area associated with an internal area. More...
 

Detailed Description

This is the base class used to calculate the migration of a stock within the model.

This class moves fish from one area to another within the model. The proportion of the fish that move is calculated according to a migration matrix. The migration matrix is either specified in the input files (either directly or by specifying the ratio that move), or is calculated from a migration function, based on drift and diffusion parameters. Care is taken to ensure that the columns of the migration matrix will sum to 1, so that no fish are created or lost during the migration process. Once the migration matrix has been calculated, the fish are moved between the areas using a simple matrix multiplication function.

Note
This will always be overridden by the derived classes that actually calculate the migration

Constructor & Destructor Documentation

◆ Migration()

Migration::Migration ( const IntVector areas,
const char *  givenname 
)

This is the default Migration constructor.

Parameters
areasis the IntVector of areas that the migration will be calculated on
givennameis the name of the stock for this Migration class

◆ ~Migration()

virtual Migration::~Migration ( )
inlinevirtual

This is the default Migration destructor.

Member Function Documentation

◆ getMigrationMatrix()

virtual const DoubleMatrix& Migration::getMigrationMatrix ( const TimeClass *const  TimeInfo)
pure virtual

This will return the migration matrix that has been calculated.

Parameters
TimeInfois the TimeClass for the current model
Returns
0 (will be overridden in derived classes)

Implemented in MigrationFunction, and MigrationNumbers.

◆ getPenalty()

const DoubleVector& Migration::getPenalty ( ) const
inline

This will return the penalty that has been calculated due to invalid migration.

Returns
penalty, a DoubleVector of the calculated migration penalty

◆ isMigrationStep()

virtual int Migration::isMigrationStep ( const TimeClass *const  TimeInfo)
pure virtual

This will check if the migration process will take place on the current timestep.

Parameters
TimeInfois the TimeClass for the current model
Returns
0 (will be overridden in derived classes)

Implemented in MigrationFunction, and MigrationNumbers.

◆ Print()

virtual void Migration::Print ( ofstream &  outfile)
pure virtual

This function will print the migration data.

Parameters
outfileis the ofstream that all the model information gets sent to

Implemented in MigrationFunction, and MigrationNumbers.

◆ Reset()

virtual void Migration::Reset ( )
pure virtual

This function will reset the migration data.

Implemented in MigrationFunction, and MigrationNumbers.

Member Data Documentation

◆ penalty

DoubleVector Migration::penalty
protected

This is the DoubleVector used to store the migration penalty information.


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