Agent_farmer Class Reference

Specific class to model farmer agents behaviour. More...

#include <Agent_farmer.h>

Inheritance diagram for Agent_farmer:

Inheritance graph
[legend]
Collaboration diagram for Agent_farmer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Agent_farmer (ThreadManager *MTHREAD_h, Manager_base *manager_h)
 mould only constructor
 Agent_farmer (ThreadManager *MTHREAD_h, int uniqueID_h, Manager_base *manager_h)
 real agent constructor
 ~Agent_farmer ()
virtual bool filterActivity (matrixActivities *ACT)
 This function will filter the activity for agent-specific parameters. E.g. subtract transport costs from the gm. A false return value means the activity has to be skipped.
double getShadowPrice (const Pixel *px_h, bool initSolve=false)
double offerRentalPrice (const Pixel *px_h, bool initSolve=false)
void update ()
void produce ()
virtual int leaveActivity ()
virtual void collectProductionEffects ()
double applyModulation (double grossPremium)
double getDecoupledPayments ()
double getUAA (int ptype=PLOTS_ALL)
 return UAA hectars.
double getAgrDistCost (const Pixel *px1)
void initMIP ()
void test ()
string getFadnID ()
string getFarmType ()
double getInitialDecPayment ()
int getAgrRegionNumber ()
virtual double getOverallProfit ()
 netProductionProfit + netTotalPremium - sunkCostsPaid
virtual double getGrossCoupledPremiums ()
virtual double getGrossDecoupledPayment ()
virtual double getNetTotalPremium ()
double getDecRightsByAct (int actMouldCounter, int policyPremiumCounter)
double getDecHaByActMould (int actMouldCounter, int policyPremiumCounter)
double getCachedOffer ()
void setFadnID (string fadnID_h)
void setFarmType (string farmType_h)
void setInitialDecPayment (double initialDecPayment_h)
void setCachedOffer (double cachedOffer_h)
virtual void setGrossCoupledPremiums (double grossCoupledPremiums_h)
virtual void setGrossDecoupledPayment (double grossDecoupledPayment_h)
virtual void setNetTotalPremium (double netTotalPremium_h)
void setAgrRegionNumber (int agrRegionNumber_h)

Public Attributes

double debugLandUse
 debug!!
volatile double cachedOffer

Private Attributes

string fadnID
string farmType
double initialDecPayment
int agrRegionNumber
vector< vector< double > > decRights
 This is already the average by year of the coupled premiums got during the reference period - By act mould - than premium.
vector< vector< int > > decYears
 Counter of how many years the average "decYears" has been counted for - By act mould - than premium.
vector< vector< double > > decHa
 Counter of the average hectars generating the rights (reference area) - By act mould - than premium.
double grossCoupledPremiums
 pre-modulation coupled premiums
double grossDecoupledPayment
 pre-modulation decoupled premium
double netTotalPremium
 post-modulation coupled and decoupled premiums

Friends

void Manager_farmers::setAgentMoulds ()

Detailed Description

Specific class to model farmer agents behaviour.

This is the specific derived class for farmer agents: \ Agent_base --> Agent_space --> agent_farmer \

Author:
Antonello Lobianco

Definition at line 44 of file Agent_farmer.h.


Constructor & Destructor Documentation

Agent_farmer ( ThreadManager MTHREAD_h,
Manager_base manager_h 
)

mould only constructor

Definition at line 31 of file Agent_farmer.cpp.

Agent_farmer ( ThreadManager MTHREAD_h,
int  uniqueID_h,
Manager_base manager_h 
)

real agent constructor

Definition at line 35 of file Agent_farmer.cpp.

~Agent_farmer (  ) 

Definition at line 55 of file Agent_farmer.cpp.


Member Function Documentation

bool filterActivity ( matrixActivities ACT  )  [virtual]

This function will filter the activity for agent-specific parameters. E.g. subtract transport costs from the gm. A false return value means the activity has to be skipped.

Implements Agent_base.

Definition at line 76 of file Agent_farmer.cpp.

double getShadowPrice ( const Pixel px_h,
bool  initSolve = false 
)

The function produce the shadow prire of renting an addictional plot. Do do so it firstly memorize the current value of the object function, then recalculate the OPT and solve it with the added plot and calculate the differential in the target function.
Before returning it, it puts back the OPT object to its initial value.

Parameters:
initSolve This optional flag tell if the function needs to perform an initial solving of the OPT object. Attenction! If it is set to false (default) the function will assume that the OPT is already solved on its optimal value.

Definition at line 99 of file Agent_farmer.cpp.

Referenced by offerRentalPrice().

Here is the caller graph for this function:

double offerRentalPrice ( const Pixel px_h,
bool  initSolve = false 
)

Make an offer to rent a specific plot.
It calls getShadowPrice and subtract overhall costs from it.

Parameters:
initSolve This optional flag tell if the function needs to perform an initial solving of the OPT object. Attenction! If it is set to false (default) the function will assume that the OPT is already solved on its optimal value.

Definition at line 124 of file Agent_farmer.cpp.

void update (  )  [virtual]

Implements Agent_space.

Definition at line 359 of file Agent_farmer.cpp.

void produce (  )  [inline, virtual]

Implements Agent_base.

Definition at line 55 of file Agent_farmer.h.

Referenced by Manager_farmers::landAllocation().

Here is the caller graph for this function:

int leaveActivity (  )  [virtual]

Implements Agent_base.

Definition at line 386 of file Agent_farmer.cpp.

void collectProductionEffects (  )  [virtual]

Implements Agent_base.

Definition at line 171 of file Agent_farmer.cpp.

double applyModulation ( double  grossPremium  ) 

Definition at line 297 of file Agent_farmer.cpp.

Referenced by collectProductionEffects(), and leaveActivity().

Here is the caller graph for this function:

double getDecoupledPayments (  ) 

Definition at line 433 of file Agent_farmer.cpp.

Referenced by collectProductionEffects().

Here is the caller graph for this function:

double getUAA ( int  ptype = PLOTS_ALL  ) 

return UAA hectars.

Parameters:
ptype,: plot type: PLOTS_ALL(d), PLOTS_OWNED, PLOTS_RENTED

Definition at line 158 of file Agent_farmer.cpp.

double getAgrDistCost ( const Pixel px1  ) 

Definition at line 71 of file Agent_farmer.cpp.

Referenced by filterActivity().

Here is the caller graph for this function:

void initMIP (  ) 

Definition at line 60 of file Agent_farmer.cpp.

void test (  ) 

Definition at line 66 of file Agent_farmer.cpp.

string getFadnID (  )  [inline]

Definition at line 67 of file Agent_farmer.h.

string getFarmType (  )  [inline]

Definition at line 68 of file Agent_farmer.h.

double getInitialDecPayment (  )  [inline]

Definition at line 69 of file Agent_farmer.h.

int getAgrRegionNumber (  )  [inline]

Definition at line 70 of file Agent_farmer.h.

virtual double getOverallProfit (  )  [inline, virtual]

netProductionProfit + netTotalPremium - sunkCostsPaid

Reimplemented from Agent_base.

Definition at line 72 of file Agent_farmer.h.

virtual double getGrossCoupledPremiums (  )  [inline, virtual]

Reimplemented from Agent_base.

Definition at line 73 of file Agent_farmer.h.

virtual double getGrossDecoupledPayment (  )  [inline, virtual]

Reimplemented from Agent_base.

Definition at line 74 of file Agent_farmer.h.

virtual double getNetTotalPremium (  )  [inline, virtual]

Reimplemented from Agent_base.

Definition at line 75 of file Agent_farmer.h.

double getDecRightsByAct ( int  actMouldCounter,
int  policyPremiumCounter 
) [inline]

Definition at line 76 of file Agent_farmer.h.

Referenced by Manager_farmers::removeFromModel().

Here is the caller graph for this function:

double getDecHaByActMould ( int  actMouldCounter,
int  policyPremiumCounter 
) [inline]

Definition at line 77 of file Agent_farmer.h.

Referenced by Manager_farmers::removeFromModel().

Here is the caller graph for this function:

double getCachedOffer (  )  [inline]

Definition at line 78 of file Agent_farmer.h.

void setFadnID ( string  fadnID_h  )  [inline]

Definition at line 81 of file Agent_farmer.h.

void setFarmType ( string  farmType_h  )  [inline]

Definition at line 82 of file Agent_farmer.h.

void setInitialDecPayment ( double  initialDecPayment_h  )  [inline]

Definition at line 83 of file Agent_farmer.h.

void setCachedOffer ( double  cachedOffer_h  )  [inline]

Definition at line 84 of file Agent_farmer.h.

virtual void setGrossCoupledPremiums ( double  grossCoupledPremiums_h  )  [inline, virtual]

Reimplemented from Agent_base.

Definition at line 85 of file Agent_farmer.h.

virtual void setGrossDecoupledPayment ( double  grossDecoupledPayment_h  )  [inline, virtual]

Reimplemented from Agent_base.

Definition at line 86 of file Agent_farmer.h.

virtual void setNetTotalPremium ( double  netTotalPremium_h  )  [inline, virtual]

Reimplemented from Agent_base.

Definition at line 87 of file Agent_farmer.h.

void setAgrRegionNumber ( int  agrRegionNumber_h  )  [inline]

Definition at line 88 of file Agent_farmer.h.


Friends And Related Function Documentation

void Manager_farmers::setAgentMoulds (  )  [friend]


Member Data Documentation

double debugLandUse

debug!!

Definition at line 88 of file Agent_farmer.h.

Referenced by collectProductionEffects().

volatile double cachedOffer

Definition at line 91 of file Agent_farmer.h.

Referenced by getCachedOffer(), and setCachedOffer().

string fadnID [private]

Definition at line 94 of file Agent_farmer.h.

Referenced by getFadnID(), and setFadnID().

string farmType [private]

Definition at line 95 of file Agent_farmer.h.

Referenced by getFarmType(), and setFarmType().

double initialDecPayment [private]

Definition at line 96 of file Agent_farmer.h.

Referenced by getDecoupledPayments(), getInitialDecPayment(), and setInitialDecPayment().

int agrRegionNumber [private]

Definition at line 97 of file Agent_farmer.h.

Referenced by getAgrRegionNumber(), and setAgrRegionNumber().

vector< vector<double> > decRights [private]

This is already the average by year of the coupled premiums got during the reference period - By act mould - than premium.

Definition at line 99 of file Agent_farmer.h.

Referenced by Agent_farmer(), collectProductionEffects(), getDecoupledPayments(), and getDecRightsByAct().

vector< vector<int> > decYears [private]

Counter of how many years the average "decYears" has been counted for - By act mould - than premium.

Definition at line 100 of file Agent_farmer.h.

Referenced by Agent_farmer(), and collectProductionEffects().

vector< vector<double> > decHa [private]

Counter of the average hectars generating the rights (reference area) - By act mould - than premium.

Definition at line 101 of file Agent_farmer.h.

Referenced by Agent_farmer(), collectProductionEffects(), getDecHaByActMould(), and getDecoupledPayments().

double grossCoupledPremiums [private]

pre-modulation coupled premiums

Definition at line 107 of file Agent_farmer.h.

Referenced by Agent_farmer(), collectProductionEffects(), getGrossCoupledPremiums(), and setGrossCoupledPremiums().

double grossDecoupledPayment [private]

pre-modulation decoupled premium

Definition at line 108 of file Agent_farmer.h.

Referenced by Agent_farmer(), collectProductionEffects(), getGrossDecoupledPayment(), leaveActivity(), and setGrossDecoupledPayment().

double netTotalPremium [private]

post-modulation coupled and decoupled premiums

Definition at line 109 of file Agent_farmer.h.

Referenced by Agent_farmer(), collectProductionEffects(), getNetTotalPremium(), getOverallProfit(), leaveActivity(), and setNetTotalPremium().


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