SEvMgr Logo  1.00.0
C++ Simulation-Oriented Discrete Event Management Library
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
SEVMGR::SEVMGR_Service Class Reference

class holding the services related to Travel Demand Generation. More...

#include <sevmgr/SEVMGR_Service.hpp>

List of all members.

Public Member Functions

 SEVMGR_Service (const stdair::BasLogParams &, const stdair::BasDBParams &)
 Constructor.
 SEVMGR_Service (const stdair::BasLogParams &)
 SEVMGR_Service (stdair::STDAIR_ServicePtr_T)
 ~SEVMGR_Service ()
void buildSampleQueue ()
stdair::BookingRequestStruct buildSampleBookingRequest (const bool isForCRS=false)
stdair::ProgressStatusSet popEvent (stdair::EventStruct &) const
void run (stdair::EventStruct &) const
bool select (stdair::EventStruct &, const stdair::DateTime_T &) const
template<class EventGenerator >
void addEventGenerator (EventGenerator &iEventGenerator) const
void addEvent (stdair::EventStruct &) const
void reset () const
void updateStatus (const stdair::EventType::EN_EventType &, const stdair::Count_T &) const
void addStatus (const stdair::EventType::EN_EventType &, const stdair::Count_T &) const
bool isQueueDone () const
bool hasProgressStatus (const stdair::EventType::EN_EventType &) const
EventQueuegetEventQueue () const
const stdair::Count_T & getQueueSize () const
template<class EventGenerator , class Key >
EventGenerator & getEventGenerator (const Key &iKey) const
template<class EventGenerator , class Key >
bool hasEventGenerator (const Key &iKey) const
template<class EventGenerator >
const std::list< EventGenerator * > getEventGeneratorList () const
template<class EventGenerator >
bool hasEventGeneratorList () const
const stdair::Count_T & getExpectedTotalNumberOfEventsToBeGenerated () const
const stdair::Count_T & getExpectedTotalNumberOfEventsToBeGenerated (const stdair::EventType::EN_EventType &) const
const stdair::Count_T & getActualTotalNumberOfEventsToBeGenerated () const
const stdair::Count_T & getActualTotalNumberOfEventsToBeGenerated (const stdair::EventType::EN_EventType &) const
const stdair::ProgressStatus & getStatus () const
const stdair::ProgressStatus & getStatus (const stdair::EventType::EN_EventType &) const
std::string describeKey () const
std::string list () const
std::string list (const stdair::EventType::EN_EventType &) const
std::string jsonHandler (const stdair::JSONString &) const
std::string jsonExportEventQueue (const stdair::EventType::EN_EventType &=stdair::EventType::LAST_VALUE) const
std::string jsonExportEvent (const stdair::EventStruct &) const

Detailed Description

class holding the services related to Travel Demand Generation.

Definition at line 32 of file SEVMGR_Service.hpp.


Constructor & Destructor Documentation

SEVMGR::SEVMGR_Service::SEVMGR_Service ( const stdair::BasLogParams &  iLogParams,
const stdair::BasDBParams &  iDBParams 
)

Constructor.

The initSevmgrService() method is called; see the corresponding documentation for more details.

A reference on an output stream is given, so that log outputs can be directed onto that stream.

Moreover, database connection parameters are given, so that a session can be created on the corresponding database.

Parameters:
conststdair::BasLogParams& Parameters for the output log stream.
conststdair::BasDBParams& Parameters for the database access.

Definition at line 43 of file SEVMGR_Service.cpp.

SEVMGR::SEVMGR_Service::SEVMGR_Service ( const stdair::BasLogParams &  iLogParams)

Constructor.

The initSevmgrService() method is called; see the corresponding documentation for more details.

A reference on an output stream is given, so that log outputs can be directed onto that stream.

Parameters:
conststdair::BasLogParams& Parameters for the output log stream.

Definition at line 64 of file SEVMGR_Service.cpp.

SEVMGR::SEVMGR_Service::SEVMGR_Service ( stdair::STDAIR_ServicePtr_T  ioSTDAIR_Service_ptr)

Constructor.

The initSevmgrService() method is called; see the corresponding documentation for more details.

Moreover, as no reference on any output stream is given, neither any database access parameter is given, it is assumed that the StdAir log service has already been initialised with the proper log output stream by some other methods in the calling chain (for instance, when the SEVMGR_Service is itself being initialised by another library service such as TVLSIM_Service).

Parameters:
stdair::STDAIR_ServicePtr_THandler on the STDAIR_Service.

Definition at line 85 of file SEVMGR_Service.cpp.

SEVMGR::SEVMGR_Service::~SEVMGR_Service ( )

Destructor.

Definition at line 101 of file SEVMGR_Service.cpp.


Member Function Documentation

void SEVMGR::SEVMGR_Service::buildSampleQueue ( )

Build a sample event queue.

Definition at line 175 of file SEVMGR_Service.cpp.

Referenced by main().

stdair::BookingRequestStruct SEVMGR::SEVMGR_Service::buildSampleBookingRequest ( const bool  isForCRS = false)

Build a sample booking request structure.

As of now (March 2011), the sample booking request is made of the following parameters:

  • Return trip (inbound): LHR-SYD (POS: LHR, Channel: DN),
  • Departing 10-JUN-2011 around 8:00, staying 7 days
  • Requested on 15-MAY-2011 at 10:00
  • Economy cabin, 3 persons, FF member
  • WTP: 1000.0 EUR
  • Dis-utility: 100.0 EUR/hour

As of now (March 2011), the CRS-related booking request is made of the following parameters:

  • Return trip (inbound): SIN-BKK (POS: SIN, Channel: IN),
  • Departing 30-JAN-2010 around 10:00, staying 7 days
  • Requested on 22-JAN-2010 at 10:00
  • Economy cabin, 3 persons, FF member
  • WTP: 1000.0 EUR
  • Dis-utility: 100.0 EUR/hour
See also:
stdair::CmdBomManager for more details.
Parameters:
constbool isForCRS Whether the sample booking request is for CRS.
Returns:
BookingRequestStruct& Sample booking request structure.

Definition at line 200 of file SEVMGR_Service.cpp.

stdair::ProgressStatusSet SEVMGR::SEVMGR_Service::popEvent ( stdair::EventStruct &  iEventStruct) const

Pop the next coming (in time) event, and remove it from the event queue.

  • The next coming (in time) event corresponds to the event having the earliest date-time stamp. In other words, it is the first/front element of the event queue.
  • That (first) event/element is then removed from the event queue
  • The progress status is updated for the corresponding event generator.
Returns:
stdair::EventStruct A copy of the event structure, which comes first in time from within the event queue.

Definition at line 398 of file SEVMGR_Service.cpp.

Referenced by main().

void SEVMGR::SEVMGR_Service::run ( stdair::EventStruct &  iEventStruct) const

Played all events and stopped when the first break point was encountered.

Returns:
stdair::EventStruct A copy of the break point which came first in time within the event queue. If no break point was encountered, return a copy of the last event within the event queue.

Definition at line 417 of file SEVMGR_Service.cpp.

bool SEVMGR::SEVMGR_Service::select ( stdair::EventStruct &  iEventStruct,
const stdair::DateTime_T &  iEventDateTime 
) const

Selected the event with the given date time, if such event existed.

Returns:
stdair::EventStruct A copy of the event with the given date time. If no event with the given DateTime was encountered, no copy are returned.
Parameters:
conststdair::DateTime_T Date time of the event to be returned.
Returns:
bool States whether an event with the given date time had been encountered and thus returned.

/Note All events occuring before the selected one are played. Thus, the copy returned is the copy of the current first event of the queue.

Definition at line 437 of file SEVMGR_Service.cpp.

template<class EventGenerator >
void SEVMGR::SEVMGR_Service::addEventGenerator ( EventGenerator &  iEventGenerator) const

Add an event generator to the map holding the children of the queue. Be careful, this method is not implemented: its implementation is left to the appelant according the EventGenerator type.

Note:
An instance of implementation of that method can be found in the TraDemGen service.
void SEVMGR::SEVMGR_Service::addEvent ( stdair::EventStruct &  iEventStruct) const

Add an event to the queue.

Definition at line 596 of file SEVMGR_Service.cpp.

void SEVMGR::SEVMGR_Service::reset ( ) const

Reset the context of the event generators for another event generation without having to reparse the demand input file.

Definition at line 561 of file SEVMGR_Service.cpp.

void SEVMGR::SEVMGR_Service::updateStatus ( const stdair::EventType::EN_EventType &  iEventType,
const stdair::Count_T &  iEventCount 
) const

Update the progress status for the given event type (e.g., booking request, optimisation notification, schedule change, break point).

Parameters:
conststdair::EventType::EN_EventType& Type of the events for which the actual total count is updated.
Returns:
const stdair::Count_T& Expected Actual count of such events already generated

Definition at line 458 of file SEVMGR_Service.cpp.

void SEVMGR::SEVMGR_Service::addStatus ( const stdair::EventType::EN_EventType &  iEventType,
const stdair::Count_T &  iEventCount 
) const

Initialise the progress statuses for the given event type (e.g., request, snapshot).

Parameters:
conststdair::EventType::EN_EventType& Type of the events for which the actual total count is updated.
Returns:
const stdair::Count_T& Expected Actual count of such events already generated

Definition at line 478 of file SEVMGR_Service.cpp.

bool SEVMGR::SEVMGR_Service::isQueueDone ( ) const

States whether the event queue has reached the end.

For now, that method states whether the event queue is empty.

Definition at line 497 of file SEVMGR_Service.cpp.

Referenced by main().

bool SEVMGR::SEVMGR_Service::hasProgressStatus ( const stdair::EventType::EN_EventType &  iEventType) const

Check if the event queue has already a progress status for the given event type

Definition at line 519 of file SEVMGR_Service.cpp.

EventQueue & SEVMGR::SEVMGR_Service::getEventQueue ( ) const

Definition at line 580 of file SEVMGR_Service.cpp.

const stdair::Count_T & SEVMGR::SEVMGR_Service::getQueueSize ( ) const

Get the size of the queue.

Definition at line 542 of file SEVMGR_Service.cpp.

template<class EventGenerator , class Key >
EventGenerator& SEVMGR::SEVMGR_Service::getEventGenerator ( const Key &  iKey) const

Extract an event generator from the map holding the children of the queue. Be careful, this method is not implemented: its implementation is left to the appelant according the EventGenerator type.

Note:
An instance of implementation of that method can be found in the TraDemGen service.
template<class EventGenerator , class Key >
bool SEVMGR::SEVMGR_Service::hasEventGenerator ( const Key &  iKey) const

Check whether the event generator object with the given key exists.

Be careful, this method is not implemented: its implementation is left to the appelant according the EventGenerator type.

Note:
An instance of implementation of that method can be found in the TraDemGen service.
template<class EventGenerator >
const std::list<EventGenerator*> SEVMGR::SEVMGR_Service::getEventGeneratorList ( ) const

Extract the event generator list from the map holding the children of the queue. Be careful, this method is not implemented: its implementation is left to the appelant according the EventGenerator type.

Note:
An instance of implementation of that method can be found in the TraDemGen service.
template<class EventGenerator >
bool SEVMGR::SEVMGR_Service::hasEventGeneratorList ( ) const

Check whether there are event generator objects.

Be careful, this method is not implemented: its implementation is left to the appelant according the EventGenerator type.

Note:
An instance of implementation of that method can be found in the TraDemGen service.
const stdair::Count_T & SEVMGR::SEVMGR_Service::getExpectedTotalNumberOfEventsToBeGenerated ( ) const

Get the expected number of events to be generated.

The getExpectedTotalNbOfEvents() method is called on the underlying EventQueue object, which keeps track of that number.

Note:
That number usually corresponds to an expectation (i.e., the mean value of a random distribution), and may not be accurate. The actual number will be known after calling the generateFirstEvents() method for each event type (e.g., booking request, optimisation notification, etc).
Returns:
const Count_T& Expected number of events to be generated.

Definition at line 616 of file SEVMGR_Service.cpp.

Referenced by getExpectedTotalNumberOfEventsToBeGenerated().

const stdair::Count_T & SEVMGR::SEVMGR_Service::getExpectedTotalNumberOfEventsToBeGenerated ( const stdair::EventType::EN_EventType &  iEventType) const

Get the expected number of events to be generated for the given event type.

The getExpectedTotalNbOfEvents() method is called on the underlying EventQueue object, which keeps track of that number.

Note:
That number usually corresponds to an expectation (i.e., the mean value of a random distribution), and may not be accurate. The actual number will be known after calling the generateFirstEvents() method for each event type (e.g., booking request, optimisation notification, etc).
Parameters:
constEventType_T& Event type for which the number is calculated.
Returns:
const Count_T& Expected number of events to be generated.

Definition at line 636 of file SEVMGR_Service.cpp.

References getExpectedTotalNumberOfEventsToBeGenerated().

const stdair::Count_T & SEVMGR::SEVMGR_Service::getActualTotalNumberOfEventsToBeGenerated ( ) const

Get the actual number of events to be generated for all the event generators.

The getActualTotalNbOfEvents() method is called on the underlying EventQueue object, which keeps track of that number.

Note:
That number is being known after calling the generateFirstEvents() method.
Returns:
const Count_T& Expected number of events to be generated.

Definition at line 657 of file SEVMGR_Service.cpp.

Referenced by getActualTotalNumberOfEventsToBeGenerated().

const stdair::Count_T & SEVMGR::SEVMGR_Service::getActualTotalNumberOfEventsToBeGenerated ( const stdair::EventType::EN_EventType &  iEventType) const

Get the expected number of events to be generated for the given event type.

The getExpectedTotalNbOfEvents() method is called on the underlying EventQueue object, which keeps track of that number.

Note:
That number usually corresponds to an expectation (i.e., the mean value of a random distribution), and may not be accurate. The actual number will be known after calling the generateFirstEvents() method for each event type (e.g., booking request, optimisation notification, etc).
Parameters:
constEventType_T& Event type for which the number is calculated.
Returns:
const Count_T& Expected number of events to be generated.

Definition at line 678 of file SEVMGR_Service.cpp.

References getActualTotalNumberOfEventsToBeGenerated().

const stdair::ProgressStatus & SEVMGR::SEVMGR_Service::getStatus ( ) const

Get the overall progress status (for the whole event queue).

Definition at line 715 of file SEVMGR_Service.cpp.

Referenced by getStatus().

const stdair::ProgressStatus & SEVMGR::SEVMGR_Service::getStatus ( const stdair::EventType::EN_EventType &  iEventType) const

Get the progress status for the given event type (e.g., booking request, optimisation notification, schedule change, break point).

Definition at line 736 of file SEVMGR_Service.cpp.

References getStatus().

std::string SEVMGR::SEVMGR_Service::describeKey ( ) const

Display (dump in the returned string) the key of the event queue.

Returns:
std::string Output string in which the key is logged/dumped.

Definition at line 224 of file SEVMGR_Service.cpp.

std::string SEVMGR::SEVMGR_Service::list ( ) const

Display (dump in the returned string) the event list of the event queue.

Returns:
std::string Output string in which the events are logged/dumped.

Definition at line 243 of file SEVMGR_Service.cpp.

Referenced by list().

std::string SEVMGR::SEVMGR_Service::list ( const stdair::EventType::EN_EventType &  iEventType) const

Display (dump in the returned string) the event list for the given event type (e.g., booking request, optimisation notification, schedule change, break point).

Parameters:
constEventType_T& Event type for which the events are displayed
Returns:
std::string Output string in which the events are logged/dumped.

Definition at line 263 of file SEVMGR_Service.cpp.

References list().

std::string SEVMGR::SEVMGR_Service::jsonHandler ( const stdair::JSONString &  iJSONString) const

Dispatch the JSon command string to the corresponding service.

Parameters:
conststdair::JSONString& Input string which contained the JSon command string.
Returns:
std::string Output string in which the asking objects are logged/dumped with a JSon format.

Definition at line 283 of file SEVMGR_Service.cpp.

References jsonExportEventQueue().

std::string SEVMGR::SEVMGR_Service::jsonExportEventQueue ( const stdair::EventType::EN_EventType &  iEventType = stdair::EventType::LAST_VALUE) const

Dump in the returned string and in JSON format the whole list of events queue.

Definition at line 342 of file SEVMGR_Service.cpp.

Referenced by jsonHandler().

std::string SEVMGR::SEVMGR_Service::jsonExportEvent ( const stdair::EventStruct &  iEvent) const

Dump in the returned string and in JSON format the given event.

Definition at line 372 of file SEVMGR_Service.cpp.


The documentation for this class was generated from the following files: