SlideShare a Scribd company logo
statistics.hpp
#ifndef STATISTICS_HPP_INCLUDED
#define STATISTICS_HPP_INCLUDED
#include <vector>
#include <string>
//Histogramm
class Histogram
{
public:
Histogram(std::vector<double> &v, double t_bin_size);
~Histogram();
double bin_size;
double min;
std::vector<double> data;
};
//Statistic
class Statistics
{
public:
//Initialisieren
void Init(
int* t_grid_size,
int* t_bin_size,
int* t_num_iterations,
int* t_num_customers,
int* t_num_salesman);
//Besuche speichern
void LogField(int x, int y);
//Verdienst, Preis und Verkaeufe loggen
void LogSalesman(int salesm_id, double earnings, double p, int
sales, int visits);
void WriteVector(std::vector<double> &v, std::string filename);
void Write2dVector(std::vector<std::vector<double> > &v,
std::string filename);
void WriteLogSalesman(std::string name = "");
//Histogramm in Datei ausgeben
void WriteHistogram(std::vector<double> &v, double bin_size,
std::string filename);
//Besuchszahlen für jedes Feld
void WriteFields(std::string filename);
//Besuchszahlen gegen den Abstand zu (x,y)
void WriteFieldsDistance(std::string filename, int x, int y);
Seite 1
statistics.hpp
//Daten durch Faktor Teilen
void DivideData(std::vector<double> &v, double divisor);
//Daten Glaetten
void Smoothing(std::vector<double> &v);
void MSmoothing(std::vector<double> &v, int n); //n mal
Smoothing
//Mittelwert und Varianz bestimmen
double Midpoint(std::vector<double> &v);
double Variance(std::vector<double> &v);
std::vector<double> log_field; //Feld loggen
std::vector<std::vector<double> > log_p, log_earn, log_sales,
log_visits; //Preis, Gewinn, Verkaeufe loggen
std::vector<double> last_earn, last_sales, last_visits;
std::string path, prefix;
private:
//Simu-Parameter speichern
int* grid_size;
int* bin_size;
int* num_iterations;
int* num_customers;
int* num_salesman;
};
#endif // STATISTICS_HPP_INCLUDED
Seite 2

More Related Content

Viewers also liked (10)

PDF
Tools.cpp
Vorname Nachname
 
PDF
Tools.hpp
Vorname Nachname
 
PDF
Statistics.cpp
Vorname Nachname
 
PDF
Smell in real noses: how the environment changes vibrations
Vorname Nachname
 
PDF
Dpsm simu.cpp
Vorname Nachname
 
PDF
Could humans recognize odor by phonon assisted tunneling
Vorname Nachname
 
PDF
Statstockprog
Vorname Nachname
 
PDF
Main.cpp
Vorname Nachname
 
PDF
Dynamical symmetry breaking in vibration-assisted transport through nanostruc...
Vorname Nachname
 
PDF
Econophysics
Vorname Nachname
 
Tools.cpp
Vorname Nachname
 
Tools.hpp
Vorname Nachname
 
Statistics.cpp
Vorname Nachname
 
Smell in real noses: how the environment changes vibrations
Vorname Nachname
 
Dpsm simu.cpp
Vorname Nachname
 
Could humans recognize odor by phonon assisted tunneling
Vorname Nachname
 
Statstockprog
Vorname Nachname
 
Dynamical symmetry breaking in vibration-assisted transport through nanostruc...
Vorname Nachname
 
Econophysics
Vorname Nachname
 

More from Vorname Nachname (12)

PDF
Leni souza
Vorname Nachname
 
PDF
Alien life forms
Vorname Nachname
 
PDF
Spaceengine2
Vorname Nachname
 
PDF
Structural Language
Vorname Nachname
 
PDF
Language
Vorname Nachname
 
PDF
Spaceengine2
Vorname Nachname
 
PDF
Spaceengine
Vorname Nachname
 
PDF
Topology and Electrostatics
Vorname Nachname
 
PDF
calculation of currents in nanowires
Vorname Nachname
 
PDF
Summerpoject 2005
Vorname Nachname
 
PDF
Aspelmeyer
Vorname Nachname
 
PDF
Arndt matter wave interferometry
Vorname Nachname
 
Leni souza
Vorname Nachname
 
Alien life forms
Vorname Nachname
 
Spaceengine2
Vorname Nachname
 
Structural Language
Vorname Nachname
 
Spaceengine2
Vorname Nachname
 
Spaceengine
Vorname Nachname
 
Topology and Electrostatics
Vorname Nachname
 
calculation of currents in nanowires
Vorname Nachname
 
Summerpoject 2005
Vorname Nachname
 
Aspelmeyer
Vorname Nachname
 
Arndt matter wave interferometry
Vorname Nachname
 
Ad

Recently uploaded (20)

PPTX
Diagnostic Features of Common Oral Ulcerative Lesions.pptx
Dr Palak borade
 
PPTX
Akshay tunneling .pptx_20250331_165945_0000.pptx
akshaythaker18
 
PPTX
abdominal compartment syndrome presentation and treatment.pptx
LakshmiMounicaGrandh
 
PPTX
Phage Therapy and Bacteriophage Biology.pptx
Prachi Virat
 
PDF
Global Congress on Forensic Science and Research
infoforensicscience2
 
PDF
Service innovation with AI: Transformation of value proposition and market se...
Selcen Ozturkcan
 
DOCX
Critical Book Review (CBR) - "Hate Speech: Linguistic Perspectives"
Sahmiral Amri Rajagukguk
 
PDF
Adding Geochemistry To Understand Recharge Areas - Kinney County, Texas - Jim...
Texas Alliance of Groundwater Districts
 
PPTX
Q1 - W1 - D2 - Models of matter for science.pptx
RyanCudal3
 
PPTX
Ghent University Global Campus: Overview
Ghent University Global Campus
 
PDF
Chemokines and Receptors Overview – Key to Immune Cell Signaling
Benjamin Lewis Lewis
 
PDF
Insect Behaviour : Patterns And Determinants
SheikhArshaqAreeb
 
PDF
FYS 100 final presentation on Afro cubans
RowanSales
 
PDF
Plankton and Fisheries Bovas Joel Notes.pdf
J. Bovas Joel BFSc
 
PDF
Treatment and safety of drinking water .
psuvethapalani
 
PDF
Carbon-richDustInjectedintotheInterstellarMediumbyGalacticWCBinaries Survives...
Sérgio Sacani
 
PDF
soil and environmental microbiology.pdf
Divyaprabha67
 
PPTX
LESSON 2 PSYCHOSOCIAL DEVELOPMENT.pptx L
JeanCarolColico1
 
PDF
Unit-3 ppt.pdf organic chemistry unit 3 heterocyclic
visionshukla007
 
PDF
The emergence of galactic thin and thick discs across cosmic history
Sérgio Sacani
 
Diagnostic Features of Common Oral Ulcerative Lesions.pptx
Dr Palak borade
 
Akshay tunneling .pptx_20250331_165945_0000.pptx
akshaythaker18
 
abdominal compartment syndrome presentation and treatment.pptx
LakshmiMounicaGrandh
 
Phage Therapy and Bacteriophage Biology.pptx
Prachi Virat
 
Global Congress on Forensic Science and Research
infoforensicscience2
 
Service innovation with AI: Transformation of value proposition and market se...
Selcen Ozturkcan
 
Critical Book Review (CBR) - "Hate Speech: Linguistic Perspectives"
Sahmiral Amri Rajagukguk
 
Adding Geochemistry To Understand Recharge Areas - Kinney County, Texas - Jim...
Texas Alliance of Groundwater Districts
 
Q1 - W1 - D2 - Models of matter for science.pptx
RyanCudal3
 
Ghent University Global Campus: Overview
Ghent University Global Campus
 
Chemokines and Receptors Overview – Key to Immune Cell Signaling
Benjamin Lewis Lewis
 
Insect Behaviour : Patterns And Determinants
SheikhArshaqAreeb
 
FYS 100 final presentation on Afro cubans
RowanSales
 
Plankton and Fisheries Bovas Joel Notes.pdf
J. Bovas Joel BFSc
 
Treatment and safety of drinking water .
psuvethapalani
 
Carbon-richDustInjectedintotheInterstellarMediumbyGalacticWCBinaries Survives...
Sérgio Sacani
 
soil and environmental microbiology.pdf
Divyaprabha67
 
LESSON 2 PSYCHOSOCIAL DEVELOPMENT.pptx L
JeanCarolColico1
 
Unit-3 ppt.pdf organic chemistry unit 3 heterocyclic
visionshukla007
 
The emergence of galactic thin and thick discs across cosmic history
Sérgio Sacani
 
Ad

Statistics.hpp

  • 1. statistics.hpp #ifndef STATISTICS_HPP_INCLUDED #define STATISTICS_HPP_INCLUDED #include <vector> #include <string> //Histogramm class Histogram { public: Histogram(std::vector<double> &v, double t_bin_size); ~Histogram(); double bin_size; double min; std::vector<double> data; }; //Statistic class Statistics { public: //Initialisieren void Init( int* t_grid_size, int* t_bin_size, int* t_num_iterations, int* t_num_customers, int* t_num_salesman); //Besuche speichern void LogField(int x, int y); //Verdienst, Preis und Verkaeufe loggen void LogSalesman(int salesm_id, double earnings, double p, int sales, int visits); void WriteVector(std::vector<double> &v, std::string filename); void Write2dVector(std::vector<std::vector<double> > &v, std::string filename); void WriteLogSalesman(std::string name = ""); //Histogramm in Datei ausgeben void WriteHistogram(std::vector<double> &v, double bin_size, std::string filename); //Besuchszahlen für jedes Feld void WriteFields(std::string filename); //Besuchszahlen gegen den Abstand zu (x,y) void WriteFieldsDistance(std::string filename, int x, int y); Seite 1
  • 2. statistics.hpp //Daten durch Faktor Teilen void DivideData(std::vector<double> &v, double divisor); //Daten Glaetten void Smoothing(std::vector<double> &v); void MSmoothing(std::vector<double> &v, int n); //n mal Smoothing //Mittelwert und Varianz bestimmen double Midpoint(std::vector<double> &v); double Variance(std::vector<double> &v); std::vector<double> log_field; //Feld loggen std::vector<std::vector<double> > log_p, log_earn, log_sales, log_visits; //Preis, Gewinn, Verkaeufe loggen std::vector<double> last_earn, last_sales, last_visits; std::string path, prefix; private: //Simu-Parameter speichern int* grid_size; int* bin_size; int* num_iterations; int* num_customers; int* num_salesman; }; #endif // STATISTICS_HPP_INCLUDED Seite 2