Stride Reference Manual  1.0
ClusterSaver.cpp File Reference
#include <boost/property_tree/xml_parser.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/filesystem.hpp>
#include <string>
#include <utility>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <fstream>
#include <map>
#include "vis/ClusterSaver.h"
#include "util/InstallDirs.h"
#include "util/GeoCoordCalculator.h"
#include "core/ClusterType.h"
Include dependency graph for ClusterSaver.cpp:

Go to the source code of this file.

Namespaces

 stride
 Time Dependent Person DataType.
 

Macros

#define SET_CLUSTER_SURFACE(cluster_type)
 
#define SET_CLUSTER_MAP(cluster_type)
 

Macro Definition Documentation

#define SET_CLUSTER_SURFACE (   cluster_type)
Value:
{ \
surface = ClusterCalculator<cluster_type>::calculateSurface(local_sim); \
if (surface == 0.0) \
densities.put(toString(cluster_type), 0.0); \
else \
densities.put(toString(cluster_type), double(pop_count) / surface); \
}
string toString(ClusterType c)
Converts a ClusterType value to corresponding name.
Definition: ClusterType.cpp:54

Definition at line 217 of file ClusterSaver.cpp.

Referenced by stride::ClusterSaver::savePopDataJSON().

#define SET_CLUSTER_MAP (   cluster_type)
Value:
{ \
ptree specific_cluster_map; \
auto cluster_map = ClusterCalculator<cluster_type>::getClusterMap(local_sim); \
for (auto it = cluster_map.begin(); it != cluster_map.end(); ++it) { \
if (it->first != 0) { \
specific_cluster_map.put(to_string(it->first), it->second); \
} \
} \
cluster_sizes.add_child(toString(cluster_type), specific_cluster_map); \
}
string toString(ClusterType c)
Converts a ClusterType value to corresponding name.
Definition: ClusterType.cpp:54

Definition at line 226 of file ClusterSaver.cpp.

Referenced by stride::ClusterSaver::savePopDataJSON().