Data related class and methods.
More...
#include <iostream>
#include <fstream>
#include <sstream>
#include <map>
#include <vector>
#include <limits>
#include <string>
#include <stdexcept>
#include <boost/tokenizer.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <math.h>
#include "repast_hpc/Properties.h"
#include "repast_hpc/RepastProcess.h"
#include "Network.hpp"
#include "tinyxml2.hpp"
#include "Random.hpp"
#include "repast_hpc/TDataSource.h"
#include "repast_hpc/SVDataSet.h"
Go to the source code of this file.
|
| std::string | secToTime (float n_sec) |
| | Convert a number of seconds to the format hour:min:sec. More...
|
| |
| unsigned int | secToHour (float n_sec) |
| | Convert a number of seconds to hours. More...
|
| |
| unsigned int | secToHalfHour (float n_sec) |
| | Convert a number of seconds to half-hours. More...
|
| |
| long int | linesCount (std::string filename) |
| | Compute the number of lines in a file. More...
|
| |
| template<typename T > |
| std::vector< T > | split (const std::string &msg, const std::string &separators) |
| | Decompose a string according to a separator into a vector of type T. More...
|
| |
Data related class and methods.
| long int linesCount |
( |
std::string |
filename | ) |
|
Compute the number of lines in a file.
- Parameters
-
| filename | the path to the file to analyze |
- Returns
- the number of lines in the file
| unsigned int secToHalfHour |
( |
float |
n_sec | ) |
|
|
inline |
Convert a number of seconds to half-hours.
- Parameters
-
| n_sec | the number of seconds to convert |
- Returns
- the number of half hours since midnight
| unsigned int secToHour |
( |
float |
n_sec | ) |
|
|
inline |
Convert a number of seconds to hours.
- Parameters
-
| n_sec | the number of seconds to convert |
- Returns
- the hours
| std::string secToTime |
( |
float |
n_sec | ) |
|
|
inline |
Convert a number of seconds to the format hour:min:sec.
- Parameters
-
| n_sec | the number of seconds to convert |
- Returns
- a string in the hour:min:sec format
template<typename T >
| std::vector<T> split |
( |
const std::string & |
msg, |
|
|
const std::string & |
separators |
|
) |
| |
Decompose a string according to a separator into a vector of type T.
- Parameters
-
| msg | the string to decompose |
| separators | separators used for the decomposition |
- Returns
- a vector of type T
| const int MODEL_AGENT_HH_TYPE = 1 |
constant for the household agent type
| const int MODEL_AGENT_IND_TYPE = 0 |
constant for the individual agent type