Gadget
Public Member Functions | List of all members
MigrationFunction Class Reference

This is the class used to calculate the migration of a stock within the model based on a migration function. More...

#include <migration.h>

Inheritance diagram for MigrationFunction:
Inheritance graph
Collaboration diagram for MigrationFunction:
Collaboration graph

Public Member Functions

 MigrationFunction (CommentStream &infile, const IntVector &areas, const AreaClass *const Area, const TimeClass *const TimeInfo, const char *givenname, Keeper *const keeper)
 This is the MigrationFunction constructor. More...
 
 ~MigrationFunction ()
 This is the default MigrationFunction destructor. More...
 
void Reset ()
 This function will reset the migration data. More...
 
void Print (ofstream &outfile)
 This function will print the migration data. More...
 
const DoubleMatrixgetMigrationMatrix (const TimeClass *const TimeInfo)
 This will return the migration matrix that has been calculated. More...
 
virtual int isMigrationStep (const TimeClass *const TimeInfo)
 This will check if the migration process will take place on the current timestep. More...
 
- Public Member Functions inherited from Migration
 Migration (const IntVector &areas, const char *givenname)
 This is the default Migration constructor. More...
 
virtual ~Migration ()
 This is the default Migration destructor. More...
 
const DoubleVectorgetPenalty () const
 This will return the penalty that has been calculated due to invalid migration. 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...
 

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...
 
- Protected Attributes inherited from Migration
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...
 

Detailed Description

This is the class used to calculate the migration of a stock within the model based on a migration function.

Constructor & Destructor Documentation

◆ MigrationFunction()

MigrationFunction::MigrationFunction ( CommentStream infile,
const IntVector areas,
const AreaClass *const  Area,
const TimeClass *const  TimeInfo,
const char *  givenname,
Keeper *const  keeper 
)

This is the MigrationFunction constructor.

Parameters
areasis the IntVector of areas that the migration will be calculated on
infileis the CommentStream to read the migration data from
Areais the AreaClass for the current model
TimeInfois the TimeClass for the current model
givennameis the name of the stock for this Migration class
keeperis the Keeper for the current model

◆ ~MigrationFunction()

MigrationFunction::~MigrationFunction ( )

This is the default MigrationFunction destructor.

Member Function Documentation

◆ getMigrationMatrix()

const DoubleMatrix & MigrationFunction::getMigrationMatrix ( const TimeClass *const  TimeInfo)
virtual

This will return the migration matrix that has been calculated.

Parameters
TimeInfois the TimeClass for the current model
Returns
migration, a DoubleMatrix of the calculated migration

Implements Migration.

◆ isMigrationStep()

int MigrationFunction::isMigrationStep ( const TimeClass *const  TimeInfo)
virtual

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

Parameters
TimeInfois the TimeClass for the current model
Returns
1 if the migration process will take place, 0 otherwise

Implements Migration.

◆ Print()

void MigrationFunction::Print ( ofstream &  outfile)
virtual

This function will print the migration data.

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

Implements Migration.

◆ Reset()

void MigrationFunction::Reset ( )
virtual

This function will reset the migration data.

Implements Migration.


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