ModelObject Class Reference

Generic class for storing object informations. More...

#include <ModelObject.h>

Inheritance diagram for ModelObject:

Inheritance graph
[legend]
Collaboration diagram for ModelObject:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModelObject (ThreadManager *MTHREAD_h)
 ~ModelObject ()
double getResourceValue (string resourceName_h)
 Return the effects of this object on a specific resource.
void setRandomAge ()
string getName () const
string getObjectTypology () const
string getObjectSubTypology () const
string getComment () const
double getMatrixGrossMargin () const
double getInitialCost () const
map< string, double > getMatrixObjRes () const
vector< int > getRequiredLandUseCodes () const
string getRequiredFor () const
vector< double > getMatrixCoefficients ()
 Name of the activity it is required for (only sp. obj) return the ordered list of coefficients for the matrix.
bool getSpatiallyExplicit () const
Agent_basegetOwner ()
double getCurrentValue (bool endOfYear=false)
 get current value. For now it is derived from a simple linear depretiation, later on we can change this function according to the object type
int getLastYear ()
 last year before this object will go out of temporal scope
int getStartYear ()
int getLifeTerm ()
int getAge ()
int getRemainingAge ()
void setName (string name_h)
void setType (string type_h)
void setSubType (string subType_h)
void setComment (string comment_h)
void setLifeTerm (int lifeTerm_h)
void setStartYear (int year_h)
void setMatrixGrossMargin (double matrixGrossMargin_h)
void setInitialCost (double initialCost_h)
void setMatrixObjRes (map< string, double > matrixObjRes_h)
void setRequiredFor (string activityName_h)
void setOwner (Agent_base *owner_h)

Protected Attributes

string name
string type
string subType
string comment
int lifeTerm
 how many years the object can live. lifeTerm= lastYear-startYear The object start with age=0 and is destroied at the end of year when it reach lifeTerm-1
int startYear
 year when the object was created
double matrixGrossMargin
double initialCost
map< string, double > matrixObjRes
vector< int > requiredLandUseCodes
 a vector of Corine land use codes where this objects can be performed.
bool spatiallyExplicit
 true if the object is spacially explicit (is permanently linked with one plot)
Agent_baseowner
Agent_baseuser
string requiredFor
 Activity for which this (spatial) object is required for.

Friends

void RegData::setObjectsDefinitions ()

Detailed Description

Generic class for storing object informations.

This class keeps instances of all objects of the model.
Objects can be spatially explicit or implicit.
In the former case, the change on deploy them will depend on specific plots with a compatible land use type and with the absence of uncompatible objects (eg. for perennial crops, of other perennial crops).

Author:
Antonello Lobianco

Definition at line 39 of file ModelObject.h.


Constructor & Destructor Documentation

ModelObject ( ThreadManager MTHREAD_h  ) 

Definition at line 24 of file ModelObject.cpp.

~ModelObject (  ) 

Definition at line 32 of file ModelObject.cpp.


Member Function Documentation

double getResourceValue ( string  resourceName_h  ) 

Return the effects of this object on a specific resource.

Definition at line 36 of file ModelObject.cpp.

void setRandomAge (  ) 

Set random age is called at init time, so currentAge is set anywhere from 1 to lifeTerm-1

Definition at line 49 of file ModelObject.cpp.

Referenced by Pixel::acquireObject(), and Agent_base::acquireObject().

Here is the caller graph for this function:

string getName (  )  const [inline]

Definition at line 50 of file ModelObject.h.

string getObjectTypology (  )  const [inline]

Definition at line 51 of file ModelObject.h.

string getObjectSubTypology (  )  const [inline]

Definition at line 52 of file ModelObject.h.

string getComment (  )  const [inline]

Definition at line 53 of file ModelObject.h.

double getMatrixGrossMargin (  )  const [inline]

Definition at line 54 of file ModelObject.h.

double getInitialCost (  )  const [inline]

Definition at line 55 of file ModelObject.h.

map<string, double> getMatrixObjRes (  )  const [inline]

Definition at line 56 of file ModelObject.h.

vector<int> getRequiredLandUseCodes (  )  const [inline]

Definition at line 57 of file ModelObject.h.

string getRequiredFor (  )  const [inline]

Definition at line 58 of file ModelObject.h.

vector< double > getMatrixCoefficients (  ) 

Name of the activity it is required for (only sp. obj) return the ordered list of coefficients for the matrix.

Definition at line 55 of file ModelObject.cpp.

bool getSpatiallyExplicit (  )  const [inline]

Definition at line 60 of file ModelObject.h.

Agent_base* getOwner (  )  [inline]

Definition at line 61 of file ModelObject.h.

double getCurrentValue ( bool  endOfYear = false  ) 

get current value. For now it is derived from a simple linear depretiation, later on we can change this function according to the object type

Parameters:
endOfYear Optional parameter to specify that the value requested is those that the object has at the end of the year

Definition at line 70 of file ModelObject.cpp.

int getLastYear (  )  [inline]

last year before this object will go out of temporal scope

Definition at line 66 of file ModelObject.h.

Referenced by Pixel::acquireObject().

Here is the caller graph for this function:

int getStartYear (  )  [inline]

Definition at line 67 of file ModelObject.h.

int getLifeTerm (  )  [inline]

Definition at line 68 of file ModelObject.h.

Referenced by getRemainingAge().

Here is the caller graph for this function:

int getAge (  ) 

Definition at line 79 of file ModelObject.cpp.

Referenced by getCurrentValue(), and getRemainingAge().

Here is the caller graph for this function:

int getRemainingAge (  )  [inline]

Definition at line 70 of file ModelObject.h.

void setName ( string  name_h  )  [inline]

Definition at line 72 of file ModelObject.h.

void setType ( string  type_h  )  [inline]

Definition at line 73 of file ModelObject.h.

void setSubType ( string  subType_h  )  [inline]

Definition at line 74 of file ModelObject.h.

void setComment ( string  comment_h  )  [inline]

Definition at line 75 of file ModelObject.h.

void setLifeTerm ( int  lifeTerm_h  )  [inline]

Definition at line 76 of file ModelObject.h.

void setStartYear ( int  year_h  )  [inline]

Definition at line 77 of file ModelObject.h.

Referenced by Pixel::acquireObject(), and Agent_base::acquireObject().

Here is the caller graph for this function:

void setMatrixGrossMargin ( double  matrixGrossMargin_h  )  [inline]

Definition at line 78 of file ModelObject.h.

void setInitialCost ( double  initialCost_h  )  [inline]

Definition at line 79 of file ModelObject.h.

void setMatrixObjRes ( map< string, double >  matrixObjRes_h  )  [inline]

Definition at line 80 of file ModelObject.h.

void setRequiredFor ( string  activityName_h  )  [inline]

Definition at line 81 of file ModelObject.h.

void setOwner ( Agent_base owner_h  )  [inline]

Definition at line 82 of file ModelObject.h.

Referenced by Pixel::acquireObject(), and Agent_base::acquireObject().

Here is the caller graph for this function:


Friends And Related Function Documentation

void RegData::setObjectsDefinitions (  )  [friend]


Member Data Documentation

string name [protected]

Definition at line 86 of file ModelObject.h.

Referenced by getName(), and setName().

string type [protected]

Definition at line 87 of file ModelObject.h.

Referenced by getObjectTypology(), and setType().

string subType [protected]

Definition at line 88 of file ModelObject.h.

Referenced by getObjectSubTypology(), and setSubType().

string comment [protected]

Definition at line 89 of file ModelObject.h.

Referenced by getComment(), and setComment().

int lifeTerm [protected]

how many years the object can live. lifeTerm= lastYear-startYear The object start with age=0 and is destroied at the end of year when it reach lifeTerm-1

Definition at line 91 of file ModelObject.h.

Referenced by getCurrentValue(), getLastYear(), getLifeTerm(), setLifeTerm(), and setRandomAge().

int startYear [protected]

year when the object was created

Definition at line 93 of file ModelObject.h.

Referenced by getAge(), getLastYear(), getStartYear(), ModelObject(), setRandomAge(), and setStartYear().

double matrixGrossMargin [protected]

Definition at line 94 of file ModelObject.h.

Referenced by getMatrixGrossMargin(), and setMatrixGrossMargin().

double initialCost [protected]

Definition at line 95 of file ModelObject.h.

Referenced by getCurrentValue(), getInitialCost(), and setInitialCost().

map<string, double> matrixObjRes [protected]

MIP matrix

Definition at line 96 of file ModelObject.h.

Referenced by getMatrixCoefficients(), getMatrixObjRes(), getResourceValue(), and setMatrixObjRes().

vector<int> requiredLandUseCodes [protected]

a vector of Corine land use codes where this objects can be performed.

Definition at line 98 of file ModelObject.h.

Referenced by getRequiredLandUseCodes().

bool spatiallyExplicit [protected]

true if the object is spacially explicit (is permanently linked with one plot)

Definition at line 100 of file ModelObject.h.

Referenced by getSpatiallyExplicit().

Agent_base* owner [protected]

Definition at line 101 of file ModelObject.h.

Referenced by getOwner(), ModelObject(), and setOwner().

Agent_base* user [protected]

Definition at line 102 of file ModelObject.h.

Referenced by ModelObject().

string requiredFor [protected]

Activity for which this (spatial) object is required for.

Definition at line 103 of file ModelObject.h.

Referenced by getRequiredFor(), ModelObject(), and setRequiredFor().


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