00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef AGENTSPACE_H
00021 #define AGENTSPACE_H
00022
00023
00024 #include <string>
00025 #include <vector>
00026 #include <stdexcept>
00027 #include <iostream>
00028 #include <sstream>
00029 #include <algorithm>
00030
00031
00032 #include "Agent_base.h"
00033
00035
00043 class Agent_space : public Agent_base{
00044
00045 public:
00046 Agent_space(ThreadManager* MTHREAD_h, Manager_base* manager_h);
00047 Agent_space(ThreadManager* MTHREAD_h, int uniqueID_h, Manager_base* manager_h);
00048 ~Agent_space();
00049
00051 int uncompletePlotDotation (int landCode_h, int ptype=PLOTS_ALL);
00053 vector <Pixel *> getPlots(int ptype=PLOTS_ALL, int landCode_h = 0);
00055 int getNPlots(int ptype=PLOTS_ALL, int landCode_h = 0);
00056 virtual int countMyObjects();
00057 double getDistance(const Pixel* px1);
00058 double getLandCapital(){return landCapital;};
00059 virtual void update()=0;
00060 virtual void payInitialYearCosts();
00061 void freeLand();
00062
00063
00064
00065 virtual map<int,double> getInitialOwnedPlots(){return initialOwnedPlots;};
00066 virtual map<int,double> getInitialRentedPlots(){return initialRentedPlots;};
00067 int getHomeLandUseCode(){return homeLandUseCode;};
00068 Pixel* getHomePlot(){return homePlot;};
00069 virtual double getLandShPrice(){return landShPrice;};
00070
00071 void setHomeLandUseCode(int homeLandUseCode_h){homeLandUseCode = homeLandUseCode_h;};
00072 virtual void setInitialOwnedPlots(
00073 map<int,double> initialOwnedPlots_h){initialOwnedPlots=initialOwnedPlots_h;};
00074 virtual void setInitialRentedPlots(
00075 map<int,double> initialRentedPlots_h){initialRentedPlots=initialRentedPlots_h;};
00076 virtual void setHomePlot(Pixel* plot_h){homePlot = plot_h;};
00077 void addPlotToOwnedList(Pixel* px_h){ownedPlots.push_back(px_h);};
00078 void addPlotToRentedList(Pixel* px_h){rentedPlots.push_back(px_h);};
00079 void addPlotToMIP(Pixel* px_h){OPT.addPixel(px_h);};
00080 void setLandCapital(double landCapital_h){landCapital = landCapital_h;};
00081
00082 protected:
00083 Pixel * homePlot;
00084 map<int,double> initialOwnedPlots;
00085 map<int,double> initialRentedPlots;
00086 vector <Pixel *> ownedPlots;
00087 vector <Pixel *> rentedPlots;
00089 int homeLandUseCode;
00090 double landCapital;
00091 double landShPrice;
00092
00093 };
00094
00095 #endif