|
From: <qua...@us...> - 2010-01-26 15:14:37
|
Revision: 54
http://dsim.svn.sourceforge.net/dsim/?rev=54&view=rev
Author: quannaus
Date: 2010-01-26 15:14:31 +0000 (Tue, 26 Jan 2010)
Log Message:
-----------
[Dev] Added a hardcoded booking request event in the simulation.
Modified Paths:
--------------
trunk/dsim/dsim/command/Simulator.cpp
trunk/dsim/dsim/command/Simulator.hpp
Modified: trunk/dsim/dsim/command/Simulator.cpp
===================================================================
--- trunk/dsim/dsim/command/Simulator.cpp 2010-01-21 19:32:31 UTC (rev 53)
+++ trunk/dsim/dsim/command/Simulator.cpp 2010-01-26 15:14:31 UTC (rev 54)
@@ -8,6 +8,7 @@
#include <exception>
// StdAir
#include <stdair/STDAIR_Types.hpp>
+#include <stdair/bom/BookingRequestStruct.hpp>
#include <stdair/service/Logger.hpp>
// Distribution
#include <simcrs/SIMCRS_Service.hpp>
@@ -17,7 +18,7 @@
namespace DSIM {
- // //////////////////////////////////////////////////////////////////////
+ // ////////////////////////////////////////////////////////////////////
void Simulator::simulate (SIMCRS::SIMCRS_Service& ioSIMCRS_Service) {
try {
@@ -25,15 +26,26 @@
// DEBUG
STDAIR_LOG_DEBUG ("The simulation is starting");
- // Airline code
- stdair::AirlineCode_T lAirlineCode ("BA");
-
+ // TODO: remove this hardcoded section
+ // Hardcode a booking request in order to simulate a sale.
+ // Departure airport code
+ stdair::AirportCode_T lOrigin ("LHR");
+ // Arrival airport code
+ stdair::AirportCode_T lDestination ("JFK");
+ // Departure date
+ stdair::Date_T lDepartureDate (2010, 01, 19);
+ // Passenger type
+ stdair::PassengerType_T lPaxType ("L");
// Number of passengers in the travelling group
stdair::PartySize_T lPartySize = 5;
-
- // Make a booking
- ioSIMCRS_Service.sell (lAirlineCode, lPartySize);
-
+ // Booking request
+ stdair::BookingRequestStruct lBookingRequest (lOrigin, lDestination,
+ lDepartureDate,
+ lPaxType, lPartySize);
+
+ // Play booking request
+ playBookingRequest (lBookingRequest);
+
// DEBUG
STDAIR_LOG_DEBUG ("The simulation has ended");
@@ -43,4 +55,10 @@
}
}
+ // ////////////////////////////////////////////////////////////////////
+ void Simulator::
+ playBookingRequest (const stdair::BookingRequestStruct& iBookingRequest) {
+
+ }
+
}
Modified: trunk/dsim/dsim/command/Simulator.hpp
===================================================================
--- trunk/dsim/dsim/command/Simulator.hpp 2010-01-21 19:32:31 UTC (rev 53)
+++ trunk/dsim/dsim/command/Simulator.hpp 2010-01-26 15:14:31 UTC (rev 54)
@@ -8,6 +8,10 @@
#include <dsim/command/CmdAbstract.hpp>
// Forward declarations
+namespace stdair {
+ struct BookingRequestStruct;
+}
+
namespace SIMCRS {
class SIMCRS_Service;
}
@@ -22,6 +26,9 @@
/** Perform a simulation. */
static void simulate (SIMCRS::SIMCRS_Service&);
+ /** Play a booking request event. */
+ static void playBookingRequest (const stdair::BookingRequestStruct&);
+
private:
/** Constructors. */
Simulator() {}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|