TraDemGen Logo  0.2.2
C++ Simulated Travel Demand Generation Library
TRADEMGEN::DemandStream Class Reference

Class modeling a demand stream. More...

#include <trademgen/bom/DemandStream.hpp>

+ Inheritance diagram for TRADEMGEN::DemandStream:

List of all members.

Public Types

typedef DemandStreamKey Key_T

Public Member Functions

const Key_TgetKey () const
BomAbstract *const getParent () const
const stdair::AirportCode_T & getOrigin () const
const stdair::AirportCode_T & getDestination () const
const stdair::Date_T & getPreferredDepartureDate () const
const stdair::CabinCode_T & getPreferredCabin () const
const stdair::HolderMap_T & getHolderMap () const
const DemandCharacteristicsgetDemandCharacteristics () const
const DemandDistributiongetDemandDistribution () const
const stdair::NbOfRequests_T & getTotalNumberOfRequestsToBeGenerated () const
const stdair::NbOfRequests_T & getMeanNumberOfRequests () const
const stdair::StdDevValue_T & getStdDevNumberOfRequests () const
const stdair::Count_T & getNumberOfRequestsGeneratedSoFar () const
const POSProbabilityMass_TgetPOSProbabilityMass () const
void setNumberOfRequestsGeneratedSoFar (const stdair::Count_T &iCount)
void setDemandDistribution (const DemandDistribution &iDemandDistribution)
void setDemandCharacteristics (const ArrivalPatternCumulativeDistribution_T &iArrivalPattern, const POSProbabilityMassFunction_T &iPOSProbMass, const ChannelProbabilityMassFunction_T &iChannelProbMass, const TripTypeProbabilityMassFunction_T &iTripTypeProbMass, const StayDurationProbabilityMassFunction_T &iStayDurationProbMass, const FrequentFlyerProbabilityMassFunction_T &iFrequentFlyerProbMass, const PreferredDepartureTimeContinuousDistribution_T &iPreferredDepartureTimeContinuousDistribution, const stdair::WTP_T &iMinWTP, const ValueOfTimeContinuousDistribution_T &iValueOfTimeContinuousDistribution)
void setTotalNumberOfRequestsToBeGenerated (const stdair::NbOfRequests_T &iNbOfRequests)
void setRequestDateTimeRandomGeneratorSeed (const stdair::RandomSeed_T &iSeed)
void setDemandCharacteristicsRandomGeneratorSeed (const stdair::RandomSeed_T &iSeed)
void setPOSProbabilityMass (const POSProbabilityMass_T &iProbMass)
void setAll (const ArrivalPatternCumulativeDistribution_T &, const POSProbabilityMassFunction_T &, const ChannelProbabilityMassFunction_T &, const TripTypeProbabilityMassFunction_T &, const StayDurationProbabilityMassFunction_T &, const FrequentFlyerProbabilityMassFunction_T &, const PreferredDepartureTimeContinuousDistribution_T &, const stdair::WTP_T &, const ValueOfTimeContinuousDistribution_T &, const DemandDistribution &, stdair::BaseGenerator_T &ioSharedGenerator, const stdair::RandomSeed_T &iRequestDateTimeSeed, const stdair::RandomSeed_T &iDemandCharacteristicsSeed, const POSProbabilityMass_T &)
void setBoolFirstDateTimeRequest (const bool &iFirstDateTimeRequest)
void incrementGeneratedRequestsCounter ()
const bool stillHavingRequestsToBeGenerated (const stdair::DemandGenerationMethod &iDemandGenerationMethod) const
const stdair::DateTime_T generateTimeOfRequestPoissonProcess ()
const stdair::DateTime_T generateTimeOfRequestStatisticsOrder ()
const stdair::AirportCode_T generatePOS ()
const stdair::ChannelLabel_T generateChannel ()
const stdair::TripType_T generateTripType ()
const stdair::DayDuration_T generateStayDuration ()
const stdair::FrequentFlyer_T generateFrequentFlyer ()
const stdair::Duration_T generatePreferredDepartureTime ()
const stdair::WTP_T generateWTP (stdair::RandomGeneration &, const stdair::Date_T &, const stdair::DateTime_T &, const stdair::DayDuration_T &)
const stdair::PriceValue_T generateValueOfTime ()
stdair::BookingRequestPtr_T generateNextRequest (stdair::RandomGeneration &, const stdair::DemandGenerationMethod &)
void reset (stdair::BaseGenerator_T &ioSharedGenerator)
void toStream (std::ostream &ioOut) const
void fromStream (std::istream &ioIn)
std::string toString () const
const std::string describeKey () const
std::string display () const
const stdair::Duration_T convertFloatIntoDuration (const stdair::FloatDuration_T)

Protected Member Functions

 DemandStream (const Key_T &)
virtual ~DemandStream ()

Protected Attributes

Key_T _key
BomAbstract_parent
stdair::HolderMap_T _holderMap
DemandCharacteristics _demandCharacteristics
DemandDistribution _demandDistribution
stdair::NbOfRequests_T _totalNumberOfRequestsToBeGenerated
RandomGenerationContext _randomGenerationContext
stdair::RandomGeneration _requestDateTimeRandomGenerator
stdair::RandomGeneration _demandCharacteristicsRandomGenerator
POSProbabilityMass_T _posProMass

Friends

class stdair::FacBom
class stdair::FacBomManager

Detailed Description

Class modeling a demand stream.

Definition at line 30 of file DemandStream.hpp.


Member Typedef Documentation

Definition allowing to retrieve the associated BOM key type.

Definition at line 39 of file DemandStream.hpp.


Constructor & Destructor Documentation

TRADEMGEN::DemandStream::DemandStream ( const Key_T iKey) [protected]

Main constructor.

Definition at line 62 of file DemandStream.cpp.

TRADEMGEN::DemandStream::~DemandStream ( ) [protected, virtual]

Destructor.

Definition at line 67 of file DemandStream.cpp.


Member Function Documentation

const Key_T& TRADEMGEN::DemandStream::getKey ( ) const [inline]

Get the key

Definition at line 45 of file DemandStream.hpp.

References _key.

Get the parent object (EventQueue).

Definition at line 50 of file DemandStream.hpp.

References _parent.

const stdair::AirportCode_T& TRADEMGEN::DemandStream::getOrigin ( ) const [inline]

Get the origin (part of the primary key).

Definition at line 55 of file DemandStream.hpp.

References _key, and TRADEMGEN::DemandStreamKey::getOrigin().

const stdair::AirportCode_T& TRADEMGEN::DemandStream::getDestination ( ) const [inline]

Get the destination (part of the primary key).

Definition at line 60 of file DemandStream.hpp.

References _key, and TRADEMGEN::DemandStreamKey::getDestination().

const stdair::Date_T& TRADEMGEN::DemandStream::getPreferredDepartureDate ( ) const [inline]

Get the preferred departure date (part of the primary key).

Definition at line 65 of file DemandStream.hpp.

References _key, and TRADEMGEN::DemandStreamKey::getPreferredDepartureDate().

const stdair::CabinCode_T& TRADEMGEN::DemandStream::getPreferredCabin ( ) const [inline]

Get the preferred cabin (part of the primary key).

Definition at line 70 of file DemandStream.hpp.

References _key, and TRADEMGEN::DemandStreamKey::getPreferredCabin().

const stdair::HolderMap_T& TRADEMGEN::DemandStream::getHolderMap ( ) const [inline]

Get the map of children holders.

Definition at line 75 of file DemandStream.hpp.

References _holderMap.

Get the demand characteristics.

Definition at line 80 of file DemandStream.hpp.

References _demandCharacteristics.

Get the demand distribution.

Definition at line 85 of file DemandStream.hpp.

References _demandDistribution.

const stdair::NbOfRequests_T& TRADEMGEN::DemandStream::getTotalNumberOfRequestsToBeGenerated ( ) const [inline]

Get the total number of requests to be generated.

Definition at line 90 of file DemandStream.hpp.

References _totalNumberOfRequestsToBeGenerated.

const stdair::NbOfRequests_T& TRADEMGEN::DemandStream::getMeanNumberOfRequests ( ) const [inline]

Get the mean (expected) number of requests.

Definition at line 95 of file DemandStream.hpp.

References _demandDistribution, and TRADEMGEN::DemandDistribution::_meanNumberOfRequests.

const stdair::StdDevValue_T& TRADEMGEN::DemandStream::getStdDevNumberOfRequests ( ) const [inline]

Get the standard deviation of number of requests.

Definition at line 100 of file DemandStream.hpp.

References _demandDistribution, and TRADEMGEN::DemandDistribution::_stdDevNumberOfRequests.

const stdair::Count_T& TRADEMGEN::DemandStream::getNumberOfRequestsGeneratedSoFar ( ) const [inline]

Get the number of requests generated so far.

Definition at line 105 of file DemandStream.hpp.

References _randomGenerationContext, and TRADEMGEN::RandomGenerationContext::getNumberOfRequestsGeneratedSoFar().

Get the default POS probablity mass, used when "row" (rest of the world) is drawn.

Definition at line 113 of file DemandStream.hpp.

References _posProMass.

void TRADEMGEN::DemandStream::setNumberOfRequestsGeneratedSoFar ( const stdair::Count_T &  iCount) [inline]

Set the number of requests generated so far.

Definition at line 121 of file DemandStream.hpp.

References _randomGenerationContext, and TRADEMGEN::RandomGenerationContext::setNumberOfRequestsGeneratedSoFar().

void TRADEMGEN::DemandStream::setDemandDistribution ( const DemandDistribution iDemandDistribution) [inline]

Set the demand distribution.

Definition at line 126 of file DemandStream.hpp.

References _demandDistribution.

Referenced by setAll().

void TRADEMGEN::DemandStream::setDemandCharacteristics ( const ArrivalPatternCumulativeDistribution_T iArrivalPattern,
const POSProbabilityMassFunction_T iPOSProbMass,
const ChannelProbabilityMassFunction_T iChannelProbMass,
const TripTypeProbabilityMassFunction_T iTripTypeProbMass,
const StayDurationProbabilityMassFunction_T iStayDurationProbMass,
const FrequentFlyerProbabilityMassFunction_T iFrequentFlyerProbMass,
const PreferredDepartureTimeContinuousDistribution_T iPreferredDepartureTimeContinuousDistribution,
const stdair::WTP_T &  iMinWTP,
const ValueOfTimeContinuousDistribution_T iValueOfTimeContinuousDistribution 
) [inline]

Set the demand characteristics.

Definition at line 132 of file DemandStream.hpp.

References _demandCharacteristics.

Referenced by setAll().

void TRADEMGEN::DemandStream::setTotalNumberOfRequestsToBeGenerated ( const stdair::NbOfRequests_T &  iNbOfRequests) [inline]

Set the total number of requests to be generated.

Definition at line 150 of file DemandStream.hpp.

References _totalNumberOfRequestsToBeGenerated.

Referenced by setAll().

void TRADEMGEN::DemandStream::setRequestDateTimeRandomGeneratorSeed ( const stdair::RandomSeed_T &  iSeed) [inline]

Set the seed of the random generator for the request datetime.

Definition at line 155 of file DemandStream.hpp.

References _requestDateTimeRandomGenerator.

Referenced by setAll().

void TRADEMGEN::DemandStream::setDemandCharacteristicsRandomGeneratorSeed ( const stdair::RandomSeed_T &  iSeed) [inline]

Set the seed of the random generator for the demand characteristics.

Definition at line 160 of file DemandStream.hpp.

References _demandCharacteristicsRandomGenerator.

Referenced by setAll().

Set the default POS probablity mass, used when "row" (rest of the world) is drawn.

Definition at line 168 of file DemandStream.hpp.

References _posProMass.

Referenced by setAll().

void TRADEMGEN::DemandStream::setAll ( const ArrivalPatternCumulativeDistribution_T iArrivalPattern,
const POSProbabilityMassFunction_T iPOSProbMass,
const ChannelProbabilityMassFunction_T iChannelProbMass,
const TripTypeProbabilityMassFunction_T iTripTypeProbMass,
const StayDurationProbabilityMassFunction_T iStayDurationProbMass,
const FrequentFlyerProbabilityMassFunction_T iFrequentFlyerProbMass,
const PreferredDepartureTimeContinuousDistribution_T iPreferredDepartureTimeContinuousDistribution,
const stdair::WTP_T &  iMinWTP,
const ValueOfTimeContinuousDistribution_T iValueOfTimeContinuousDistribution,
const DemandDistribution iDemandDistribution,
stdair::BaseGenerator_T &  ioSharedGenerator,
const stdair::RandomSeed_T &  iRequestDateTimeSeed,
const stdair::RandomSeed_T &  iDemandCharacteristicsSeed,
const POSProbabilityMass_T iDefaultPOSProbablityMass 
)
void TRADEMGEN::DemandStream::setBoolFirstDateTimeRequest ( const bool &  iFirstDateTimeRequest) [inline]

Set the boolean describing if it is the first time we generate a request for a demand stream.

Definition at line 194 of file DemandStream.hpp.

const bool TRADEMGEN::DemandStream::stillHavingRequestsToBeGenerated ( const stdair::DemandGenerationMethod &  iDemandGenerationMethod) const

Check whether enough requests have already been generated.

Definition at line 164 of file DemandStream.cpp.

References _randomGenerationContext, _totalNumberOfRequestsToBeGenerated, and TRADEMGEN::RandomGenerationContext::getNumberOfRequestsGeneratedSoFar().

Generate the preferred departure time.

Definition at line 468 of file DemandStream.cpp.

References _demandCharacteristics, and _demandCharacteristicsRandomGenerator.

Referenced by generateNextRequest().

const stdair::WTP_T TRADEMGEN::DemandStream::generateWTP ( stdair::RandomGeneration &  ioGenerator,
const stdair::Date_T &  iDepartureDate,
const stdair::DateTime_T &  iDateTimeThisRequest,
const stdair::DayDuration_T &  iDurationOfStay 
)
stdair::BookingRequestPtr_T TRADEMGEN::DemandStream::generateNextRequest ( stdair::RandomGeneration &  ioGenerator,
const stdair::DemandGenerationMethod &  iDemandGenerationMethod 
)

Generate the next request.

Parameters:
stdair::RandomGenerationRandom generator.
conststdair::DemandGenerationMethod::EN_DemandGenerationMethod Method used to generate the date time of the next booking request: statistic order or poisson process.
Returns:
stdair::BookingRequestPtr_T Next request to be simulate.

Definition at line 513 of file DemandStream.cpp.

References _key, describeKey(), generateChannel(), generateFrequentFlyer(), generatePOS(), generatePreferredDepartureTime(), generateStayDuration(), generateTimeOfRequestPoissonProcess(), generateTimeOfRequestStatisticsOrder(), generateTripType(), generateValueOfTime(), generateWTP(), TRADEMGEN::DemandStreamKey::getDestination(), TRADEMGEN::DemandStreamKey::getOrigin(), TRADEMGEN::DemandStreamKey::getPreferredCabin(), and TRADEMGEN::DemandStreamKey::getPreferredDepartureDate().

void TRADEMGEN::DemandStream::reset ( stdair::BaseGenerator_T &  ioSharedGenerator)

Reset all the contexts of the demand stream.

Definition at line 589 of file DemandStream.cpp.

References _randomGenerationContext, and TRADEMGEN::RandomGenerationContext::reset().

void TRADEMGEN::DemandStream::toStream ( std::ostream &  ioOut) const [inline]

Dump a Business Object into an output stream.

Parameters:
ostream&the output stream.

Definition at line 266 of file DemandStream.hpp.

References toString().

void TRADEMGEN::DemandStream::fromStream ( std::istream &  ioIn) [inline]

Read a Business Object from an input stream.

Parameters:
istream&the input stream.

Definition at line 274 of file DemandStream.hpp.

std::string TRADEMGEN::DemandStream::toString ( ) const

Get the serialised version of the Business Object.

Definition at line 71 of file DemandStream.cpp.

References _key, and TRADEMGEN::DemandStreamKey::toString().

Referenced by toStream().

const std::string TRADEMGEN::DemandStream::describeKey ( ) const [inline]

Get a string describing the key.

Definition at line 285 of file DemandStream.hpp.

References _key, and TRADEMGEN::DemandStreamKey::toString().

Referenced by generateNextRequest().

const stdair::Duration_T TRADEMGEN::DemandStream::convertFloatIntoDuration ( const stdair::FloatDuration_T  iNumberOfDays)

Friends And Related Function Documentation

friend class stdair::FacBom [friend]

Definition at line 31 of file DemandStream.hpp.

friend class stdair::FacBomManager [friend]

Definition at line 32 of file DemandStream.hpp.


Member Data Documentation

Pointer on the parent class (EventQueue).

Definition at line 326 of file DemandStream.hpp.

Referenced by getParent().

stdair::HolderMap_T TRADEMGEN::DemandStream::_holderMap [protected]

Map holding the children (not used for now).

Definition at line 331 of file DemandStream.hpp.

Referenced by getHolderMap().

stdair::RandomGeneration TRADEMGEN::DemandStream::_requestDateTimeRandomGenerator [protected]

Random generator for request date-time.

Definition at line 356 of file DemandStream.hpp.

Referenced by display(), generateTimeOfRequestPoissonProcess(), generateTimeOfRequestStatisticsOrder(), and setRequestDateTimeRandomGeneratorSeed().

Defaut POS probablity mass, used when "row" (rest of the world) is drawn.

Definition at line 367 of file DemandStream.hpp.

Referenced by display(), getPOSProbabilityMass(), and setPOSProbabilityMass().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines