00001 /*************************************************************************** 00002 * Copyright (C) 2006-2008 by Antonello Lobianco * 00003 * http://regmas.org * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 3 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 #ifndef STDOUTPUT_H 00021 #define STDOUTPUT_H 00022 00023 //regmas headers 00024 #include "BaseRegmas.h" 00025 00026 struct AgentSurvey; 00027 class ModelObject; 00028 class Agent_base; 00029 class Pixel; 00030 00031 00033 00038 class Output: public BaseRegmas{ 00039 public: 00040 Output(ThreadManager* MTHREAD_h); 00041 ~Output(); 00042 00043 void initOutput(); 00044 void initOutputAggregatedData(); 00045 void initOutputMaps(); 00046 void initOutputDetailedData(); 00047 void initOutputLeavingAgents(); 00048 void collectData(); 00049 void print(); 00050 void printAggregatedData(); 00051 void printMaps(); 00052 void printDetailedData(); 00053 void printDebugMatrices(); 00054 char getOutputFieldDelimiter(); 00055 void printLeavingAgent(Agent_base* agent, int cause); 00056 void cleanScenario(string fileName, string scenarioName, char d); 00057 double getSurveyActivityByName(const AgentSurvey& survey, const string& actName); 00058 double getSurveyUnusedLand(const AgentSurvey& survey); 00059 00060 private: 00061 00062 vector<AgentSurvey> surveys; 00063 vector<int> abandonedAgrLandByType; 00064 vector<int> unpossessedAgrLandByType; 00065 vector<int> idleAgrLandByType; 00066 }; 00067 00068 struct AgentSurvey { 00069 int year; 00070 string agentType; 00071 int agentID; 00072 int agentMouldID; 00073 int managerID; 00074 Agent_base* agent; 00075 bool spatial; 00076 double hostPlotID; 00077 int hostPlotX; 00078 int hostPlotY; 00079 double capital; 00080 double landCapital; 00081 double objectsCapital; 00082 double labour; 00083 double liquidity; 00084 double netProductionProfit; 00085 double coupledPremiums; 00086 double decoupledPayment; 00087 double lastSunkCostsPaid; 00088 vector<int> ownedPlotsByAllTypes; 00089 vector<int> rentedPlotsByAllTypes; 00090 vector<int> ownedObjectsByType; 00091 vector<int> availableObjectsByType; 00092 vector<int> newlyAvailableObjectsByType; 00093 vector<double> activitiesByType; 00094 }; 00095 00096 #endif