#include <cassert>
#include <sstream>
#include <fstream>
#include <vector>
#include <list>
#include <string>
#include <boost/tokenizer.hpp>
#include <boost/program_options.hpp>
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics.hpp>
#include <stdair/stdair_basic_types.hpp>
#include <stdair/basic/BasConst_General.hpp>
#include <stdair/basic/ProgressStatusSet.hpp>
#include <stdair/basic/DemandGenerationMethod.hpp>
#include <stdair/bom/EventStruct.hpp>
#include <stdair/bom/BookingRequestStruct.hpp>
#include <stdair/bom/BomDisplay.hpp>
#include <stdair/service/Logger.hpp>
#include <trademgen/TRADEMGEN_Service.hpp>
#include <trademgen/config/trademgen-paths.hpp>
Go to the source code of this file.
Typedefs | |
typedef unsigned int | NbOfRuns_T |
typedef ba::accumulator_set < double, ba::stats < ba::tag::min, ba::tag::max, ba::tag::mean(ba::immediate), ba::tag::sum, ba::tag::variance > > | stat_acc_type |
Functions | |
const stdair::Filename_T | K_TRADEMGEN_DEFAULT_LOG_FILENAME ("trademgen_generateDemand.log") |
const stdair::Filename_T | K_TRADEMGEN_DEFAULT_INPUT_FILENAME (STDAIR_SAMPLE_DIR"/demand01.csv") |
const stdair::Filename_T | K_TRADEMGEN_DEFAULT_OUTPUT_FILENAME ("request.csv") |
void | stat_display (std::ostream &oStream, const stat_acc_type &iStatAcc) |
template<class T > | |
std::ostream & | operator<< (std::ostream &os, const std::vector< T > &v) |
int | readConfiguration (int argc, char *argv[], bool &ioIsBuiltin, stdair::RandomSeed_T &ioRandomSeed, NbOfRuns_T &ioRandomRuns, stdair::Filename_T &ioInputFilename, stdair::Filename_T &ioOutputFilename, stdair::Filename_T &ioLogFilename, stdair::DemandGenerationMethod &ioDemandGenerationMethod) |
void | generateDemand (TRADEMGEN::TRADEMGEN_Service &ioTrademgenService, const stdair::Filename_T &iOutputFilename, const NbOfRuns_T &iNbOfRuns, const stdair::DemandGenerationMethod &iDemandGenerationMethod) |
int | main (int argc, char *argv[]) |
Variables | |
const stdair::DemandGenerationMethod | K_TRADEMGEN_DEFAULT_DEMAND_GENERATION_METHOD |
const char | K_TRADEMGEN_DEFAULT_DEMAND_GENERATION_METHOD_CHAR |
const stdair::RandomSeed_T | K_TRADEMGEN_DEFAULT_RANDOM_SEED |
const NbOfRuns_T | K_TRADEMGEN_DEFAULT_RANDOM_DRAWS = 1 |
const bool | K_TRADEMGEN_DEFAULT_BUILT_IN_INPUT = false |
const int | K_TRADEMGEN_EARLY_RETURN_STATUS = 99 |
typedef unsigned int NbOfRuns_T |
Definition at line 38 of file trademgen_generateDemand.cpp.
typedef ba::accumulator_set<double, ba::stats<ba::tag::min, ba::tag::max, ba::tag::mean (ba::immediate), ba::tag::sum, ba::tag::variance> > stat_acc_type |
Type definition to gather statistics.
Definition at line 47 of file trademgen_generateDemand.cpp.
const stdair::Filename_T K_TRADEMGEN_DEFAULT_LOG_FILENAME | ( | "trademgen_generateDemand.log" | ) |
Default name and location for the log file.
Referenced by readConfiguration().
const stdair::Filename_T K_TRADEMGEN_DEFAULT_INPUT_FILENAME | ( | STDAIR_SAMPLE_DIR"/demand01.csv" | ) |
Default name and location for the (CSV) input file.
Referenced by readConfiguration().
const stdair::Filename_T K_TRADEMGEN_DEFAULT_OUTPUT_FILENAME | ( | "request.csv" | ) |
Default name and location for the (CSV) output file.
Referenced by readConfiguration().
void stat_display | ( | std::ostream & | oStream, |
const stat_acc_type & | iStatAcc | ||
) |
Display the statistics held by the dedicated accumulator.
Definition at line 105 of file trademgen_generateDemand.cpp.
Referenced by generateDemand().
std::ostream& operator<< | ( | std::ostream & | os, |
const std::vector< T > & | v | ||
) |
Definition at line 127 of file trademgen_generateDemand.cpp.
int readConfiguration | ( | int | argc, |
char * | argv[], | ||
bool & | ioIsBuiltin, | ||
stdair::RandomSeed_T & | ioRandomSeed, | ||
NbOfRuns_T & | ioRandomRuns, | ||
stdair::Filename_T & | ioInputFilename, | ||
stdair::Filename_T & | ioOutputFilename, | ||
stdair::Filename_T & | ioLogFilename, | ||
stdair::DemandGenerationMethod & | ioDemandGenerationMethod | ||
) |
Read and parse the command line options.
Definition at line 136 of file trademgen_generateDemand.cpp.
References K_TRADEMGEN_DEFAULT_BUILT_IN_INPUT, K_TRADEMGEN_DEFAULT_DEMAND_GENERATION_METHOD_CHAR, K_TRADEMGEN_DEFAULT_INPUT_FILENAME(), K_TRADEMGEN_DEFAULT_LOG_FILENAME(), K_TRADEMGEN_DEFAULT_OUTPUT_FILENAME(), and K_TRADEMGEN_EARLY_RETURN_STATUS.
Referenced by main().
void generateDemand | ( | TRADEMGEN::TRADEMGEN_Service & | ioTrademgenService, |
const stdair::Filename_T & | iOutputFilename, | ||
const NbOfRuns_T & | iNbOfRuns, | ||
const stdair::DemandGenerationMethod & | iDemandGenerationMethod | ||
) |
Definition at line 276 of file trademgen_generateDemand.cpp.
References TRADEMGEN::TRADEMGEN_Service::csvDisplay(), TRADEMGEN::TRADEMGEN_Service::generateFirstRequests(), TRADEMGEN::TRADEMGEN_Service::generateNextRequest(), TRADEMGEN::TRADEMGEN_Service::getExpectedTotalNumberOfRequestsToBeGenerated(), TRADEMGEN::TRADEMGEN_Service::isQueueDone(), TRADEMGEN::TRADEMGEN_Service::popEvent(), TRADEMGEN::TRADEMGEN_Service::reset(), and stat_display().
Referenced by main(), and TRADEMGEN::TRADEMGEN_Service::parseAndLoad().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 420 of file trademgen_generateDemand.cpp.
References TRADEMGEN::TRADEMGEN_Service::buildSampleBom(), generateDemand(), K_TRADEMGEN_DEFAULT_DEMAND_GENERATION_METHOD, TRADEMGEN::TRADEMGEN_Service::parseAndLoad(), and readConfiguration().
const stdair::DemandGenerationMethod K_TRADEMGEN_DEFAULT_DEMAND_GENERATION_METHOD |
Default demand generation method: Poisson Process.
Definition at line 70 of file trademgen_generateDemand.cpp.
Referenced by main().
const char K_TRADEMGEN_DEFAULT_DEMAND_GENERATION_METHOD_CHAR |
Default demand generation method name: 'P' for Poisson Process.
Definition at line 76 of file trademgen_generateDemand.cpp.
Referenced by readConfiguration().
const stdair::RandomSeed_T K_TRADEMGEN_DEFAULT_RANDOM_SEED |
Default random generation seed (e.g., 120765987).
Definition at line 82 of file trademgen_generateDemand.cpp.
Referenced by readConfiguration().
const NbOfRuns_T K_TRADEMGEN_DEFAULT_RANDOM_DRAWS = 1 |
Default number of random draws to be generated (best if over 100).
Definition at line 88 of file trademgen_generateDemand.cpp.
const bool K_TRADEMGEN_DEFAULT_BUILT_IN_INPUT = false |
Default for the input type. It can be either built-in or provided by an input file. That latter must then be given with the -i option.
Definition at line 94 of file trademgen_generateDemand.cpp.
Referenced by readConfiguration().
const int K_TRADEMGEN_EARLY_RETURN_STATUS = 99 |
Early return status (so that it can be differentiated from an error).
Definition at line 99 of file trademgen_generateDemand.cpp.
Referenced by main(), and readConfiguration().