1.00.16
C++ Simulated Travel Demand Generation Library
Toggle main menu visibility
Loading...
Searching...
No Matches
DemandParser.cpp
Go to the documentation of this file.
1
// //////////////////////////////////////////////////////////////////////
2
// Import section
3
// //////////////////////////////////////////////////////////////////////
4
// STL
5
#include <cassert>
6
// StdAir
7
#include <stdair/basic/BasFileMgr.hpp>
8
#include <stdair/basic/RandomGeneration.hpp>
9
#include <stdair/bom/Inventory.hpp>
10
// TraDemGen
11
#include <
trademgen/command/DemandParserHelper.hpp
>
12
#include <
trademgen/command/DemandParser.hpp
>
13
14
namespace
TRADEMGEN
{
15
16
// //////////////////////////////////////////////////////////////////////
17
void
DemandParser::
18
generateDemand
(
const
DemandFilePath
& iDemandFilename,
19
SEVMGR::SEVMGR_ServicePtr_T ioSEVMGR_ServicePtr,
20
stdair::RandomGeneration& ioSharedGenerator,
21
const
POSProbabilityMass_T
& iDefaultPOSProbablityMass) {
22
23
const
stdair::Filename_T lFilename = iDemandFilename.name();
24
25
// Check that the file path given as input corresponds to an actual file
26
const
bool
doesExistAndIsReadable =
27
stdair::BasFileMgr::doesExistAndIsReadable (lFilename);
28
if
(doesExistAndIsReadable ==
false
) {
29
STDAIR_LOG_ERROR (
"The demand input file '"
<< lFilename
30
<<
"' does not exist or can not be read"
);
31
32
throw
DemandInputFileNotFoundException
(
"The demand file '"
+ lFilename
33
+
"' does not exist or can not "
34
"be read"
);
35
}
36
37
// Initialise the demand file parser.
38
DemandFileParser
lDemandParser (ioSEVMGR_ServicePtr, ioSharedGenerator,
39
iDefaultPOSProbablityMass, lFilename);
40
41
// Parse the CSV-formatted demand input file, and generate the
42
// corresponding DemandCharacteristic objects.
43
lDemandParser.
generateDemand
();
44
}
45
46
}
DemandParser.hpp
DemandParserHelper.hpp
TRADEMGEN
Definition
BasConst.cpp:10
TRADEMGEN::POSProbabilityMass_T
CategoricalAttributeLite< stdair::AirportCode_T > POSProbabilityMass_T
Definition
DemandCharacteristicsTypes.hpp:25
TRADEMGEN::DemandParser::generateDemand
static void generateDemand(const DemandFilePath &, SEVMGR::SEVMGR_ServicePtr_T, stdair::RandomGeneration &, const POSProbabilityMass_T &)
Definition
DemandParser.cpp:18
TRADEMGEN::DemandFileParser
Definition
DemandParserHelper.hpp:434
TRADEMGEN::DemandFileParser::generateDemand
bool generateDemand()
Definition
DemandParserHelper.cpp:897
TRADEMGEN::DemandInputFileNotFoundException
Definition
TRADEMGEN_Exceptions.hpp:31
TRADEMGEN::DemandFilePath
Definition
TRADEMGEN_Types.hpp:30
Generated on
for TraDemGen by
1.17.0