You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
(51) |
Nov
(8) |
Dec
(13) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(32) |
Feb
(47) |
Mar
(6) |
Apr
(19) |
May
(7) |
Jun
(19) |
Jul
(39) |
Aug
(51) |
Sep
(39) |
Oct
(18) |
Nov
(10) |
Dec
(27) |
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <den...@us...> - 2010-08-29 20:04:47
|
Revision: 295
http://stdair.svn.sourceforge.net/stdair/?rev=295&view=rev
Author: denis_arnaud
Date: 2010-08-29 20:04:40 +0000 (Sun, 29 Aug 2010)
Log Message:
-----------
[Branch 0.3.0] Took into account the feedback from the package review (https://bugzilla.redhat.com/show_bug.cgi?id=614036).
Modified Paths:
--------------
branches/stdair/0.3.0/main/stdair.spec
Modified: branches/stdair/0.3.0/main/stdair.spec
===================================================================
--- branches/stdair/0.3.0/main/stdair.spec 2010-08-28 22:06:59 UTC (rev 294)
+++ branches/stdair/0.3.0/main/stdair.spec 2010-08-29 20:04:40 UTC (rev 295)
@@ -15,6 +15,9 @@
BuildRequires: boost-devel
BuildRequires: soci-mysql-devel
+# When the extracc package will be approved, uncomment the following line
+# (see https://bugzilla.redhat.com/show_bug.cgi?id=616881 for more details)
+#BuildRequires: extracc-devel
BuildRequires: cppunit-devel
@@ -41,11 +44,8 @@
%package doc
Summary: HTML documentation for the %{name} library
Group: Documentation
-%if 0%{?fedora}
-BuildArch: noarch
-BuildRequires: texlive-latex
-%endif
-%{?el5:BuildRequires: tetex-latex}
+%{?fedora:BuildArch: noarch}
+BuildRequires: tex(latex)
BuildRequires: doxygen, ghostscript
%description doc
@@ -55,8 +55,10 @@
%prep
%setup -q
+# The INSTALL package is not relevant for RPM package users
+# (e.g., see https://bugzilla.redhat.com/show_bug.cgi?id=489233#c4)
+rm -f INSTALL
# Fix some permissions and formats
-rm -f INSTALL
chmod -x AUTHORS ChangeLog COPYING NEWS README
find . -type f -name '*.[hc]pp' -exec chmod 644 {} \;
@@ -69,15 +71,21 @@
# On Fedora, the BuildRoot is automatically cleaned. Which is not the case for
# RedHat. See: https://fedoraproject.org/wiki/Packaging/Guidelines#BuildRoot_tag
%{?rhel:rm -rf $RPM_BUILD_ROOT}
+
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
-# remove unpackaged files from the buildroot
+
+# Remove unpackaged files from the buildroot
rm -f $RPM_BUILD_ROOT%{_libdir}/lib%{name}.la
+# When the extracc package will be approved, the following line has to be removed
rm -f $RPM_BUILD_ROOT%{_libdir}/libextracppunit.la
+
mkdir -p %{mydocs}
mv $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/html %{mydocs}
+%if 0%{?rhel}
%clean
rm -rf $RPM_BUILD_ROOT
+%endif
%post -p /sbin/ldconfig
@@ -110,6 +118,9 @@
%changelog
+* Sun Aug 29 2010 Son Nguyen Kim <ngu...@gm...> 0.3.0-2
+- Integrated comments from the package review (#614036)
+
* Sun Aug 29 2010 Son Nguyen Kim <ngu...@gm...> 0.3.0-1
- Upstream update
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-08-28 22:07:05
|
Revision: 294
http://stdair.svn.sourceforge.net/stdair/?rev=294&view=rev
Author: denis_arnaud
Date: 2010-08-28 22:06:59 +0000 (Sat, 28 Aug 2010)
Log Message:
-----------
[Packaging] Fixed RPM packaging issues.
Modified Paths:
--------------
trunk/stdair/stdair.spec
Modified: trunk/stdair/stdair.spec
===================================================================
--- trunk/stdair/stdair.spec 2010-08-28 22:05:52 UTC (rev 293)
+++ trunk/stdair/stdair.spec 2010-08-28 22:06:59 UTC (rev 294)
@@ -101,7 +101,7 @@
%{_libdir}/pkgconfig/%{name}.pc
%{_datadir}/aclocal/%{name}.m4
%{_mandir}/man1/%{name}-config.1.*
-%{_mandir}/man3/%{name}.3.*
+%{_mandir}/man3/%{name}-library.3.*
%files doc
%defattr(-,root,root,-)
@@ -118,3 +118,4 @@
* Wed Jul 13 2010 Son Nguyen Kim <ngu...@gm...> 0.1.0-1
- First RPM release
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-08-28 22:05:58
|
Revision: 293
http://stdair.svn.sourceforge.net/stdair/?rev=293&view=rev
Author: denis_arnaud
Date: 2010-08-28 22:05:52 +0000 (Sat, 28 Aug 2010)
Log Message:
-----------
[Branch 0.3.0] Fixed RPM packaging issues.
Modified Paths:
--------------
branches/stdair/0.3.0/main/stdair.spec
Modified: branches/stdair/0.3.0/main/stdair.spec
===================================================================
--- branches/stdair/0.3.0/main/stdair.spec 2010-08-28 21:58:13 UTC (rev 292)
+++ branches/stdair/0.3.0/main/stdair.spec 2010-08-28 22:05:52 UTC (rev 293)
@@ -101,7 +101,7 @@
%{_libdir}/pkgconfig/%{name}.pc
%{_datadir}/aclocal/%{name}.m4
%{_mandir}/man1/%{name}-config.1.*
-%{_mandir}/man3/%{name}.3.*
+%{_mandir}/man3/%{name}-library.3.*
%files doc
%defattr(-,root,root,-)
@@ -115,3 +115,4 @@
* Wed Jul 13 2010 Son Nguyen Kim <ngu...@gm...> 0.1.0-1
- First RPM release
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-08-28 21:58:19
|
Revision: 292
http://stdair.svn.sourceforge.net/stdair/?rev=292&view=rev
Author: denis_arnaud
Date: 2010-08-28 21:58:13 +0000 (Sat, 28 Aug 2010)
Log Message:
-----------
[Packaging] Fixed RPM packaging issues.
Modified Paths:
--------------
trunk/stdair/man/Makefile.am
Modified: trunk/stdair/man/Makefile.am
===================================================================
--- trunk/stdair/man/Makefile.am 2010-08-28 21:57:58 UTC (rev 291)
+++ trunk/stdair/man/Makefile.am 2010-08-28 21:58:13 UTC (rev 292)
@@ -45,10 +45,13 @@
&& sed -i -e "s/\(^\.TH\ \".*\"\ \)1\(\ .*\)/\13\2/g" $(MAN_GEN_MANS)
install-data-local: man-local
- $(mkinstalldirs) $(mandir)/man1 $(mandir)/man3
- $(INSTALL_DATA) $(MAN_CMD_MANS) $(mandir)/man1
- $(INSTALL_DATA) $(MAN_GEN_MANS) $(mandir)/man3
+ $(mkinstalldirs) $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man3
+ $(INSTALL_DATA) $(MAN_CMD_MANS) $(DESTDIR)$(mandir)/man1
+ $(INSTALL_DATA) $(MAN_GEN_MANS) $(DESTDIR)$(mandir)/man3
+uninstall-local:
+ rm -rf $(DESTDIR)$(mandir)
+
clean-local:
rm -f $(man_MANS) $(MAN_GEN_MANS)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-08-28 21:58:04
|
Revision: 291
http://stdair.svn.sourceforge.net/stdair/?rev=291&view=rev
Author: denis_arnaud
Date: 2010-08-28 21:57:58 +0000 (Sat, 28 Aug 2010)
Log Message:
-----------
[Branch 0.3.0] Fixed RPM packaging issues.
Modified Paths:
--------------
branches/stdair/0.3.0/main/man/Makefile.am
Modified: branches/stdair/0.3.0/main/man/Makefile.am
===================================================================
--- branches/stdair/0.3.0/main/man/Makefile.am 2010-08-28 21:40:28 UTC (rev 290)
+++ branches/stdair/0.3.0/main/man/Makefile.am 2010-08-28 21:57:58 UTC (rev 291)
@@ -45,10 +45,13 @@
&& sed -i -e "s/\(^\.TH\ \".*\"\ \)1\(\ .*\)/\13\2/g" $(MAN_GEN_MANS)
install-data-local: man-local
- $(mkinstalldirs) $(mandir)/man1 $(mandir)/man3
- $(INSTALL_DATA) $(MAN_CMD_MANS) $(mandir)/man1
- $(INSTALL_DATA) $(MAN_GEN_MANS) $(mandir)/man3
+ $(mkinstalldirs) $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man3
+ $(INSTALL_DATA) $(MAN_CMD_MANS) $(DESTDIR)$(mandir)/man1
+ $(INSTALL_DATA) $(MAN_GEN_MANS) $(DESTDIR)$(mandir)/man3
+uninstall-local:
+ rm -rf $(DESTDIR)$(mandir)
+
clean-local:
rm -f $(man_MANS) $(MAN_GEN_MANS)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-08-28 21:40:34
|
Revision: 290
http://stdair.svn.sourceforge.net/stdair/?rev=290&view=rev
Author: denis_arnaud
Date: 2010-08-28 21:40:28 +0000 (Sat, 28 Aug 2010)
Log Message:
-----------
[Packaging] Fixed RPM packaging issues.
Modified Paths:
--------------
trunk/stdair/man/Makefile.am
Modified: trunk/stdair/man/Makefile.am
===================================================================
--- trunk/stdair/man/Makefile.am 2010-08-28 21:40:00 UTC (rev 289)
+++ trunk/stdair/man/Makefile.am 2010-08-28 21:40:28 UTC (rev 290)
@@ -11,6 +11,9 @@
# generated by Doxygen for section 1.
#
+MAINTAINERCLEANFILES = Makefile.in
+
+#
MAN_SRC_SUFFIX = doc
MAN_CMD_TARGET_SUFFIX = 1
MAN_GEN_TARGET_SUFFIX = 3
@@ -30,7 +33,7 @@
man_MANS = $(MAN_SRC:%.doc=%.$(MAN_CMD_TARGET_SUFFIX))
#
-EXTRA_DIST = $(MAN_SRC)
+EXTRA_DIST = $(MAN_SRC) doxygen_man.cfg
#
all-local: man-local
@@ -48,3 +51,4 @@
clean-local:
rm -f $(man_MANS) $(MAN_GEN_MANS)
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-08-28 21:40:06
|
Revision: 289
http://stdair.svn.sourceforge.net/stdair/?rev=289&view=rev
Author: denis_arnaud
Date: 2010-08-28 21:40:00 +0000 (Sat, 28 Aug 2010)
Log Message:
-----------
[Branch 0.3.0] Fixed RPM packaging issues.
Modified Paths:
--------------
branches/stdair/0.3.0/main/man/Makefile.am
Modified: branches/stdair/0.3.0/main/man/Makefile.am
===================================================================
--- branches/stdair/0.3.0/main/man/Makefile.am 2010-08-28 21:33:32 UTC (rev 288)
+++ branches/stdair/0.3.0/main/man/Makefile.am 2010-08-28 21:40:00 UTC (rev 289)
@@ -11,6 +11,9 @@
# generated by Doxygen for section 1.
#
+MAINTAINERCLEANFILES = Makefile.in
+
+#
MAN_SRC_SUFFIX = doc
MAN_CMD_TARGET_SUFFIX = 1
MAN_GEN_TARGET_SUFFIX = 3
@@ -30,7 +33,7 @@
man_MANS = $(MAN_SRC:%.doc=%.$(MAN_CMD_TARGET_SUFFIX))
#
-EXTRA_DIST = $(MAN_SRC)
+EXTRA_DIST = $(MAN_SRC) doxygen_man.cfg
#
all-local: man-local
@@ -48,3 +51,4 @@
clean-local:
rm -f $(man_MANS) $(MAN_GEN_MANS)
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-08-28 21:33:38
|
Revision: 288
http://stdair.svn.sourceforge.net/stdair/?rev=288&view=rev
Author: denis_arnaud
Date: 2010-08-28 21:33:32 +0000 (Sat, 28 Aug 2010)
Log Message:
-----------
[Packaging] Fixed RPM packaging issues.
Modified Paths:
--------------
trunk/stdair/stdair.spec
trunk/stdair/test/Makefile.am
Modified: trunk/stdair/stdair.spec
===================================================================
--- trunk/stdair/stdair.spec 2010-08-28 21:31:51 UTC (rev 287)
+++ trunk/stdair/stdair.spec 2010-08-28 21:33:32 UTC (rev 288)
@@ -68,7 +68,7 @@
%install
# On Fedora, the BuildRoot is automatically cleaned. Which is not the case for
# RedHat. See: https://fedoraproject.org/wiki/Packaging/Guidelines#BuildRoot_tag
-%if %{?rhel:rm -rf $RPM_BUILD_ROOT}
+%{?rhel:rm -rf $RPM_BUILD_ROOT}
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
# remove unpackaged files from the buildroot
rm -f $RPM_BUILD_ROOT%{_libdir}/lib%{name}.la
Modified: trunk/stdair/test/Makefile.am
===================================================================
--- trunk/stdair/test/Makefile.am 2010-08-28 21:31:51 UTC (rev 287)
+++ trunk/stdair/test/Makefile.am 2010-08-28 21:33:32 UTC (rev 288)
@@ -4,7 +4,7 @@
MAINTAINERCLEANFILES = Makefile.in
##
-SUBDIRS = samples inheritance mpl stdair
+SUBDIRS = samples inheritance mpl architecture stdair
EXTRA_DIST =
##
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-08-28 21:31:57
|
Revision: 287
http://stdair.svn.sourceforge.net/stdair/?rev=287&view=rev
Author: denis_arnaud
Date: 2010-08-28 21:31:51 +0000 (Sat, 28 Aug 2010)
Log Message:
-----------
[Branch 0.3.0] Fixed RPM packaging issues.
Modified Paths:
--------------
branches/stdair/0.3.0/main/stdair.spec
branches/stdair/0.3.0/main/test/Makefile.am
Modified: branches/stdair/0.3.0/main/stdair.spec
===================================================================
--- branches/stdair/0.3.0/main/stdair.spec 2010-08-28 21:21:40 UTC (rev 286)
+++ branches/stdair/0.3.0/main/stdair.spec 2010-08-28 21:31:51 UTC (rev 287)
@@ -68,7 +68,7 @@
%install
# On Fedora, the BuildRoot is automatically cleaned. Which is not the case for
# RedHat. See: https://fedoraproject.org/wiki/Packaging/Guidelines#BuildRoot_tag
-%if %{?rhel:rm -rf $RPM_BUILD_ROOT}
+%{?rhel:rm -rf $RPM_BUILD_ROOT}
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
# remove unpackaged files from the buildroot
rm -f $RPM_BUILD_ROOT%{_libdir}/lib%{name}.la
Modified: branches/stdair/0.3.0/main/test/Makefile.am
===================================================================
--- branches/stdair/0.3.0/main/test/Makefile.am 2010-08-28 21:21:40 UTC (rev 286)
+++ branches/stdair/0.3.0/main/test/Makefile.am 2010-08-28 21:31:51 UTC (rev 287)
@@ -4,7 +4,7 @@
MAINTAINERCLEANFILES = Makefile.in
##
-SUBDIRS = samples inheritance mpl stdair
+SUBDIRS = samples inheritance mpl architecture stdair
EXTRA_DIST =
##
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-08-28 21:21:46
|
Revision: 286
http://stdair.svn.sourceforge.net/stdair/?rev=286&view=rev
Author: denis_arnaud
Date: 2010-08-28 21:21:40 +0000 (Sat, 28 Aug 2010)
Log Message:
-----------
[Release] Created the main 0.3.0 release branch, from revision r283.
Added Paths:
-----------
branches/stdair/0.3.0/main/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-08-28 21:19:29
|
Revision: 285
http://stdair.svn.sourceforge.net/stdair/?rev=285&view=rev
Author: denis_arnaud
Date: 2010-08-28 21:19:22 +0000 (Sat, 28 Aug 2010)
Log Message:
-----------
[Branch 0.3.0] Prepared the branch 0.3.0 to be copied from head of the trunk.
Added Paths:
-----------
branches/stdair/0.3.0/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-08-28 21:18:05
|
Revision: 284
http://stdair.svn.sourceforge.net/stdair/?rev=284&view=rev
Author: denis_arnaud
Date: 2010-08-28 21:17:59 +0000 (Sat, 28 Aug 2010)
Log Message:
-----------
[Release] Back to standard working version (99.99.99).
Modified Paths:
--------------
trunk/stdair/configure.ac
trunk/stdair/stdair.spec
Modified: trunk/stdair/configure.ac
===================================================================
--- trunk/stdair/configure.ac 2010-08-28 21:16:29 UTC (rev 283)
+++ trunk/stdair/configure.ac 2010-08-28 21:17:59 UTC (rev 284)
@@ -2,7 +2,7 @@
#-------------------------------------------------------------------
AC_PREREQ(2.59)
AC_COPYRIGHT([Copyright (C) 2007-2010 Denis Arnaud <den...@us...>])
-AC_INIT([STDAIR],[0.3.0],[den...@us...],[stdair])
+AC_INIT([STDAIR],[99.99.99],[den...@us...],[stdair])
AC_CONFIG_HEADER([stdair/config.h])
AC_CONFIG_SRCDIR([stdair/bom/BomRoot.hpp])
AC_CONFIG_AUX_DIR([config])
@@ -11,7 +11,7 @@
AM_CONDITIONAL([HAVE_CPPUNIT], [test "x$CPPUNIT_LIBS" != x])
# Shared library versioning
-GENERIC_LIBRARY_VERSION="0:3:0"
+GENERIC_LIBRARY_VERSION="99:99:99"
# | | |
# +------+ | +---+
# | | |
Modified: trunk/stdair/stdair.spec
===================================================================
--- trunk/stdair/stdair.spec 2010-08-28 21:16:29 UTC (rev 283)
+++ trunk/stdair/stdair.spec 2010-08-28 21:17:59 UTC (rev 284)
@@ -2,7 +2,7 @@
%global mydocs __tmp_docdir
#
Name: stdair
-Version: 0.3.0
+Version: 99.99.99
Release: 1%{?dist}
Summary: C++ Standard Airline IT Object Library
@@ -110,6 +110,9 @@
%changelog
+* Sun Aug 30 2010 Son Nguyen Kim <ngu...@gm...> 99.99.99-1
+- Upstream update
+
* Sun Aug 29 2010 Son Nguyen Kim <ngu...@gm...> 0.3.0-1
- Upstream update
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-08-28 21:16:35
|
Revision: 283
http://stdair.svn.sourceforge.net/stdair/?rev=283&view=rev
Author: denis_arnaud
Date: 2010-08-28 21:16:29 +0000 (Sat, 28 Aug 2010)
Log Message:
-----------
[Release] Release 0.3.0.
Modified Paths:
--------------
trunk/stdair/configure.ac
trunk/stdair/stdair.spec
Modified: trunk/stdair/configure.ac
===================================================================
--- trunk/stdair/configure.ac 2010-08-28 21:14:19 UTC (rev 282)
+++ trunk/stdair/configure.ac 2010-08-28 21:16:29 UTC (rev 283)
@@ -2,7 +2,7 @@
#-------------------------------------------------------------------
AC_PREREQ(2.59)
AC_COPYRIGHT([Copyright (C) 2007-2010 Denis Arnaud <den...@us...>])
-AC_INIT([STDAIR],[99.99.99],[den...@us...],[stdair])
+AC_INIT([STDAIR],[0.3.0],[den...@us...],[stdair])
AC_CONFIG_HEADER([stdair/config.h])
AC_CONFIG_SRCDIR([stdair/bom/BomRoot.hpp])
AC_CONFIG_AUX_DIR([config])
@@ -10,12 +10,8 @@
AM_PATH_CPPUNIT(1.10)
AM_CONDITIONAL([HAVE_CPPUNIT], [test "x$CPPUNIT_LIBS" != x])
-# RPM release number
-RPM_RELEASE="1"
-AC_SUBST(RPM_RELEASE)
-
# Shared library versioning
-GENERIC_LIBRARY_VERSION="99:99:99"
+GENERIC_LIBRARY_VERSION="0:3:0"
# | | |
# +------+ | +---+
# | | |
Modified: trunk/stdair/stdair.spec
===================================================================
--- trunk/stdair/stdair.spec 2010-08-28 21:14:19 UTC (rev 282)
+++ trunk/stdair/stdair.spec 2010-08-28 21:16:29 UTC (rev 283)
@@ -2,7 +2,7 @@
%global mydocs __tmp_docdir
#
Name: stdair
-Version: 99.99.99
+Version: 0.3.0
Release: 1%{?dist}
Summary: C++ Standard Airline IT Object Library
@@ -110,7 +110,7 @@
%changelog
-* Sun Jul 26 2010 Son Nguyen Kim <ngu...@gm...> 99.99.99-1
+* Sun Aug 29 2010 Son Nguyen Kim <ngu...@gm...> 0.3.0-1
- Upstream update
* Wed Jul 13 2010 Son Nguyen Kim <ngu...@gm...> 0.1.0-1
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-08-28 21:14:26
|
Revision: 282
http://stdair.svn.sourceforge.net/stdair/?rev=282&view=rev
Author: denis_arnaud
Date: 2010-08-28 21:14:19 +0000 (Sat, 28 Aug 2010)
Log Message:
-----------
[Packaging] Took into account the feedback from review (https://bugzilla.redhat.com/show_bug.cgi?id=614036).
Modified Paths:
--------------
trunk/stdair/stdair.spec
Modified: trunk/stdair/stdair.spec
===================================================================
--- trunk/stdair/stdair.spec 2010-08-28 20:39:17 UTC (rev 281)
+++ trunk/stdair/stdair.spec 2010-08-28 21:14:19 UTC (rev 282)
@@ -14,6 +14,7 @@
%{?el5:BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)}
BuildRequires: boost-devel
+BuildRequires: soci-mysql-devel
BuildRequires: cppunit-devel
@@ -31,8 +32,6 @@
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: pkgconfig
-Requires(post): info
-Requires(preun): info
%description devel
This package contains the header files, static libraries and
@@ -56,7 +55,6 @@
%prep
%setup -q
-# find ./doc -type f -perm 755 -exec chmod 644 {} \;
# Fix some permissions and formats
rm -f INSTALL
chmod -x AUTHORS ChangeLog COPYING NEWS README
@@ -73,10 +71,9 @@
%if %{?rhel:rm -rf $RPM_BUILD_ROOT}
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
# remove unpackaged files from the buildroot
-rm -f $RPM_BUILD_ROOT%{_infodir}/dir
rm -f $RPM_BUILD_ROOT%{_libdir}/lib%{name}.la
rm -f $RPM_BUILD_ROOT%{_libdir}/libextracppunit.la
-rm -rf %{mydocs} && mkdir -p %{mydocs}
+mkdir -p %{mydocs}
mv $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/html %{mydocs}
%clean
@@ -92,7 +89,7 @@
%doc AUTHORS ChangeLog COPYING NEWS README
%{_bindir}/%{name}
%{_libdir}/lib*.so.*
-%{_mandir}/man3/%{name}.3.*
+%{_mandir}/man1/%{name}.1.*
%files devel
%defattr(-,root,root,-)
@@ -104,11 +101,12 @@
%{_libdir}/pkgconfig/%{name}.pc
%{_datadir}/aclocal/%{name}.m4
%{_mandir}/man1/%{name}-config.1.*
+%{_mandir}/man3/%{name}.3.*
%files doc
%defattr(-,root,root,-)
%doc %{mydocs}/html
-%doc AUTHORS ChangeLog COPYING NEWS README
+%doc COPYING
%changelog
@@ -117,4 +115,3 @@
* Wed Jul 13 2010 Son Nguyen Kim <ngu...@gm...> 0.1.0-1
- First RPM release
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-08-28 20:39:24
|
Revision: 281
http://stdair.svn.sourceforge.net/stdair/?rev=281&view=rev
Author: denis_arnaud
Date: 2010-08-28 20:39:17 +0000 (Sat, 28 Aug 2010)
Log Message:
-----------
[Dev] Just added a const in the batch.
Modified Paths:
--------------
trunk/stdair/stdair/batches/stdair.cpp
Modified: trunk/stdair/stdair/batches/stdair.cpp
===================================================================
--- trunk/stdair/stdair/batches/stdair.cpp 2010-08-24 16:56:23 UTC (rev 280)
+++ trunk/stdair/stdair/batches/stdair.cpp 2010-08-28 20:39:17 UTC (rev 281)
@@ -164,13 +164,13 @@
// Step 0.1: Inventory level
// Create an Inventory for BA
- stdair::InventoryKey lBAKey ("BA");
+ const stdair::InventoryKey lBAKey ("BA");
stdair::Inventory& lBAInv =
stdair::FacBom<stdair::Inventory>::instance().create (lBAKey);
stdair::FacBomManager::addToList (lBomRoot, lBAInv);
// Create an Inventory for AF
- stdair::InventoryKey lAFKey ("AF");
+ const stdair::InventoryKey lAFKey ("AF");
stdair::Inventory& lAFInv =
stdair::FacBom<stdair::Inventory>::instance().create (lAFKey);
stdair::FacBomManager::addToList (lBomRoot, lAFInv);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <qua...@us...> - 2010-08-24 16:56:30
|
Revision: 280
http://stdair.svn.sourceforge.net/stdair/?rev=280&view=rev
Author: quannaus
Date: 2010-08-24 16:56:23 +0000 (Tue, 24 Aug 2010)
Log Message:
-----------
[dev] added the detailed list to RelationShip.
Modified Paths:
--------------
trunk/stdair/stdair/bom/BomManager.hpp
trunk/stdair/stdair/bom/RelationShip.hpp
trunk/stdair/stdair/bom/SegmentPeriodTypes.hpp
trunk/stdair/stdair/factory/FacBomManager.hpp
Modified: trunk/stdair/stdair/bom/BomManager.hpp
===================================================================
--- trunk/stdair/stdair/bom/BomManager.hpp 2010-08-24 14:57:23 UTC (rev 279)
+++ trunk/stdair/stdair/bom/BomManager.hpp 2010-08-24 16:56:23 UTC (rev 280)
@@ -18,12 +18,16 @@
template <typename CHILD, typename PARENT>
static std::list<CHILD*>& getList (const PARENT&);
template <typename CHILD, typename PARENT>
+ static std::list<std::pair<MapKey_T, CHILD*> >& getDetailedList (const PARENT&);
+ template <typename CHILD, typename PARENT>
static std::map<const MapKey_T, CHILD*>& getMap (const PARENT&);
/** Check if the list/map of children has been initialised. */
template <typename CHILD, typename PARENT>
static bool hasList (const PARENT&);
template <typename CHILD, typename PARENT>
+ static bool hasDetailedList (const PARENT&);
+ template <typename CHILD, typename PARENT>
static bool hasMap (const PARENT&);
/** Getter of the PARENT given the CHILD. */
@@ -47,6 +51,14 @@
}
// ////////////////////////////////////////////////////////////////////
+ template <typename CHILD, typename PARENT>
+ std::list<std::pair<MapKey_T, CHILD*> >& BomManager::
+ getDetailedList (const PARENT& iParent) {
+ return RelationShip<PARENT, CHILD>::
+ instance().getChildrenDetailedList (iParent);
+ }
+
+ // ////////////////////////////////////////////////////////////////////
template <typename CHILD, typename PARENT> std::map<const MapKey_T, CHILD*>&
BomManager::getMap (const PARENT& iParent) {
return RelationShip<PARENT, CHILD>::instance().getChildrenMap (iParent);
@@ -60,6 +72,13 @@
// ////////////////////////////////////////////////////////////////////
template <typename CHILD, typename PARENT>
+ bool BomManager::hasDetailedList (const PARENT& iParent) {
+ return RelationShip<PARENT, CHILD>::
+ instance().hasChildrenDetailedList (iParent);
+ }
+
+ // ////////////////////////////////////////////////////////////////////
+ template <typename CHILD, typename PARENT>
bool BomManager::hasMap (const PARENT& iParent) {
return RelationShip<PARENT, CHILD>::instance().hasChildrenMap (iParent);
}
Modified: trunk/stdair/stdair/bom/RelationShip.hpp
===================================================================
--- trunk/stdair/stdair/bom/RelationShip.hpp 2010-08-24 14:57:23 UTC (rev 279)
+++ trunk/stdair/stdair/bom/RelationShip.hpp 2010-08-24 16:56:23 UTC (rev 280)
@@ -27,8 +27,11 @@
// //////////////////////////////////////////////////////////////////
// Internal type definitions.
typedef std::list<CHILD*> ChildrenList_T;
+ typedef std::list<std::pair<MapKey_T, CHILD*> > ChildrenDetailedList_T;
typedef std::map<const MapKey_T, CHILD*> ChildrenMap_T;
typedef std::map<const PARENT*, ChildrenList_T> ParentChildrentList_T;
+ typedef std::map<const PARENT*,
+ ChildrenDetailedList_T> ParentChildrentDetailedList_T;
typedef std::map<const PARENT*, ChildrenMap_T> ParentChildrentMap_T;
typedef std::map<const CHILD*, PARENT*> ChildParentMap_T;
// //////////////////////////////////////////////////////////////////
@@ -43,6 +46,7 @@
// ////////////////////// Business Methods /////////////////////////
/** Getter of the children conainter given the PARENT pointer. */
ChildrenList_T& getChildrenList (const PARENT&);
+ ChildrenDetailedList_T& getChildrenDetailedList (const PARENT&);
ChildrenMap_T& getChildrenMap (const PARENT&);
/** Getter of the PARENT given the CHILD. */
@@ -57,11 +61,13 @@
/** Check if the list/map of children has been initialised. */
bool hasChildrenList (const PARENT&);
+ bool hasChildrenDetailedList (const PARENT&);
bool hasChildrenMap (const PARENT&);
private:
/** Add the given CHILD to the children containter of the given PARENT. */
void addChildToTheList (const PARENT&, CHILD&);
+ void addChildToTheDetailedList (const PARENT&, CHILD&, const MapKey_T&);
void addChildToTheMap (const PARENT&, CHILD&);
void addChildToTheMap (const PARENT&, CHILD&, const MapKey_T&);
@@ -79,6 +85,7 @@
static RelationShip* _instance;
/** The containers of relation ships. */
ParentChildrentList_T _parentChildrenList;
+ ParentChildrentDetailedList_T _parentChildrenDetailedList;
ParentChildrentMap_T _parentChildrenMap;
ChildParentMap_T _childParentMap;
};
@@ -117,6 +124,24 @@
// ////////////////////////////////////////////////////////////////////
template <typename PARENT, typename CHILD>
+ typename RelationShip<PARENT, CHILD>::ChildrenDetailedList_T&
+ RelationShip<PARENT, CHILD>::getChildrenDetailedList (const PARENT& iParent) {
+ ParentChildrentDetailedList_T& lParentChildrenDetailedList =
+ instance()._parentChildrenDetailedList;
+ typename ParentChildrentDetailedList_T::iterator itDetailedList =
+ lParentChildrenDetailedList.find (&iParent);
+
+ if (itDetailedList == lParentChildrenDetailedList.end()) {
+ STDAIR_LOG_ERROR ("Cannot find the detailed list within: "
+ << iParent.describeKey());
+ throw NonInitialisedContainerException ();
+ }
+
+ return itDetailedList->second;
+ }
+
+ // ////////////////////////////////////////////////////////////////////
+ template <typename PARENT, typename CHILD>
typename RelationShip<PARENT, CHILD>::ChildrenMap_T&
RelationShip<PARENT, CHILD>::getChildrenMap (const PARENT& iParent) {
ParentChildrentMap_T& lParentChildrenMap = instance()._parentChildrenMap;
@@ -146,6 +171,20 @@
// ////////////////////////////////////////////////////////////////////
template <typename PARENT, typename CHILD> bool RelationShip<PARENT, CHILD>::
+ hasChildrenDetailedList (const PARENT& iParent) {
+ ParentChildrentDetailedList_T& lParentChildrenDetailedList =
+ instance()._parentChildrenDetailedList;
+ typename ParentChildrentDetailedList_T::iterator itDetailedList =
+ lParentChildrenDetailedList.find (&iParent);
+
+ if (itDetailedList == lParentChildrenDetailedList.end()) {
+ return false;
+ }
+ return true;
+ }
+
+ // ////////////////////////////////////////////////////////////////////
+ template <typename PARENT, typename CHILD> bool RelationShip<PARENT, CHILD>::
hasChildrenMap (const PARENT& iParent) {
ParentChildrentMap_T& lParentChildrenMap = instance()._parentChildrenMap;
typename ParentChildrentMap_T::iterator itMap =
@@ -225,6 +264,16 @@
// ////////////////////////////////////////////////////////////////////
template <typename PARENT, typename CHILD> void RelationShip<PARENT, CHILD>::
+ addChildToTheDetailedList (const PARENT& iParent, CHILD& ioChild,
+ const MapKey_T& iKey) {
+ ParentChildrentDetailedList_T& lParentChildrenDetailedList =
+ instance()._parentChildrenDetailedList;
+ lParentChildrenDetailedList[&iParent].
+ push_back (std::pair<const MapKey_T, CHILD*> (iKey, &ioChild));
+ }
+
+ // ////////////////////////////////////////////////////////////////////
+ template <typename PARENT, typename CHILD> void RelationShip<PARENT, CHILD>::
addChildToTheMap (const PARENT& iParent, CHILD& ioChild) {
ParentChildrentMap_T& lParentChildrenMap = instance()._parentChildrenMap;
Modified: trunk/stdair/stdair/bom/SegmentPeriodTypes.hpp
===================================================================
--- trunk/stdair/stdair/bom/SegmentPeriodTypes.hpp 2010-08-24 14:57:23 UTC (rev 279)
+++ trunk/stdair/stdair/bom/SegmentPeriodTypes.hpp 2010-08-24 16:56:23 UTC (rev 280)
@@ -20,7 +20,11 @@
typedef std::list<SegmentPeriod*> SegmentPeriodList_T;
/** Define the segment-period map. */
- typedef std::map<const MapKey_T&, SegmentPeriod*> SegmentPeriodMap_T;
+ typedef std::map<const MapKey_T, SegmentPeriod*> SegmentPeriodMap_T;
+
+ /** Define the list of pair<MapKey_T, SegmentPeriod>. */
+ typedef std::pair<MapKey_T, SegmentPeriod*> SegmentPeriodWithKey_T;
+ typedef std::list<SegmentPeriodWithKey_T> SegmentPeriodDetailedList_T;
}
#endif // __STDAIR_BOM_SEGMENTPERIODTYPES_HPP
Modified: trunk/stdair/stdair/factory/FacBomManager.hpp
===================================================================
--- trunk/stdair/stdair/factory/FacBomManager.hpp 2010-08-24 14:57:23 UTC (rev 279)
+++ trunk/stdair/stdair/factory/FacBomManager.hpp 2010-08-24 16:56:23 UTC (rev 280)
@@ -23,6 +23,8 @@
template <typename PARENT, typename CHILD>
static void addToList (const PARENT&, CHILD&);
template <typename PARENT, typename CHILD>
+ static void addToDetailedList (const PARENT&, CHILD&, const MapKey_T&);
+ template <typename PARENT, typename CHILD>
static void addToMap (const PARENT&, CHILD&);
template <typename PARENT, typename CHILD>
static void addToMap (const PARENT&, CHILD&, const MapKey_T&);
@@ -37,7 +39,7 @@
/** Clone the list of children between two objects. */
template <typename CHILD, typename PARENT>
- static void cloneChildrenList (const PARENT&, const PARENT&);
+ static void cloneChildrenDetailedList (const PARENT&, const PARENT&);
};
@@ -55,6 +57,15 @@
// ////////////////////////////////////////////////////////////////////
template <typename PARENT, typename CHILD> void FacBomManager::
+ addToDetailedList (const PARENT& iParent, CHILD& ioChild,
+ const MapKey_T& iKey) {
+ RelationShip<PARENT, CHILD>::instance().addChildToTheDetailedList (iParent,
+ ioChild,
+ iKey);
+ }
+
+ // ////////////////////////////////////////////////////////////////////
+ template <typename PARENT, typename CHILD> void FacBomManager::
addToMap (const PARENT& iParent, CHILD& ioChild) {
RelationShip<PARENT, CHILD>::instance().addChildToTheMap (iParent, ioChild);
}
@@ -89,10 +100,10 @@
// ////////////////////////////////////////////////////////////////////
template <typename CHILD, typename PARENT> void FacBomManager::
- cloneChildrenList (const PARENT& iP1, const PARENT& iP2) {
- const std::list<CHILD*>& lList =
- RelationShip<PARENT, CHILD>::instance().getChildrenList (iP2);
- RelationShip<PARENT, CHILD>::instance()._parentChildrenList[&iP1] = lList;
+ cloneChildrenDetailedList (const PARENT& iP1, const PARENT& iP2) {
+ const std::list<std::pair<MapKey_T, CHILD*> >& lDetailedList =
+ RelationShip<PARENT, CHILD>::instance().getChildrenDetailedList (iP2);
+ RelationShip<PARENT, CHILD>::instance()._parentChildrenDetailedList[&iP1] = lDetailedList;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <qua...@us...> - 2010-08-24 14:57:29
|
Revision: 279
http://stdair.svn.sourceforge.net/stdair/?rev=279&view=rev
Author: quannaus
Date: 2010-08-24 14:57:23 +0000 (Tue, 24 Aug 2010)
Log Message:
-----------
[dev] added the checker for children list and map initialisation.
Modified Paths:
--------------
trunk/stdair/stdair/bom/BomManager.hpp
trunk/stdair/stdair/bom/RelationShip.hpp
Modified: trunk/stdair/stdair/bom/BomManager.hpp
===================================================================
--- trunk/stdair/stdair/bom/BomManager.hpp 2010-08-21 20:10:15 UTC (rev 278)
+++ trunk/stdair/stdair/bom/BomManager.hpp 2010-08-24 14:57:23 UTC (rev 279)
@@ -20,6 +20,12 @@
template <typename CHILD, typename PARENT>
static std::map<const MapKey_T, CHILD*>& getMap (const PARENT&);
+ /** Check if the list/map of children has been initialised. */
+ template <typename CHILD, typename PARENT>
+ static bool hasList (const PARENT&);
+ template <typename CHILD, typename PARENT>
+ static bool hasMap (const PARENT&);
+
/** Getter of the PARENT given the CHILD. */
template <typename PARENT, typename CHILD>
static PARENT& getParent (const CHILD&);
@@ -47,6 +53,18 @@
}
// ////////////////////////////////////////////////////////////////////
+ template <typename CHILD, typename PARENT>
+ bool BomManager::hasList (const PARENT& iParent) {
+ return RelationShip<PARENT, CHILD>::instance().hasChildrenList (iParent);
+ }
+
+ // ////////////////////////////////////////////////////////////////////
+ template <typename CHILD, typename PARENT>
+ bool BomManager::hasMap (const PARENT& iParent) {
+ return RelationShip<PARENT, CHILD>::instance().hasChildrenMap (iParent);
+ }
+
+ // ////////////////////////////////////////////////////////////////////
template <typename PARENT, typename CHILD>
PARENT& BomManager::getParent (const CHILD& iChild) {
return RelationShip<PARENT, CHILD>::instance().getParent (iChild);
Modified: trunk/stdair/stdair/bom/RelationShip.hpp
===================================================================
--- trunk/stdair/stdair/bom/RelationShip.hpp 2010-08-21 20:10:15 UTC (rev 278)
+++ trunk/stdair/stdair/bom/RelationShip.hpp 2010-08-24 14:57:23 UTC (rev 279)
@@ -28,11 +28,8 @@
// Internal type definitions.
typedef std::list<CHILD*> ChildrenList_T;
typedef std::map<const MapKey_T, CHILD*> ChildrenMap_T;
- typedef std::multimap<const MapKey_T, CHILD*> ChildrenMultimap_T;
typedef std::map<const PARENT*, ChildrenList_T> ParentChildrentList_T;
typedef std::map<const PARENT*, ChildrenMap_T> ParentChildrentMap_T;
- typedef std::map<const PARENT*,
- ChildrenMultimap_T> ParentChildrentMultimap_T;
typedef std::map<const CHILD*, PARENT*> ChildParentMap_T;
// //////////////////////////////////////////////////////////////////
@@ -47,7 +44,6 @@
/** Getter of the children conainter given the PARENT pointer. */
ChildrenList_T& getChildrenList (const PARENT&);
ChildrenMap_T& getChildrenMap (const PARENT&);
- ChildrenMultimap_T& getChildrenMultimap (const PARENT&);
/** Getter of the PARENT given the CHILD. */
PARENT& getParent (const CHILD&);
@@ -59,13 +55,15 @@
/** Return the CHILD corresponding the the given string key. */
CHILD& getChild (const PARENT&, const MapKey_T&);
+ /** Check if the list/map of children has been initialised. */
+ bool hasChildrenList (const PARENT&);
+ bool hasChildrenMap (const PARENT&);
+
private:
/** Add the given CHILD to the children containter of the given PARENT. */
void addChildToTheList (const PARENT&, CHILD&);
void addChildToTheMap (const PARENT&, CHILD&);
void addChildToTheMap (const PARENT&, CHILD&, const MapKey_T&);
- void addChildToTheMultimap (const PARENT&, CHILD&);
- void addChildToTheMultimap (const PARENT&, CHILD&, const MapKey_T&);
/** Link the CHILD with the PARENT. */
void linkWithParent (PARENT&, const CHILD&);
@@ -82,7 +80,6 @@
/** The containers of relation ships. */
ParentChildrentList_T _parentChildrenList;
ParentChildrentMap_T _parentChildrenMap;
- ParentChildrentMultimap_T _parentChildrenMultimap;
ChildParentMap_T _childParentMap;
};
@@ -135,21 +132,29 @@
}
// ////////////////////////////////////////////////////////////////////
- template <typename PARENT, typename CHILD>
- typename RelationShip<PARENT, CHILD>::ChildrenMultimap_T&
- RelationShip<PARENT, CHILD>::getChildrenMultimap (const PARENT& iParent) {
- ParentChildrentMultimap_T& lParentChildrenMultimap =
- instance()._parentChildrenMultimap;
- typename ParentChildrentMultimap_T::iterator itMultimap =
- lParentChildrenMultimap.find (&iParent);
+ template <typename PARENT, typename CHILD> bool RelationShip<PARENT, CHILD>::
+ hasChildrenList (const PARENT& iParent) {
+ ParentChildrentList_T& lParentChildrenList = instance()._parentChildrenList;
+ typename ParentChildrentList_T::iterator itList =
+ lParentChildrenList.find (&iParent);
- if (itMultimap == lParentChildrenMultimap.end()) {
- STDAIR_LOG_ERROR ("Cannot find the multimap within: "
- << iParent.describeKey());
- throw NonInitialisedContainerException ();
+ if (itList == lParentChildrenList.end()) {
+ return false;
}
+ return true;
+ }
- return itMultimap->second;
+ // ////////////////////////////////////////////////////////////////////
+ template <typename PARENT, typename CHILD> bool RelationShip<PARENT, CHILD>::
+ hasChildrenMap (const PARENT& iParent) {
+ ParentChildrentMap_T& lParentChildrenMap = instance()._parentChildrenMap;
+ typename ParentChildrentMap_T::iterator itMap =
+ lParentChildrenMap.find (&iParent);
+
+ if (itMap == lParentChildrenMap.end()) {
+ return false;
+ }
+ return true;
}
// ////////////////////////////////////////////////////////////////////
@@ -171,8 +176,7 @@
template <typename PARENT, typename CHILD>
CHILD* RelationShip<PARENT, CHILD>::
getChildPtr (const PARENT& iParent, const MapKey_T& iKey) {
- // Look for the child in the map, then the multimap.
- // 1. Map
+
ParentChildrentMap_T lParentChildrenMap = instance()._parentChildrenMap;
typename ParentChildrentMap_T::iterator itMap =
lParentChildrenMap.find (&iParent);
@@ -186,23 +190,6 @@
return oChild_ptr;
}
}
-
- // 2. Multimap
- ParentChildrentMultimap_T lParentChildrenMultimap =
- instance()._parentChildrenMultimap;
- typename ParentChildrentMultimap_T::iterator itMultimap =
- lParentChildrenMultimap.find (&iParent);
-
- if (itMultimap != lParentChildrenMultimap.end()) {
- ChildrenMultimap_T& lChildrenMultimap = itMultimap->second;
- typename ChildrenMultimap_T::iterator itChild =
- lChildrenMultimap.find (iKey);
- if (itChild != lChildrenMultimap.end()) {
- CHILD* oChild_ptr = itChild->second;
- assert (oChild_ptr);
- return oChild_ptr;
- }
- }
return NULL;
}
@@ -211,8 +198,7 @@
template <typename PARENT, typename CHILD>
CHILD& RelationShip<PARENT, CHILD>::
getChild (const PARENT& iParent, const MapKey_T& iKey) {
- // Look for the child in the map, then the multimap.
- // 1. Map
+
ParentChildrentMap_T lParentChildrenMap = instance()._parentChildrenMap;
typename ParentChildrentMap_T::iterator itMap =
lParentChildrenMap.find (&iParent);
@@ -227,23 +213,6 @@
}
}
- // 2. Multimap
- ParentChildrentMultimap_T lParentChildrenMultimap =
- instance()._parentChildrenMultimap;
- typename ParentChildrentMultimap_T::iterator itMultimap =
- lParentChildrenMultimap.find (&iParent);
-
- if (itMultimap != lParentChildrenMultimap.end()) {
- ChildrenMultimap_T& lChildrenMultimap = itMultimap->second;
- typename ChildrenMultimap_T::iterator itChild =
- lChildrenMultimap.find (iKey);
- if (itChild != lChildrenMultimap.end()) {
- CHILD* oChild_ptr = itChild->second;
- assert (oChild_ptr);
- return *oChild_ptr;
- }
- }
-
throw NonInitialisedRelationShip ();
}
@@ -289,27 +258,6 @@
// ////////////////////////////////////////////////////////////////////
template <typename PARENT, typename CHILD> void RelationShip<PARENT, CHILD>::
- addChildToTheMultimap (const PARENT& iParent, CHILD& ioChild) {
- ParentChildrentMultimap_T& lParentChildrenMultimap =
- instance()._parentChildrenMultimap;
-
- const MapKey_T& lKey = ioChild.describeKey ();
- bool insertionSucceeded = lParentChildrenMultimap[&iParent].
- insert (typename ChildrenMultimap_T::value_type (lKey, &ioChild)).second;
- }
-
- // ////////////////////////////////////////////////////////////////////
- template <typename PARENT, typename CHILD> void RelationShip<PARENT, CHILD>::
- addChildToTheMultimap (const PARENT& iParent, CHILD& ioChild,
- const MapKey_T& iKey) {
- ParentChildrentMultimap_T& lParentChildrenMultimap =
- instance()._parentChildrenMultimap;
- bool insertionSucceeded = lParentChildrenMultimap[&iParent].
- insert (typename ChildrenMultimap_T::value_type (iKey, &ioChild)).second;
- }
-
- // ////////////////////////////////////////////////////////////////////
- template <typename PARENT, typename CHILD> void RelationShip<PARENT, CHILD>::
linkWithParent (PARENT& ioParent, const CHILD& iChild) {
instance()._childParentMap[&iChild] = &ioParent;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-08-21 20:10:21
|
Revision: 278
http://stdair.svn.sourceforge.net/stdair/?rev=278&view=rev
Author: denis_arnaud
Date: 2010-08-21 20:10:15 +0000 (Sat, 21 Aug 2010)
Log Message:
-----------
[Packaging] Took into account latest RPM guidelines.
Modified Paths:
--------------
trunk/stdair/stdair.spec
Modified: trunk/stdair/stdair.spec
===================================================================
--- trunk/stdair/stdair.spec 2010-08-20 19:06:52 UTC (rev 277)
+++ trunk/stdair/stdair.spec 2010-08-21 20:10:15 UTC (rev 278)
@@ -15,8 +15,8 @@
BuildRequires: boost-devel
BuildRequires: cppunit-devel
-#Requires:
+
%description
%{name} aims at providing a clean API, and the corresponding C++
implementation, for the basis of Airline IT Business Object Model (BOM),
@@ -42,13 +42,10 @@
%package doc
Summary: HTML documentation for the %{name} library
Group: Documentation
-%if 0%{?fedora} >= 10
+%if 0%{?fedora}
BuildArch: noarch
BuildRequires: texlive-latex
%endif
-%if 0%{?fedora} < 10
-BuildRequires: tetex-latex
-%endif
%{?el5:BuildRequires: tetex-latex}
BuildRequires: doxygen, ghostscript
@@ -71,8 +68,10 @@
make %{?_smp_mflags}
%install
-rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
+# On Fedora, the BuildRoot is automatically cleaned. Which is not the case for
+# RedHat. See: https://fedoraproject.org/wiki/Packaging/Guidelines#BuildRoot_tag
+%if %{?rhel:rm -rf $RPM_BUILD_ROOT}
+make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
# remove unpackaged files from the buildroot
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
rm -f $RPM_BUILD_ROOT%{_libdir}/lib%{name}.la
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-08-20 19:06:58
|
Revision: 277
http://stdair.svn.sourceforge.net/stdair/?rev=277&view=rev
Author: denis_arnaud
Date: 2010-08-20 19:06:52 +0000 (Fri, 20 Aug 2010)
Log Message:
-----------
[Dev] Changed the source reference for the (Autotools) configuration.
Modified Paths:
--------------
trunk/stdair/configure.ac
Modified: trunk/stdair/configure.ac
===================================================================
--- trunk/stdair/configure.ac 2010-08-20 17:46:36 UTC (rev 276)
+++ trunk/stdair/configure.ac 2010-08-20 19:06:52 UTC (rev 277)
@@ -4,7 +4,7 @@
AC_COPYRIGHT([Copyright (C) 2007-2010 Denis Arnaud <den...@us...>])
AC_INIT([STDAIR],[99.99.99],[den...@us...],[stdair])
AC_CONFIG_HEADER([stdair/config.h])
-AC_CONFIG_SRCDIR([stdair/bom/BomKey.hpp])
+AC_CONFIG_SRCDIR([stdair/bom/BomRoot.hpp])
AC_CONFIG_AUX_DIR([config])
AM_INIT_AUTOMAKE
AM_PATH_CPPUNIT(1.10)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-08-20 17:46:43
|
Revision: 276
http://stdair.svn.sourceforge.net/stdair/?rev=276&view=rev
Author: denis_arnaud
Date: 2010-08-20 17:46:36 +0000 (Fri, 20 Aug 2010)
Log Message:
-----------
[Dev] Added a full example for BOM tree construction.
Modified Paths:
--------------
trunk/stdair/stdair/batches/stdair.cpp
trunk/stdair/stdair/bom/BookingClass.cpp
trunk/stdair/stdair/bom/FlightDate.cpp
trunk/stdair/stdair/bom/FlightPeriod.cpp
trunk/stdair/stdair/bom/Inventory.cpp
trunk/stdair/stdair/bom/LegCabin.cpp
trunk/stdair/stdair/bom/LegDate.cpp
trunk/stdair/stdair/bom/OptimizerStruct.cpp
trunk/stdair/stdair/bom/SegmentCabin.cpp
trunk/stdair/stdair/bom/SegmentDate.cpp
trunk/stdair/stdair/bom/SegmentPeriod.cpp
Modified: trunk/stdair/stdair/batches/stdair.cpp
===================================================================
--- trunk/stdair/stdair/batches/stdair.cpp 2010-08-20 15:30:16 UTC (rev 275)
+++ trunk/stdair/stdair/batches/stdair.cpp 2010-08-20 17:46:36 UTC (rev 276)
@@ -17,6 +17,18 @@
#include <stdair/bom/BomRoot.hpp>
#include <stdair/bom/Inventory.hpp>
#include <stdair/bom/InventoryTypes.hpp>
+#include <stdair/bom/FlightDate.hpp>
+#include <stdair/bom/FlightDateTypes.hpp>
+#include <stdair/bom/LegDate.hpp>
+#include <stdair/bom/LegDateTypes.hpp>
+#include <stdair/bom/LegCabin.hpp>
+#include <stdair/bom/LegCabinTypes.hpp>
+#include <stdair/bom/SegmentDate.hpp>
+#include <stdair/bom/SegmentDateTypes.hpp>
+#include <stdair/bom/SegmentCabin.hpp>
+#include <stdair/bom/SegmentCabinTypes.hpp>
+#include <stdair/bom/BookingClass.hpp>
+#include <stdair/bom/BookingClassTypes.hpp>
#include <stdair/factory/FacBomManager.hpp>
#include <stdair/service/Logger.hpp>
#include <stdair/config/stdair-paths.hpp>
@@ -32,7 +44,8 @@
input file. That latter must then be given with the -i option. */
const bool K_STDAIR_DEFAULT_BUILT_IN_INPUT = false;
-/** Early return status (so that it can be differentiated from an error). */
+/** Early return status (so that it can be differentiated from an
+ error). */
const int K_STDAIR_EARLY_RETURN_STATUS = 99;
// ///////// Parsing of Options & Configuration /////////
@@ -144,28 +157,332 @@
// DEBUG
STDAIR_LOG_DEBUG ("StdAir will build the BOM tree from built-in specifications.");
- // Create the bom root.
+ // ///////////// Step 0.0: Initialisation ////////////
+ // Create the root of the Bom tree (i.e., a BomRoot object)
stdair::BomRoot& lBomRoot =
stdair::FacBom<stdair::BomRoot>::instance().create();
- // Create the inventories.
+ // Step 0.1: Inventory level
+ // Create an Inventory for BA
stdair::InventoryKey lBAKey ("BA");
stdair::Inventory& lBAInv =
stdair::FacBom<stdair::Inventory>::instance().create (lBAKey);
stdair::FacBomManager::addToList (lBomRoot, lBAInv);
+
+ // Create an Inventory for AF
stdair::InventoryKey lAFKey ("AF");
stdair::Inventory& lAFInv =
stdair::FacBom<stdair::Inventory>::instance().create (lAFKey);
stdair::FacBomManager::addToList (lBomRoot, lAFInv);
- // Display the BOM root.
+ // ////// BA ///////
+ // Step 0.2: Flight-date level
+ // Create a FlightDate (BA15/10-JUN-2010) for BA's Inventory
+ stdair::FlightNumber_T lFlightNumber = 15;
+ stdair::Date_T lDate (2010, 6, 10);
+ stdair::FlightDateKey lFlightDateKey (lFlightNumber, lDate);
+
+ stdair::FlightDate& lBA15_20100610_FD =
+ stdair::FacBom<stdair::FlightDate>::instance().create (lFlightDateKey);
+ stdair::FacBomManager::addToList (lBAInv, lBA15_20100610_FD);
+
+ // Display the flight-date
+ // STDAIR_LOG_DEBUG ("FlightDate: " << lBA15_20100610_FD.toString());
+
+ // Step 0.3: Segment-date level
+ // Create a first SegmentDate (LHR-SYD) for BA's Inventory
+ const stdair::AirportCode_T lLHR ("LHR");
+ const stdair::AirportCode_T lSYD ("SYD");
+ stdair::SegmentDateKey lSegmentDateKey (lLHR, lSYD);
+
+ stdair::SegmentDate& lLHRSYDSegment =
+ stdair::FacBom<stdair::SegmentDate>::instance().create (lSegmentDateKey);
+ stdair::FacBomManager::addToList (lBA15_20100610_FD, lLHRSYDSegment);
+
+ // Display the segment-date
+ // STDAIR_LOG_DEBUG ("SegmentDate: " << lLHRSYDSegment.toString());
+
+ // Create a second SegmentDate (LHR-BKK) for BA's Inventory
+ const stdair::AirportCode_T lBKK ("BKK");
+ lSegmentDateKey = stdair::SegmentDateKey (lLHR, lBKK);
+
+ stdair::SegmentDate& lLHRBKKSegment =
+ stdair::FacBom<stdair::SegmentDate>::instance().create (lSegmentDateKey);
+ stdair::FacBomManager::addToList (lBA15_20100610_FD, lLHRBKKSegment);
+
+ // Display the segment-date
+ // STDAIR_LOG_DEBUG ("SegmentDate: " << lLHRBKKSegment.toString());
+
+
+ // Create a third SegmentDate (BKK-SYD) for BA's Inventory
+ lSegmentDateKey = stdair::SegmentDateKey (lBKK, lSYD);
+
+ stdair::SegmentDate& lBKKSYDSegment =
+ stdair::FacBom<stdair::SegmentDate>::instance().create (lSegmentDateKey);
+ stdair::FacBomManager::addToList (lBA15_20100610_FD, lBKKSYDSegment);
+
+ // Display the segment-date
+ // STDAIR_LOG_DEBUG ("SegmentDate: " << lBKKSYDSegment.toString());
+
+ // Step 0.4: Leg-date level
+ // Create a first LegDate (LHR) for BA's Inventory
+ stdair::LegDateKey lLegDateKey (lLHR);
+
+ stdair::LegDate& lLHRLeg =
+ stdair::FacBom<stdair::LegDate>::instance().create (lLegDateKey);
+ stdair::FacBomManager::addToList (lBA15_20100610_FD, lLHRLeg);
+
+ // Display the leg-date
+ // STDAIR_LOG_DEBUG ("LegDate: " << lLHRLeg.toString());
+
+ // Create a second LegDate (BKK)
+ lLegDateKey = stdair::LegDateKey (lBKK);
+
+ stdair::LegDate& lBKKLeg =
+ stdair::FacBom<stdair::LegDate>::instance().create (lLegDateKey);
+ stdair::FacBomManager::addToList (lBA15_20100610_FD, lBKKLeg);
+
+ // Display the leg-date
+ // STDAIR_LOG_DEBUG ("LegDate: " << lBKKLeg.toString());
+
+ // Step 0.5: segment-cabin level
+ // Create a SegmentCabin (Y) for the Segment LHR-BKK of BA's Inventory
+ const stdair::CabinCode_T lY ("Y");
+ stdair::SegmentCabinKey lYSegmentCabinKey (lY);
+
+ stdair::SegmentCabin& lLHRBKKSegmentYCabin =
+ stdair::FacBom<stdair::SegmentCabin>::instance().create(lYSegmentCabinKey);
+ stdair::FacBomManager::addToList (lLHRBKKSegment, lLHRBKKSegmentYCabin);
+
+ // Display the segment-cabin
+ // STDAIR_LOG_DEBUG ("SegmentCabin: " << lLHRBKKSegmentYCabin.toString());
+
+ // Create a SegmentCabin (Y) of the Segment BKK-SYD;
+ stdair::SegmentCabin& lBKKSYDSegmentYCabin =
+ stdair::FacBom<stdair::SegmentCabin>::instance().create(lYSegmentCabinKey);
+ stdair::FacBomManager::addToList (lBKKSYDSegment, lBKKSYDSegmentYCabin);
+
+ // Display the segment-cabin
+ // STDAIR_LOG_DEBUG ("SegmentCabin: " << lBKKSYDSegmentYCabin.toString());
+
+ // Create a SegmentCabin (Y) of the Segment LHR-SYD;
+ stdair::SegmentCabin& lLHRSYDSegmentYCabin =
+ stdair::FacBom<stdair::SegmentCabin>::instance().create(lYSegmentCabinKey);
+ stdair::FacBomManager::addToList (lLHRSYDSegment, lLHRSYDSegmentYCabin);
+
+ // Display the segment-cabin
+ // STDAIR_LOG_DEBUG ("SegmentCabin: " << lLHRSYDSegmentYCabin.toString());
+
+ // Step 0.6: leg-cabin level
+ // Create a LegCabin (Y) for the Leg LHR-BKK on BA's Inventory
+ stdair::LegCabinKey lYLegCabinKey (lY);
+
+ stdair::LegCabin& lLHRLegYCabin =
+ stdair::FacBom<stdair::LegCabin>::instance().create (lYLegCabinKey);
+ stdair::FacBomManager::addToList (lLHRLeg, lLHRLegYCabin);
+
+ // Display the leg-cabin
+ // STDAIR_LOG_DEBUG ("LegCabin: " << lLHRLegYCabin.toString());
+
+ // Create a LegCabin (Y) for the Leg BKK-SYD
+ stdair::LegCabin& lBKKLegYCabin =
+ stdair::FacBom<stdair::LegCabin>::instance().create (lYLegCabinKey);
+ stdair::FacBomManager::addToList (lBKKLeg, lBKKLegYCabin);
+
+ // Display the leg-cabin
+ // STDAIR_LOG_DEBUG ("LegCabin: " << lBKKLegYCabin.toString());
+
+ // Step 0.7: booking class level
+ // Create a BookingClass (Q) for the Segment LHR-BKK, cabin Y on BA's Inv
+ const stdair::ClassCode_T lQ ("Q");
+ stdair::BookingClassKey lQBookingClassKey (lQ);
+
+ stdair::BookingClass& lLHRBKKSegmentYCabinQClass =
+ stdair::FacBom<stdair::BookingClass>::instance().create(lQBookingClassKey);
+ stdair::FacBomManager::addToList (lLHRBKKSegmentYCabin,
+ lLHRBKKSegmentYCabinQClass);
+
+ // Display the booking class
+ // STDAIR_LOG_DEBUG ("BookingClass: "
+ // << lLHRBKKSegmentYCabinQClass.toString());
+
+ // Create a BookingClass (Q) for the Segment BKK-LHR, cabin Y
+ stdair::BookingClass& lBKKSYDSegmentYCabinQClass =
+ stdair::FacBom<stdair::BookingClass>::instance().create(lQBookingClassKey);
+ stdair::FacBomManager::addToList (lBKKSYDSegmentYCabin,
+ lBKKSYDSegmentYCabinQClass);
+
+ // Display the booking class
+ // STDAIR_LOG_DEBUG ("BookingClass: "
+ // << lLHRBKKSegmentYCabinQClass.toString());
+
+ // Create a BookingClass (Q) for the Segment LHR-SYD, cabin Y
+ stdair::BookingClass& lLHRSYDSegmentYCabinQClass =
+ stdair::FacBom<stdair::BookingClass>::instance().create(lQBookingClassKey);
+ stdair::FacBomManager::addToList (lLHRSYDSegmentYCabin,
+ lLHRSYDSegmentYCabinQClass);
+
+ // Display the booking class
+ // STDAIR_LOG_DEBUG ("BookingClass: "
+ // << lLHRBKKSegmentYCabinQClass.toString());
+
+
+ // ////// AF ///////
+ // Step 0.2: Flight-date level
+ // Create a FlightDate (AF102/20-MAR-2010) for AF's Inventory
+ lFlightNumber = 102;
+ lDate = stdair::Date_T (2010, 3, 20);
+ lFlightDateKey = stdair::FlightDateKey (lFlightNumber, lDate);
+
+ stdair::FlightDate& lAF102_20100320_FD =
+ stdair::FacBom<stdair::FlightDate>::instance().create (lFlightDateKey);
+ stdair::FacBomManager::addToList (lAFInv, lAF102_20100320_FD);
+
+ // Display the flight-date
+ // STDAIR_LOG_DEBUG ("FlightDate: " << lAF102_20100320_FD.toString());
+
+ // Step 0.3: Segment-date level
+ // Create a SegmentDate (CDG-SFO) for AF's Inventory
+ const stdair::AirportCode_T lCDG ("CDG");
+ const stdair::AirportCode_T lSFO ("SFO");
+ lSegmentDateKey = stdair::SegmentDateKey (lCDG, lSFO);
+
+ stdair::SegmentDate& lCDGSFOSegment =
+ stdair::FacBom<stdair::SegmentDate>::instance().create (lSegmentDateKey);
+ stdair::FacBomManager::addToList (lAF102_20100320_FD, lCDGSFOSegment);
+
+ // Display the segment-date
+ // STDAIR_LOG_DEBUG ("SegmentDate: " << lCDGSFOSegment.toString());
+
+ // Step 0.4: Leg-date level
+ // Create a LegDate (CDG) for AF's Inventory
+ lLegDateKey = stdair::LegDateKey (lCDG);
+
+ stdair::LegDate& lCDGLeg =
+ stdair::FacBom<stdair::LegDate>::instance().create (lLegDateKey);
+ stdair::FacBomManager::addToList (lAF102_20100320_FD, lCDGLeg);
+
+ // Display the leg-date
+ // STDAIR_LOG_DEBUG ("LegDate: " << lCDGLeg.toString());
+
+ // Step 0.5: segment-cabin level
+ // Create a SegmentCabin (Y) for the Segment CDG-SFO of AF's Inventory
+ stdair::SegmentCabin& lCDGSFOSegmentYCabin =
+ stdair::FacBom<stdair::SegmentCabin>::instance().create(lYSegmentCabinKey);
+ stdair::FacBomManager::addToList (lCDGSFOSegment, lCDGSFOSegmentYCabin);
+
+ // Display the segment-cabin
+ // STDAIR_LOG_DEBUG ("SegmentCabin: " << lCDGSFOSegmentYCabin.toString());
+
+ // Step 0.6: leg-cabin level
+ // Create a LegCabin (Y) for the Leg CDG-SFO on AF's Inventory
+ stdair::LegCabin& lCDGLegYCabin =
+ stdair::FacBom<stdair::LegCabin>::instance().create (lYLegCabinKey);
+ stdair::FacBomManager::addToList (lCDGLeg, lCDGLegYCabin);
+
+ // Display the leg-cabin
+ // STDAIR_LOG_DEBUG ("LegCabin: " << lLHRLegYCabin.toString());
+
+ // Step 0.7: booking class level
+ // Create a BookingClass (Q) for the Segment CDG-SFO, cabin Y on AF's Inv
+ stdair::BookingClass& lCDGSFOSegmentYCabinQClass =
+ stdair::FacBom<stdair::BookingClass>::instance().create(lQBookingClassKey);
+ stdair::FacBomManager::addToList (lCDGSFOSegmentYCabin,
+ lCDGSFOSegmentYCabinQClass);
+
+ // Display the booking class
+ // STDAIR_LOG_DEBUG ("BookingClass: "
+ // << lCDGSFOSegmentYCabinQClass.toString());
+
+
+ // /////////// Step 1.0: Display the BOM tree //////////
+ // 1.1. Inventory level
const stdair::InventoryList_T& lInventoryList =
stdair::BomManager::getList<stdair::Inventory> (lBomRoot);
for (stdair::InventoryList_T::const_iterator itInv = lInventoryList.begin();
itInv != lInventoryList.end(); ++itInv) {
const stdair::Inventory* lInv_ptr = *itInv;
assert (lInv_ptr != NULL);
+
+ // STDAIR_LOG_DEBUG ("Inventory: " << lInv_ptr->describeKey());
STDAIR_LOG_DEBUG (lInv_ptr->describeKey());
+
+ // 1.2. FlightDate level
+ const stdair::FlightDateList_T& lFlightDateList =
+ stdair::BomManager::getList<stdair::FlightDate> (*lInv_ptr);
+ for (stdair::FlightDateList_T::const_iterator itFD=lFlightDateList.begin();
+ itFD != lFlightDateList.end(); ++itFD) {
+ const stdair::FlightDate* lFD_ptr = *itFD;
+ assert (lFD_ptr != NULL);
+
+ // STDAIR_LOG_DEBUG ("FlightDate: " << lFD_ptr->toString());
+ STDAIR_LOG_DEBUG (" " << lFD_ptr->toString());
+
+ // 1.4. LegDate level
+ const stdair::LegDateList_T& lLegDateList =
+ stdair::BomManager::getList<stdair::LegDate> (*lFD_ptr);
+ for (stdair::LegDateList_T::const_iterator itLD =
+ lLegDateList.begin();
+ itLD != lLegDateList.end(); ++itLD) {
+ const stdair::LegDate* lLD_ptr = *itLD;
+ assert (lFD_ptr != NULL);
+
+ // STDAIR_LOG_DEBUG ("LegDate: " << lLD_ptr->toString());
+ STDAIR_LOG_DEBUG (" " << lLD_ptr->toString());
+
+ // 1.6. LegCabin level
+ const stdair::LegCabinList_T& lLegCabinList =
+ stdair::BomManager::getList<stdair::LegCabin> (*lLD_ptr);
+ for (stdair::LegCabinList_T::const_iterator itLC =
+ lLegCabinList.begin();
+ itLC != lLegCabinList.end(); ++itLC) {
+ const stdair::LegCabin* lLC_ptr = *itLC;
+ assert (lFD_ptr != NULL);
+
+ // STDAIR_LOG_DEBUG ("LegCabin: " << lLC_ptr->toString());
+ STDAIR_LOG_DEBUG (" " << lLC_ptr->toString());
+ }
+ }
+
+ // 1.3. SegmentDate level
+ const stdair::SegmentDateList_T& lSegmentDateList =
+ stdair::BomManager::getList<stdair::SegmentDate> (*lFD_ptr);
+ for (stdair::SegmentDateList_T::const_iterator itSD =
+ lSegmentDateList.begin();
+ itSD != lSegmentDateList.end(); ++itSD) {
+ const stdair::SegmentDate* lSD_ptr = *itSD;
+ assert (lFD_ptr != NULL);
+
+ // STDAIR_LOG_DEBUG ("SegmentDate: " << lSD_ptr->toString());
+ STDAIR_LOG_DEBUG (" " << lSD_ptr->toString());
+
+ // 1.5. SegmentCabin level
+ const stdair::SegmentCabinList_T& lSegmentCabinList =
+ stdair::BomManager::getList<stdair::SegmentCabin> (*lSD_ptr);
+ for (stdair::SegmentCabinList_T::const_iterator itSC =
+ lSegmentCabinList.begin();
+ itSC != lSegmentCabinList.end(); ++itSC) {
+ const stdair::SegmentCabin* lSC_ptr = *itSC;
+ assert (lFD_ptr != NULL);
+
+ // STDAIR_LOG_DEBUG ("SegmentCabin: " << lSC_ptr->toString());
+ STDAIR_LOG_DEBUG (" " << lSC_ptr->toString());
+
+ // 1.7. BookingClass level
+ const stdair::BookingClassList_T& lBookingClassList =
+ stdair::BomManager::getList<stdair::BookingClass> (*lSC_ptr);
+ for (stdair::BookingClassList_T::const_iterator itBC =
+ lBookingClassList.begin();
+ itBC != lBookingClassList.end(); ++itBC) {
+ const stdair::BookingClass* lBC_ptr = *itBC;
+ assert (lFD_ptr != NULL);
+
+ // STDAIR_LOG_DEBUG ("BookingClass: " << lBC_ptr->toString());
+ STDAIR_LOG_DEBUG (" " << lBC_ptr->toString());
+ }
+ }
+ }
+ }
}
} catch (const std::exception& stde) {
Modified: trunk/stdair/stdair/bom/BookingClass.cpp
===================================================================
--- trunk/stdair/stdair/bom/BookingClass.cpp 2010-08-20 15:30:16 UTC (rev 275)
+++ trunk/stdair/stdair/bom/BookingClass.cpp 2010-08-20 17:46:36 UTC (rev 276)
@@ -21,9 +21,7 @@
// ////////////////////////////////////////////////////////////////////
std::string BookingClass::toString() const {
std::ostringstream oStr;
-
- oStr << describeKey() << std::endl;
-
+ oStr << describeKey();
return oStr.str();
}
Modified: trunk/stdair/stdair/bom/FlightDate.cpp
===================================================================
--- trunk/stdair/stdair/bom/FlightDate.cpp 2010-08-20 15:30:16 UTC (rev 275)
+++ trunk/stdair/stdair/bom/FlightDate.cpp 2010-08-20 17:46:36 UTC (rev 276)
@@ -20,9 +20,7 @@
// ////////////////////////////////////////////////////////////////////
std::string FlightDate::toString() const {
std::ostringstream oStr;
-
- oStr << describeKey() << std::endl;
-
+ oStr << describeKey();
return oStr.str();
}
Modified: trunk/stdair/stdair/bom/FlightPeriod.cpp
===================================================================
--- trunk/stdair/stdair/bom/FlightPeriod.cpp 2010-08-20 15:30:16 UTC (rev 275)
+++ trunk/stdair/stdair/bom/FlightPeriod.cpp 2010-08-20 17:46:36 UTC (rev 276)
@@ -20,9 +20,7 @@
// ////////////////////////////////////////////////////////////////////
std::string FlightPeriod::toString() const {
std::ostringstream oStr;
-
- oStr << describeKey() << std::endl;
-
+ oStr << describeKey();
return oStr.str();
}
Modified: trunk/stdair/stdair/bom/Inventory.cpp
===================================================================
--- trunk/stdair/stdair/bom/Inventory.cpp 2010-08-20 15:30:16 UTC (rev 275)
+++ trunk/stdair/stdair/bom/Inventory.cpp 2010-08-20 17:46:36 UTC (rev 276)
@@ -19,7 +19,7 @@
// ////////////////////////////////////////////////////////////////////
std::string Inventory::toString() const {
std::ostringstream oStr;
- oStr << _key.toString();
+ oStr << describeKey();
return oStr.str();
}
Modified: trunk/stdair/stdair/bom/LegCabin.cpp
===================================================================
--- trunk/stdair/stdair/bom/LegCabin.cpp 2010-08-20 15:30:16 UTC (rev 275)
+++ trunk/stdair/stdair/bom/LegCabin.cpp 2010-08-20 17:46:36 UTC (rev 276)
@@ -30,7 +30,7 @@
// ////////////////////////////////////////////////////////////////////
std::string LegCabin::toString() const {
std::ostringstream oStr;
- oStr << describeKey() << std::endl;
+ oStr << describeKey();
return oStr.str();
}
Modified: trunk/stdair/stdair/bom/LegDate.cpp
===================================================================
--- trunk/stdair/stdair/bom/LegDate.cpp 2010-08-20 15:30:16 UTC (rev 275)
+++ trunk/stdair/stdair/bom/LegDate.cpp 2010-08-20 17:46:36 UTC (rev 276)
@@ -23,9 +23,7 @@
// ////////////////////////////////////////////////////////////////////
std::string LegDate::toString() const {
std::ostringstream oStr;
-
- oStr << describeKey() << std::endl;
-
+ oStr << describeKey();
return oStr.str();
}
Modified: trunk/stdair/stdair/bom/OptimizerStruct.cpp
===================================================================
--- trunk/stdair/stdair/bom/OptimizerStruct.cpp 2010-08-20 15:30:16 UTC (rev 275)
+++ trunk/stdair/stdair/bom/OptimizerStruct.cpp 2010-08-20 17:46:36 UTC (rev 276)
@@ -9,6 +9,7 @@
#include <stdair/bom/OptimizerStruct.hpp>
namespace stdair {
+
// ///////////////////////////////////////////////////////////////////
OptimizerStruct_T::OptimizerStruct_T () {
}
Modified: trunk/stdair/stdair/bom/SegmentCabin.cpp
===================================================================
--- trunk/stdair/stdair/bom/SegmentCabin.cpp 2010-08-20 15:30:16 UTC (rev 275)
+++ trunk/stdair/stdair/bom/SegmentCabin.cpp 2010-08-20 17:46:36 UTC (rev 276)
@@ -29,9 +29,7 @@
// ////////////////////////////////////////////////////////////////////
std::string SegmentCabin::toString() const {
std::ostringstream oStr;
-
- oStr << describeKey() << std::endl;
-
+ oStr << describeKey();
return oStr.str();
}
Modified: trunk/stdair/stdair/bom/SegmentDate.cpp
===================================================================
--- trunk/stdair/stdair/bom/SegmentDate.cpp 2010-08-20 15:30:16 UTC (rev 275)
+++ trunk/stdair/stdair/bom/SegmentDate.cpp 2010-08-20 17:46:36 UTC (rev 276)
@@ -21,9 +21,7 @@
// ////////////////////////////////////////////////////////////////////
std::string SegmentDate::toString() const {
std::ostringstream oStr;
-
- oStr << describeKey() << std::endl;
-
+ oStr << describeKey();
return oStr.str();
}
Modified: trunk/stdair/stdair/bom/SegmentPeriod.cpp
===================================================================
--- trunk/stdair/stdair/bom/SegmentPeriod.cpp 2010-08-20 15:30:16 UTC (rev 275)
+++ trunk/stdair/stdair/bom/SegmentPeriod.cpp 2010-08-20 17:46:36 UTC (rev 276)
@@ -21,9 +21,7 @@
// ////////////////////////////////////////////////////////////////////
std::string SegmentPeriod::toString() const {
std::ostringstream oStr;
-
- oStr << describeKey() << std::endl;
-
+ oStr << describeKey();
return oStr.str();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-08-20 15:30:22
|
Revision: 275
http://stdair.svn.sourceforge.net/stdair/?rev=275&view=rev
Author: denis_arnaud
Date: 2010-08-20 15:30:16 +0000 (Fri, 20 Aug 2010)
Log Message:
-----------
[Batch] Re-added command-line options.
Modified Paths:
--------------
trunk/stdair/stdair/batches/stdair.cpp
Modified: trunk/stdair/stdair/batches/stdair.cpp
===================================================================
--- trunk/stdair/stdair/batches/stdair.cpp 2010-08-20 14:56:30 UTC (rev 274)
+++ trunk/stdair/stdair/batches/stdair.cpp 2010-08-20 15:30:16 UTC (rev 275)
@@ -4,6 +4,12 @@
#include <sstream>
#include <fstream>
#include <string>
+// Boost (Extended STL)
+#include <boost/date_time/posix_time/posix_time.hpp>
+#include <boost/date_time/gregorian/gregorian.hpp>
+#include <boost/program_options.hpp>
+#include <boost/tokenizer.hpp>
+#include <boost/lexical_cast.hpp>
// StdAir
#include <stdair/STDAIR_Types.hpp>
#include <stdair/STDAIR_Service.hpp>
@@ -13,52 +19,218 @@
#include <stdair/bom/InventoryTypes.hpp>
#include <stdair/factory/FacBomManager.hpp>
#include <stdair/service/Logger.hpp>
+#include <stdair/config/stdair-paths.hpp>
-using namespace stdair;
+// //////// Constants //////
+/** Default name and location for the log file. */
+const std::string K_STDAIR_DEFAULT_LOG_FILENAME ("stdair.log");
+
+/** Default name and location for the (CSV) input file. */
+const std::string K_STDAIR_DEFAULT_INPUT_FILENAME ("../../test/samples/stdair01.csv");
+
+/** 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. */
+const bool K_STDAIR_DEFAULT_BUILT_IN_INPUT = false;
+
+/** Early return status (so that it can be differentiated from an error). */
+const int K_STDAIR_EARLY_RETURN_STATUS = 99;
+
+// ///////// Parsing of Options & Configuration /////////
+// A helper function to simplify the main part.
+template<class T> std::ostream& operator<< (std::ostream& os,
+ const std::vector<T>& v) {
+ std::copy (v.begin(), v.end(), std::ostream_iterator<T> (std::cout, " "));
+ return os;
+}
+
+/** Read and parse the command line options. */
+int readConfiguration (int argc, char* argv[], bool& ioIsBuiltin,
+ stdair::Filename_T& ioInputFilename,
+ std::string& ioLogFilename) {
+ // Default for the built-in input
+ ioIsBuiltin = K_STDAIR_DEFAULT_BUILT_IN_INPUT;
+
+ // Declare a group of options that will be allowed only on command line
+ boost::program_options::options_description generic ("Generic options");
+ generic.add_options()
+ ("prefix", "print installation prefix")
+ ("version,v", "print version string")
+ ("help,h", "produce help message");
+
+ // Declare a group of options that will be allowed both on command
+ // line and in config file
+ boost::program_options::options_description config ("Configuration");
+ config.add_options()
+ ("builtin,b",
+ "The sample BOM tree can be either built-in or parsed from an input file. That latter must then be given with the -i/--input option")
+ ("input,i",
+ boost::program_options::value< std::string >(&ioInputFilename)->default_value(K_STDAIR_DEFAULT_INPUT_FILENAME),
+ "(CVS) input file for the demand distributions")
+ ("log,l",
+ boost::program_options::value< std::string >(&ioLogFilename)->default_value(K_STDAIR_DEFAULT_LOG_FILENAME),
+ "Filename for the logs")
+ ;
+
+ // Hidden options, will be allowed both on command line and
+ // in config file, but will not be shown to the user.
+ boost::program_options::options_description hidden ("Hidden options");
+ hidden.add_options()
+ ("copyright",
+ boost::program_options::value< std::vector<std::string> >(),
+ "Show the copyright (license)");
+
+ boost::program_options::options_description cmdline_options;
+ cmdline_options.add(generic).add(config).add(hidden);
+
+ boost::program_options::options_description config_file_options;
+ config_file_options.add(config).add(hidden);
+ boost::program_options::options_description visible ("Allowed options");
+ visible.add(generic).add(config);
+
+ boost::program_options::positional_options_description p;
+ p.add ("copyright", -1);
+
+ boost::program_options::variables_map vm;
+ boost::program_options::
+ store (boost::program_options::command_line_parser (argc, argv).
+ options (cmdline_options).positional(p).run(), vm);
+
+ std::ifstream ifs ("stdair.cfg");
+ boost::program_options::store (parse_config_file (ifs, config_file_options),
+ vm);
+ boost::program_options::notify (vm);
+
+ if (vm.count ("help")) {
+ std::cout << visible << std::endl;
+ return K_STDAIR_EARLY_RETURN_STATUS;
+ }
+
+ if (vm.count ("version")) {
+ std::cout << PACKAGE_NAME << ", version " << PACKAGE_VERSION << std::endl;
+ return K_STDAIR_EARLY_RETURN_STATUS;
+ }
+
+ if (vm.count ("prefix")) {
+ std::cout << "Installation prefix: " << PREFIXDIR << std::endl;
+ return K_STDAIR_EARLY_RETURN_STATUS;
+ }
+
+ if (vm.count ("builtin")) {
+ ioIsBuiltin = true;
+ }
+ const std::string isBuiltinStr = (ioIsBuiltin == true)?"yes":"no";
+ std::cout << "The BOM should be built-in? " << isBuiltinStr << std::endl;
+
+ if (ioIsBuiltin == false) {
+ if (vm.count ("input")) {
+ ioInputFilename = vm["input"].as< std::string >();
+ std::cout << "Input filename is: " << ioInputFilename << std::endl;
+ }
+ }
+
+ if (vm.count ("log")) {
+ ioLogFilename = vm["log"].as< std::string >();
+ std::cout << "Log filename is: " << ioLogFilename << std::endl;
+ }
+
+ return 0;
+}
+
+// //////////////////////////////////////////////////////////////////////
+void buildSampleBom() {
+
+ try {
+
+ // DEBUG
+ STDAIR_LOG_DEBUG ("StdAir will build the BOM tree from built-in specifications.");
+
+ // Create the bom root.
+ stdair::BomRoot& lBomRoot =
+ stdair::FacBom<stdair::BomRoot>::instance().create();
+
+ // Create the inventories.
+ stdair::InventoryKey lBAKey ("BA");
+ stdair::Inventory& lBAInv =
+ stdair::FacBom<stdair::Inventory>::instance().create (lBAKey);
+ stdair::FacBomManager::addToList (lBomRoot, lBAInv);
+ stdair::InventoryKey lAFKey ("AF");
+ stdair::Inventory& lAFInv =
+ stdair::FacBom<stdair::Inventory>::instance().create (lAFKey);
+ stdair::FacBomManager::addToList (lBomRoot, lAFInv);
+
+ // Display the BOM root.
+ const stdair::InventoryList_T& lInventoryList =
+ stdair::BomManager::getList<stdair::Inventory> (lBomRoot);
+ for (stdair::InventoryList_T::const_iterator itInv = lInventoryList.begin();
+ itInv != lInventoryList.end(); ++itInv) {
+ const stdair::Inventory* lInv_ptr = *itInv;
+ assert (lInv_ptr != NULL);
+ STDAIR_LOG_DEBUG (lInv_ptr->describeKey());
+ }
+
+ } catch (const std::exception& stde) {
+ STDAIR_LOG_ERROR ("Standard exception: " << stde.what());
+ }
+}
+
// ///////// M A I N ////////////
int main (int argc, char* argv[]) {
+
try {
+
+ // Built-in
+ bool isBuiltin;
+
+ // Input file name
+ stdair::Filename_T lInputFilename;
+
// Output log File
- std::string lLogFilename ("stdair.log");
+ std::string lLogFilename;
+ // Call the command-line option parser
+ const int lOptionParserStatus =
+ readConfiguration (argc, argv, isBuiltin, lInputFilename, lLogFilename);
+
+ if (lOptionParserStatus == K_STDAIR_EARLY_RETURN_STATUS) {
+ return 0;
+ }
+
// Set the log parameters
std::ofstream logOutputFile;
// Open and clean the log outputfile
logOutputFile.open (lLogFilename.c_str());
logOutputFile.clear();
- const BasLogParams lLogParams (LOG::DEBUG, logOutputFile);
- STDAIR_Service stdairService (lLogParams);
+ const stdair::BasLogParams lLogParams (stdair::LOG::DEBUG, logOutputFile);
+ stdair::STDAIR_Service stdairService (lLogParams);
// DEBUG
STDAIR_LOG_DEBUG ("Welcome to stdair");
- // Create the bom root.
- BomRoot& lBomRoot = FacBom<BomRoot>::instance().create();
+ // Check wether or not a (CSV) input file should be read
+ if (isBuiltin == true) {
+ // Build a sample BOM tree
+ buildSampleBom();
+
+ } else {
+ // Read the input file
+ //stdairService.readFromInputFile (lInputFilename);
- // Create the inventories.
- InventoryKey lBAKey ("BA");
- Inventory& lBAInv = FacBom<Inventory>::instance().create (lBAKey);
- FacBomManager::addToList (lBomRoot, lBAInv);
- InventoryKey lAFKey ("AF");
- Inventory& lAFInv = FacBom<Inventory>::instance().create (lAFKey);
- FacBomManager::addToList (lBomRoot, lAFInv);
+ // DEBUG
+ STDAIR_LOG_DEBUG ("StdAir will parse " << lInputFilename
+ << " and build the corresponding BOM tree.");
+ }
- // Display the bom root.
- // const InventoryList_T& lInventoryList = RelationShip<BomRoot, Inventory>::
- // instance().getChildrenList (lBomRoot);
- const InventoryList_T& lInventoryList =
- BomManager::getList<Inventory> (lBomRoot);
- for (InventoryList_T::const_iterator itInv = lInventoryList.begin();
- itInv != lInventoryList.end(); ++itInv) {
- const Inventory* lInv_ptr = *itInv;
- STDAIR_LOG_DEBUG (lInv_ptr->describeKey());
- }
-
// Close the Log outputFile
logOutputFile.close();
- } CATCH
+ } catch (const std::exception& stde) {
+ std::cerr << "Standard exception: " << stde.what() << std::endl;
+ return -1;
+
+ } catch (...) {
+ return -1;
+ }
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <qua...@us...> - 2010-08-20 14:56:37
|
Revision: 274
http://stdair.svn.sourceforge.net/stdair/?rev=274&view=rev
Author: quannaus
Date: 2010-08-20 14:56:30 +0000 (Fri, 20 Aug 2010)
Log Message:
-----------
[dev] Adapted to the new stdair.
Modified Paths:
--------------
trunk/stdair/test/stdair/StdairTestLib.cpp
Modified: trunk/stdair/test/stdair/StdairTestLib.cpp
===================================================================
--- trunk/stdair/test/stdair/StdairTestLib.cpp 2010-08-20 14:53:57 UTC (rev 273)
+++ trunk/stdair/test/stdair/StdairTestLib.cpp 2010-08-20 14:56:30 UTC (rev 274)
@@ -14,9 +14,6 @@
// StdAir
#include <stdair/STDAIR_Service.hpp>
#include <stdair/STDAIR_Types.hpp>
-#include <stdair/bom/BomList.hpp>
-#include <stdair/bom/BomSource.hpp>
-#include <stdair/factory/FacBomContent.hpp>
#include <stdair/service/Logger.hpp>
#include <test/stdair/StdairTestLib.hpp>
@@ -149,187 +146,7 @@
// DEBUG
STDAIR_LOG_DEBUG ("StdAir service initialised");
-
- // Step 0.0: initialisation
- // Create the root of the Bom tree (i.e., a BomRoot object)
- stdair::BomRoot& lBomRoot =
- stdair::FacBomContent::instance().create<stdair::BomRoot>();
-
- // Step 0.1: Inventory level
- // Create an Inventory (BA)
- const stdair::AirlineCode_T lAirlineCode ("BA");
- stdair::InventoryKey_T lInventoryKey (lAirlineCode);
-
- stdair::Inventory& lInventory =
- stdair::FacBomContent::instance().create<stdair::Inventory>(lInventoryKey);
- stdair::FacBomContent::linkWithParent (lInventory, lBomRoot);
-
- // Display the inventory
- STDAIR_LOG_DEBUG ("Inventory: " << lInventory.toString());
-
- // Step 0.2: Flight-date level
- // Create a FlightDate (BA15/10-JUN-2010)
- const stdair::FlightNumber_T lFlightNumber = 15;
- const stdair::Date_T lDate (2010, 6, 10);
- stdair::FlightDateKey_T lFlightDateKey (lFlightNumber, lDate);
-
- stdair::FlightDate& lFlightDate = stdair::FacBomContent::
- instance().create<stdair::FlightDate> (lFlightDateKey);
- stdair::FacBomContent::linkWithParent (lFlightDate, lInventory);
-
- // Display the flight-date
- STDAIR_LOG_DEBUG ("FlightDate: " << lFlightDate.toString());
-
- // Step 0.3: Segment-date level
- // Create a first SegmentDate (LHR-SYD)
- const stdair::AirportCode_T lLHR ("LHR");
- const stdair::AirportCode_T lSYD ("SYD");
- stdair::SegmentDateKey_T lSegmentDateKey (lLHR, lSYD);
-
- stdair::SegmentDate& lLHRSYDSegment =
- stdair::FacBomContent::
- instance().create<stdair::SegmentDate> (lSegmentDateKey);
- stdair::FacBomContent::linkWithParent (lLHRSYDSegment, lFlightDate);
-
- // Display the segment-date
- STDAIR_LOG_DEBUG ("SegmentDate: " << lLHRSYDSegment.toString());
-
-
- // Create a second SegmentDate (LHR-BKK)
- const stdair::AirportCode_T lBKK ("BKK");
- lSegmentDateKey = stdair::SegmentDateKey_T (lLHR, lBKK);
-
- stdair::SegmentDate& lLHRBKKSegment =
- stdair::FacBomContent::
- instance().create<stdair::SegmentDate> (lSegmentDateKey);
- stdair::FacBomContent::linkWithParent (lLHRBKKSegment, lFlightDate);
-
- // Display the segment-date
- STDAIR_LOG_DEBUG ("SegmentDate: " << lLHRBKKSegment.toString());
-
-
- // Create a third SegmentDate (BKK-SYD)
- lSegmentDateKey = stdair::SegmentDateKey_T (lBKK, lSYD);
-
- stdair::SegmentDate& lBKKSYDSegment =
- stdair::FacBomContent::
- instance().create<stdair::SegmentDate> (lSegmentDateKey);
- stdair::FacBomContent::linkWithParent (lBKKSYDSegment, lFlightDate);
-
- // Display the segment-date
- STDAIR_LOG_DEBUG ("SegmentDate: " << lBKKSYDSegment.toString());
-
-
- // Step 0.4: Leg-date level
- // Create a first LegDate (LHR)
- stdair::LegDateKey_T lLegDateKey (lLHR);
-
- stdair::LegDate& lLHRLeg =
- stdair::FacBomContent::instance().create<stdair::LegDate> (lLegDateKey);
- stdair::FacBomContent::linkWithParent<stdair::LegDate>(lLHRLeg, lFlightDate);
-
- // Display the leg-date
- STDAIR_LOG_DEBUG ("LegDate: " << lLHRLeg.toString());
-
- // Create a second LegDate (BKK)
- lLegDateKey = stdair::LegDateKey_T (lBKK);
-
- stdair::LegDate& lBKKLeg =
- stdair::FacBomContent::instance().create<stdair::LegDate> (lLegDateKey);
- stdair::FacBomContent::linkWithParent (lBKKLeg, lFlightDate);
-
- // Display the leg-date
- STDAIR_LOG_DEBUG ("LegDate: " << lBKKLeg.toString());
-
- // Step 0.5: segment-cabin level
- // Create a SegmentCabin (Y) of the Segment LHR-BKK;
- const stdair::CabinCode_T lY ("Y");
- stdair::SegmentCabinKey_T lYSegmentCabinKey (lY);
-
- stdair::SegmentCabin& lLHRBKKSegmentYCabin =
- stdair::FacBomContent::
- instance().create<stdair::SegmentCabin> (lYSegmentCabinKey);
- stdair::FacBomContent::
- linkWithParent (lLHRBKKSegmentYCabin, lLHRBKKSegment);
-
- // Display the segment-cabin
- STDAIR_LOG_DEBUG ("SegmentCabin: " << lLHRBKKSegmentYCabin.toString());
-
- // Create a SegmentCabin (Y) of the Segment BKK-SYD;
- stdair::SegmentCabin& lBKKSYDSegmentYCabin =
- stdair::FacBomContent::
- instance().create<stdair::SegmentCabin> (lYSegmentCabinKey);
- stdair::FacBomContent::
- linkWithParent (lBKKSYDSegmentYCabin, lBKKSYDSegment);
-
- // Display the segment-cabin
- STDAIR_LOG_DEBUG ("SegmentCabin: " << lBKKSYDSegmentYCabin.toString());
-
- // Create a SegmentCabin (Y) of the Segment LHR-SYD;
- stdair::SegmentCabin& lLHRSYDSegmentYCabin =
- stdair::FacBomContent::
- instance().create<stdair::SegmentCabin> (lYSegmentCabinKey);
- stdair::FacBomContent::
- linkWithParent (lLHRSYDSegmentYCabin, lLHRSYDSegment);
-
- // Display the segment-cabin
- STDAIR_LOG_DEBUG ("SegmentCabin: " << lLHRSYDSegmentYCabin.toString());
-
-
- // Step 0.6: leg-cabin level
- // Create a LegCabin (Y) of the Leg LHR-BKK;
- stdair::LegCabinKey_T lYLegCabinKey (lY);
-
- stdair::LegCabin& lLHRLegYCabin =
- stdair::FacBomContent::instance().create<stdair::LegCabin> (lYLegCabinKey);
- stdair::FacBomContent::linkWithParent (lLHRLegYCabin, lLHRLeg);
-
- // Display the leg-cabin
- STDAIR_LOG_DEBUG ("LegCabin: " << lLHRLegYCabin.toString());
-
- // Create a LegCabin (Y) of the Leg BKK-SYD;
- stdair::LegCabin& lBKKLegYCabin =
- stdair::FacBomContent::instance().create<stdair::LegCabin> (lYLegCabinKey);
- stdair::FacBomContent::linkWithParent (lBKKLegYCabin, lBKKLeg);
-
- // Display the leg-cabin
- STDAIR_LOG_DEBUG ("LegCabin: " << lBKKLegYCabin.toString());
-
- // Step 0.7: booking class level
- // Create a BookingClass (Q) of the Segment LHR-BKK, cabin Y;
- const stdair::ClassCode_T lQ ("Q");
- stdair::BookingClassKey_T lQBookingClassKey (lQ);
-
- stdair::BookingClass& lLHRBKKSegmentYCabinQClass =
- stdair::FacBomContent::
- instance().create<stdair::BookingClass> (lQBookingClassKey);
- stdair::FacBomContent::
- linkWithParent (lLHRBKKSegmentYCabinQClass, lLHRBKKSegmentYCabin);
-
- // Display the booking class
- STDAIR_LOG_DEBUG ("BookingClass: "
- << lLHRBKKSegmentYCabinQClass.toString());
-
- // Browse the BomRoot and display the created objects.
- STDAIR_LOG_DEBUG ("Browse the BomRoot");
-
- const stdair::InventoryList_T& lInventoryList = lBomRoot.getInventoryList();
- for (stdair::InventoryList_T::iterator itInv = lInventoryList.begin();
- itInv != lInventoryList.end(); ++itInv) {
- const stdair::Inventory& lCurrentInventory = *itInv;
- STDAIR_LOG_DEBUG ("Inventory: " << lCurrentInventory.toString());
-
- const stdair::FlightDateMap_T& lFlightDateMap =
- lCurrentInventory.getFlightDateMap ();
- for (stdair::FlightDateMap_T::iterator itFlightDate =
- lFlightDateMap.begin();
- itFlightDate != lFlightDateMap.end(); ++itFlightDate) {
- const stdair::FlightDate* lCurrentFlightDate = itFlightDate->second;
- STDAIR_LOG_DEBUG ("FlightDate: " << lCurrentFlightDate->describeKey());
- }
- }
-
// Close the Log outputFile
logOutputFile.close();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <qua...@us...> - 2010-08-20 14:54:06
|
Revision: 273
http://stdair.svn.sourceforge.net/stdair/?rev=273&view=rev
Author: quannaus
Date: 2010-08-20 14:53:57 +0000 (Fri, 20 Aug 2010)
Log Message:
-----------
[dev] Implemented a new architecture for stdair.
Modified Paths:
--------------
trunk/stdair/stdair/STDAIR_Types.hpp
trunk/stdair/stdair/basic/sources.mk
trunk/stdair/stdair/batches/stdair.cpp
trunk/stdair/stdair/bom/AirlineFeature.cpp
trunk/stdair/stdair/bom/AirlineFeature.hpp
trunk/stdair/stdair/bom/AirlineFeatureKey.cpp
trunk/stdair/stdair/bom/AirlineFeatureKey.hpp
trunk/stdair/stdair/bom/AirlineFeatureTypes.hpp
trunk/stdair/stdair/bom/BomManager.cpp
trunk/stdair/stdair/bom/BomManager.hpp
trunk/stdair/stdair/bom/BomRoot.cpp
trunk/stdair/stdair/bom/BomRoot.hpp
trunk/stdair/stdair/bom/BomRootKey.cpp
trunk/stdair/stdair/bom/BomRootKey.hpp
trunk/stdair/stdair/bom/BookingClass.cpp
trunk/stdair/stdair/bom/BookingClass.hpp
trunk/stdair/stdair/bom/BookingClassKey.cpp
trunk/stdair/stdair/bom/BookingClassKey.hpp
trunk/stdair/stdair/bom/BookingClassTypes.hpp
trunk/stdair/stdair/bom/BookingRequestStruct.hpp
trunk/stdair/stdair/bom/Bucket.cpp
trunk/stdair/stdair/bom/Bucket.hpp
trunk/stdair/stdair/bom/BucketKey.cpp
trunk/stdair/stdair/bom/BucketKey.hpp
trunk/stdair/stdair/bom/BucketTypes.hpp
trunk/stdair/stdair/bom/EventQueue.hpp
trunk/stdair/stdair/bom/EventStruct.hpp
trunk/stdair/stdair/bom/FlightDate.cpp
trunk/stdair/stdair/bom/FlightDate.hpp
trunk/stdair/stdair/bom/FlightDateKey.cpp
trunk/stdair/stdair/bom/FlightDateKey.hpp
trunk/stdair/stdair/bom/FlightDateTypes.hpp
trunk/stdair/stdair/bom/FlightPeriod.cpp
trunk/stdair/stdair/bom/FlightPeriod.hpp
trunk/stdair/stdair/bom/FlightPeriodKey.cpp
trunk/stdair/stdair/bom/FlightPeriodKey.hpp
trunk/stdair/stdair/bom/FlightPeriodTypes.hpp
trunk/stdair/stdair/bom/Inventory.cpp
trunk/stdair/stdair/bom/Inventory.hpp
trunk/stdair/stdair/bom/InventoryKey.cpp
trunk/stdair/stdair/bom/InventoryKey.hpp
trunk/stdair/stdair/bom/InventoryTypes.hpp
trunk/stdair/stdair/bom/LegCabin.cpp
trunk/stdair/stdair/bom/LegCabin.hpp
trunk/stdair/stdair/bom/LegCabinKey.cpp
trunk/stdair/stdair/bom/LegCabinKey.hpp
trunk/stdair/stdair/bom/LegCabinTypes.hpp
trunk/stdair/stdair/bom/LegDate.cpp
trunk/stdair/stdair/bom/LegDate.hpp
trunk/stdair/stdair/bom/LegDateKey.cpp
trunk/stdair/stdair/bom/LegDateKey.hpp
trunk/stdair/stdair/bom/LegDateTypes.hpp
trunk/stdair/stdair/bom/SegmentCabin.cpp
trunk/stdair/stdair/bom/SegmentCabin.hpp
trunk/stdair/stdair/bom/SegmentCabinKey.cpp
trunk/stdair/stdair/bom/SegmentCabinKey.hpp
trunk/stdair/stdair/bom/SegmentCabinTypes.hpp
trunk/stdair/stdair/bom/SegmentDate.cpp
trunk/stdair/stdair/bom/SegmentDate.hpp
trunk/stdair/stdair/bom/SegmentDateKey.cpp
trunk/stdair/stdair/bom/SegmentDateKey.hpp
trunk/stdair/stdair/bom/SegmentDateTypes.hpp
trunk/stdair/stdair/bom/SegmentPeriod.cpp
trunk/stdair/stdair/bom/SegmentPeriod.hpp
trunk/stdair/stdair/bom/SegmentPeriodKey.cpp
trunk/stdair/stdair/bom/SegmentPeriodKey.hpp
trunk/stdair/stdair/bom/SegmentPeriodTypes.hpp
trunk/stdair/stdair/bom/TravelSolutionStruct.hpp
trunk/stdair/stdair/bom/YieldStore.cpp
trunk/stdair/stdair/bom/YieldStore.hpp
trunk/stdair/stdair/bom/YieldStoreKey.cpp
trunk/stdair/stdair/bom/YieldStoreKey.hpp
trunk/stdair/stdair/bom/YieldStoreTypes.hpp
trunk/stdair/stdair/bom/sources.mk
trunk/stdair/stdair/command/CmdBomManager.cpp
trunk/stdair/stdair/command/CmdBomManager.hpp
trunk/stdair/stdair/factory/sources.mk
trunk/stdair/stdair/service/STDAIR_Service.cpp
trunk/stdair/stdair/service/sources.mk
Added Paths:
-----------
trunk/stdair/stdair/bom/BomAbstract.hpp
trunk/stdair/stdair/bom/KeyAbstract.hpp
trunk/stdair/stdair/bom/RelationShip.hpp
trunk/stdair/stdair/bom/RelationShipAbstract.hpp
trunk/stdair/stdair/factory/FacAbstract.cpp
trunk/stdair/stdair/factory/FacAbstract.hpp
trunk/stdair/stdair/factory/FacBom.hpp
trunk/stdair/stdair/factory/FacBomManager.cpp
trunk/stdair/stdair/factory/FacBomManager.hpp
trunk/stdair/stdair/service/FacSupervisor.cpp
trunk/stdair/stdair/service/FacSupervisor.hpp
Removed Paths:
-------------
trunk/stdair/stdair/basic/CategoricalAttribute.hpp
trunk/stdair/stdair/basic/CategoricalAttributeLite.hpp
trunk/stdair/stdair/basic/ContinuousAttribute.hpp
trunk/stdair/stdair/basic/ContinuousAttributeLite.hpp
trunk/stdair/stdair/basic/DemandCharacteristicTypes.hpp
trunk/stdair/stdair/basic/DemandCharacteristics.cpp
trunk/stdair/stdair/basic/DemandCharacteristics.hpp
trunk/stdair/stdair/basic/DemandDistribution.cpp
trunk/stdair/stdair/basic/DemandDistribution.hpp
trunk/stdair/stdair/basic/DictionaryManager.cpp
trunk/stdair/stdair/basic/DictionaryManager.hpp
trunk/stdair/stdair/basic/RandomGeneration.cpp
trunk/stdair/stdair/basic/RandomGeneration.hpp
trunk/stdair/stdair/basic/RandomGenerationContext.cpp
trunk/stdair/stdair/basic/RandomGenerationContext.hpp
trunk/stdair/stdair/bom/AirlineFeatureContent.cpp
trunk/stdair/stdair/bom/AirlineFeatureContent.hpp
trunk/stdair/stdair/bom/BomChildrenHolder.hpp
trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp
trunk/stdair/stdair/bom/BomContent.hpp
trunk/stdair/stdair/bom/BomIterator.hpp
trunk/stdair/stdair/bom/BomKey.hpp
trunk/stdair/stdair/bom/BomList.hpp
trunk/stdair/stdair/bom/BomMap.hpp
trunk/stdair/stdair/bom/BomMultimap.hpp
trunk/stdair/stdair/bom/BomRootContent.cpp
trunk/stdair/stdair/bom/BomRootContent.hpp
trunk/stdair/stdair/bom/BomRootTypes.hpp
trunk/stdair/stdair/bom/BomSource.hpp
trunk/stdair/stdair/bom/BomStopContent.hpp
trunk/stdair/stdair/bom/BomStructure.hpp
trunk/stdair/stdair/bom/BomTypes.hpp
trunk/stdair/stdair/bom/BookingClassContent.cpp
trunk/stdair/stdair/bom/BookingClassContent.hpp
trunk/stdair/stdair/bom/BucketContent.cpp
trunk/stdair/stdair/bom/BucketContent.hpp
trunk/stdair/stdair/bom/DemandStream.cpp
trunk/stdair/stdair/bom/DemandStream.hpp
trunk/stdair/stdair/bom/DemandStreamContent.cpp
trunk/stdair/stdair/bom/DemandStreamContent.hpp
trunk/stdair/stdair/bom/DemandStreamKey.cpp
trunk/stdair/stdair/bom/DemandStreamKey.hpp
trunk/stdair/stdair/bom/DemandStreamTypes.hpp
trunk/stdair/stdair/bom/FlightDateContent.cpp
trunk/stdair/stdair/bom/FlightDateContent.hpp
trunk/stdair/stdair/bom/FlightPeriodContent.cpp
trunk/stdair/stdair/bom/FlightPeriodContent.hpp
trunk/stdair/stdair/bom/InventoryContent.cpp
trunk/stdair/stdair/bom/InventoryContent.hpp
trunk/stdair/stdair/bom/LegCabinContent.cpp
trunk/stdair/stdair/bom/LegCabinContent.hpp
trunk/stdair/stdair/bom/LegDateContent.cpp
trunk/stdair/stdair/bom/LegDateContent.hpp
trunk/stdair/stdair/bom/OriginDestinationSet.cpp
trunk/stdair/stdair/bom/OriginDestinationSet.hpp
trunk/stdair/stdair/bom/OriginDestinationSetContent.cpp
trunk/stdair/stdair/bom/OriginDestinationSetContent.hpp
trunk/stdair/stdair/bom/OriginDestinationSetKey.cpp
trunk/stdair/stdair/bom/OriginDestinationSetKey.hpp
trunk/stdair/stdair/bom/OriginDestinationSetTypes.hpp
trunk/stdair/stdair/bom/ReachableUniverse.cpp
trunk/stdair/stdair/bom/ReachableUniverse.hpp
trunk/stdair/stdair/bom/ReachableUniverseContent.cpp
trunk/stdair/stdair/bom/ReachableUniverseContent.hpp
trunk/stdair/stdair/bom/ReachableUniverseKey.cpp
trunk/stdair/stdair/bom/ReachableUniverseKey.hpp
trunk/stdair/stdair/bom/ReachableUniverseTypes.hpp
trunk/stdair/stdair/bom/SegmentCabinContent.cpp
trunk/stdair/stdair/bom/SegmentCabinContent.hpp
trunk/stdair/stdair/bom/SegmentDateContent.cpp
trunk/stdair/stdair/bom/SegmentDateContent.hpp
trunk/stdair/stdair/bom/SegmentPathPeriod.cpp
trunk/stdair/stdair/bom/SegmentPathPeriod.hpp
trunk/stdair/stdair/bom/SegmentPathPeriodContent.cpp
trunk/stdair/stdair/bom/SegmentPathPeriodContent.hpp
trunk/stdair/stdair/bom/SegmentPathPeriodKey.cpp
trunk/stdair/stdair/bom/SegmentPathPeriodKey.hpp
trunk/stdair/stdair/bom/SegmentPathPeriodTypes.hpp
trunk/stdair/stdair/bom/SegmentPeriodContent.cpp
trunk/stdair/stdair/bom/SegmentPeriodContent.hpp
trunk/stdair/stdair/bom/Structure.hpp
trunk/stdair/stdair/bom/YieldStoreContent.cpp
trunk/stdair/stdair/bom/YieldStoreContent.hpp
trunk/stdair/stdair/factory/FacBomContent.cpp
trunk/stdair/stdair/factory/FacBomContent.hpp
trunk/stdair/stdair/factory/FacBomStructure.cpp
trunk/stdair/stdair/factory/FacBomStructure.hpp
trunk/stdair/stdair/factory/FacSupervisor.cpp
trunk/stdair/stdair/factory/FacSupervisor.hpp
Modified: trunk/stdair/stdair/STDAIR_Types.hpp
===================================================================
--- trunk/stdair/stdair/STDAIR_Types.hpp 2010-08-20 10:40:49 UTC (rev 272)
+++ trunk/stdair/stdair/STDAIR_Types.hpp 2010-08-20 14:53:57 UTC (rev 273)
@@ -39,12 +39,18 @@
class NonInitialisedServiceException : public RootException { };
+ class NonInitialisedContainerException : public RootException { };
+
+ class NonInitialisedRelationShip : public RootException { };
+
class MemoryAllocationException : public RootException { };
class ObjectLinkingException : public RootException { };
class ParserException : public RootException { };
+ class DocumentNotFoundException : public RootException { };
+
class CodeConversionException : public ParserException { };
class CodeDuplicationException : public ParserException { };
@@ -58,8 +64,6 @@
class SQLDatabaseConnectionImpossibleException : public SQLDatabaseException {
};
- class DocumentNotFoundException : public RootException { };
-
// /////////////// Log /////////////
/** Level of logs. */
namespace LOG {
@@ -216,7 +220,7 @@
typedef double MeanValue_T;
/** Define a standard deviation value (e.g., 1.5). */
- typedef double StandardDeviationValue_T;
+ typedef double StdDevValue_T;
/** Define the cabin capacity (resource, e.g., 200 seats).
<br>The capacity is expressed as a double to cope with overbooking. */
@@ -421,9 +425,6 @@
/** Probability */
typedef float Probability_T;
- /** Dictionary key. */
- typedef unsigned char DictionaryKey_T;
-
// //////////////////////////////////////////////////////////////////////
// Date / Time
/** Time duration in (integer) number of seconds */
@@ -476,4 +477,82 @@
typedef std::map<CabinCode_T, ClassList_String_T> CabinBookingClassMap_T;
}
+
+#define CATCH \
+ catch (const stdair::FileNotFoundException& ex) { \
+ std::cerr << "FileNotFoundException" << std::endl; \
+ return -1; \
+ \
+ } catch (const stdair::NonInitialisedLogServiceException& ex) { \
+ std::cerr << "NonInitialisedLogServiceException" << std::endl; \
+ return -1; \
+ \
+ } catch (const stdair::NonInitialisedDBSessionManagerException& ex) { \
+ std::cerr << "NonInitialisedDBSessionManagerException" << std::endl; \
+ return -1; \
+ \
+ } catch (const stdair::NonInitialisedServiceException& ex) { \
+ std::cerr << "NonInitialisedServiceException" << std::endl; \
+ return -1; \
+ \
+ } catch (const stdair::NonInitialisedContainerException& ex) { \
+ std::cerr << "NonInitialisedContainerException" << std::endl; \
+ return -1; \
+ \
+ } catch (const stdair::NonInitialisedRelationShip& ex) { \
+ std::cerr << "NonInitialisedRelationShip" << std::endl; \
+ return -1; \
+ \
+ } catch (const stdair::MemoryAllocationException& ex) { \
+ std::cerr << "MemoryAllocationException" << std::endl; \
+ return -1; \
+ \
+ } catch (const stdair::ObjectLinkingException& ex) { \
+ std::cerr << "ObjectLinkingException" << std::endl; \
+ return -1; \
+ \
+ } catch (const stdair::CodeConversionException& ex) { \
+ std::cerr << "CodeConversionException" << std::endl; \
+ return -1; \
+ \
+ } catch (const stdair::CodeDuplicationException& ex) { \
+ std::cerr << "CodeDuplicationException" << std::endl; \
+ return -1; \
+ \
+ } catch (const stdair::ObjectCreationgDuplicationException& ex) { \
+ std::cerr << "ObjectCreationgDuplicationException" << std::endl; \
+ return -1; \
+ \
+ } catch (const stdair::ObjectNotFoundException& ex) { \
+ std::cerr << "ObjectNotFoundException" << std::endl; \
+ return -1; \
+ \
+ } catch (const stdair::DocumentNotFoundException& ex) { \
+ std::cerr << "DocumentNotFoundException" << std::endl; \
+ return -1; \
+ \
+ } catch (const stdair::SQLDatabaseConnectionImpossibleException& ex) { \
+ std::cerr << "SQLDatabaseConnectionImpossibleException" << std::endl; \
+ return -1; \
+ \
+ } catch (const stdair::SQLDatabaseException& ex) { \
+ std::cerr << "SQLDatabaseException" << std::endl; \
+ return -1; \
+ \
+ } catch (const stdair::ParserException& ex) { \
+ std::cerr << "ParserException" << std::endl; \
+ return -1; \
+ \
+ } catch (const stdair::RootException& ex) { \
+ std::cerr << "RootException" << std::endl; \
+ return -1; \
+ \
+ } catch (const std::exception& stde) { \
+ std::cerr << "Standard exception: " << stde.what() << std::endl; \
+ return -1; \
+ \
+ } catch (...) { \
+ return -1; \
+ } \
+
#endif // __STDAIR_STDAIR_TYPES_HPP
Deleted: trunk/stdair/stdair/basic/CategoricalAttribute.hpp
===================================================================
--- trunk/stdair/stdair/basic/CategoricalAttribute.hpp 2010-08-20 10:40:49 UTC (rev 272)
+++ trunk/stdair/stdair/basic/CategoricalAttribute.hpp 2010-08-20 14:53:57 UTC (rev 273)
@@ -1,138 +0,0 @@
-#ifndef __STDAIR_BAS_CATEGORICALATTRIBUTE_HPP
-#define __STDAIR_BAS_CATEGORICALATTRIBUTE_HPP
-
-// //////////////////////////////////////////////////////////////////////
-// Import section
-// //////////////////////////////////////////////////////////////////////
-// STL
-#include <map>
-#include <iosfwd>
-// STDAIR
-#include <stdair/STDAIR_Types.hpp>
-#include <stdair/basic/DictionaryManager.hpp>
-
-namespace stdair {
-
- /** Class modeling the distribution of values that can be taken by a
- categorical attribute. */
- template <class T>
- struct CategoricalAttribute {
-
- public:
- /** Define the probability mass function type. */
- typedef std::map<T, DictionaryKey_T> ProbabilityMassFunction_T;
-
- /** Define the inverse cumulative distribution type. */
- typedef std::map<DictionaryKey_T, T> InverseCumulativeDistribution_T;
-
- private:
- // ///////////// Getters ///////////
- /** Get the probability mass function. */
- const ProbabilityMassFunction_T& getProbabilityMassFunction() const {
- return _probabilityMassFunction;
- }
-
- /** Get the inverse cumulative distribution. */
- const InverseCumulativeDistribution_T& getInverseCumulativeDistribution () const {
- return _inverseCumulativeDistribution;
- }
-
- // ///////////// Setters ///////////
- /** Set the probability mass function */
- void setProbabilityMassFunction (const ProbabilityMassFunction_T& iProbabilityMassFunction) {
- _probabilityMassFunction = iProbabilityMassFunction;
- determineInverseCumulativeDistributionFromProbabilityMassFunction();
- }
-
- public:
- // /////////////// Business Methods //////////
- /** Get value from inverse cumulative distribution. */
- const T getValue (Probability_T iCumulativeProbability) const {
- const DictionaryKey_T lKey =
- DictionaryManager::valueToKey (iCumulativeProbability);
- return _inverseCumulativeDistribution.
- lower_bound (lKey)->second;
- }
-
- public:
- // ////////////// Display Support Methods //////////
- /** Display probability mass function. */
- const std::string displayProbabilityMassFunction () const {
- std::ostringstream oStr;
- unsigned int idx = 0;
-
- for (typename ProbabilityMassFunction_T::const_iterator it =
- _probabilityMassFunction.begin();
- it != _probabilityMassFunction.end(); ++it, ++idx) {
- if (idx != 0) {
- oStr << ", ";
- }
- oStr << it->first << ":"
- << DictionaryManager::keyToValue (it->second);
- }
-
- return oStr.str();
- }
-
- /** Display inverse cumulative distribution. */
- const std::string displayInverseCumulativeDistribution () const {
- std::ostringstream oStr;
-
- for (typename InverseCumulativeDistribution_T::const_iterator it =
- _inverseCumulativeDistribution.begin();
- it != _inverseCumulativeDistribution.end(); ++it) {
- oStr << "cumulative prob: " << DictionaryManager::keyToValue (it->first)
- << " value: " << it->second << std::endl;
- }
-
- return oStr.str();
- }
-
- public:
- // ////////// Constructors and destructors /////////
- /** Constructor by default */
- CategoricalAttribute (const ProbabilityMassFunction_T& iProbabilityMassFunction)
- : _probabilityMassFunction (iProbabilityMassFunction) {
- determineInverseCumulativeDistributionFromProbabilityMassFunction();
- }
- /** Default constructors. */
- CategoricalAttribute () { }
- CategoricalAttribute (const CategoricalAttribute& iCategoricalAttribute)
- : _probabilityMassFunction (iCategoricalAttribute._probabilityMassFunction) {
- determineInverseCumulativeDistributionFromProbabilityMassFunction();
- }
-
- /** Destructor */
- virtual ~CategoricalAttribute () { }
-
-
- /** Determine inverse cumulative distribution from probability mass function (initialisation). */
- void determineInverseCumulativeDistributionFromProbabilityMassFunction () {
- Probability_T cumulative_probability_so_far = 0.0;
- for (typename ProbabilityMassFunction_T::const_iterator itProbabilityMassFunction = _probabilityMassFunction.begin();
- itProbabilityMassFunction != _probabilityMassFunction.end();
- ++itProbabilityMassFunction) {
- Probability_T attribute_probability_mass =
- DictionaryManager::keyToValue (itProbabilityMassFunction->second);
- if (attribute_probability_mass > 0) {
- T attribute_value = itProbabilityMassFunction->first;
- cumulative_probability_so_far += attribute_probability_mass;
- DictionaryKey_T lKey =
- DictionaryManager::valueToKey (cumulative_probability_so_far);
- //_inverseCumulativeDistribution[lKey] = attribute_value;
- _inverseCumulativeDistribution.insert (typename InverseCumulativeDistribution_T::value_type (lKey, attribute_value));
- }
- }
- }
-
- private:
- // ////////// Attributes //////////
- /** Probability mass function */
- ProbabilityMassFunction_T _probabilityMassFunction;
-
- /** Inverse cumulative distribution */
- InverseCumulativeDistribution_T _inverseCumulativeDistribution;
-
- };
-}
-#endif // __STDAIR_BAS_CATEGORICALATTRIBUTE_HPP
Deleted: trunk/stdair/stdair/basic/CategoricalAttributeLite.hpp
===================================================================
--- trunk/stdair/stdair/basic/CategoricalAttributeLite.hpp 2010-08-20 10:40:49 UTC (rev 272)
+++ trunk/stdair/stdair/basic/CategoricalAttributeLite.hpp 2010-08-20 14:53:57 UTC (rev 273)
@@ -1,122 +0,0 @@
-#ifndef __STDAIR_BAS_CATEGORICALATTRIBUTELITE_HPP
-#define __STDAIR_BAS_CATEGORICALATTRIBUTELITE_HPP
-
-// //////////////////////////////////////////////////////////////////////
-// Import section
-// //////////////////////////////////////////////////////////////////////
-// STL
-#include <map>
-#include <iosfwd>
-// STDAIR
-#include <stdair/STDAIR_Types.hpp>
-#include <stdair/basic/DictionaryManager.hpp>
-#include <stdair/service/Logger.hpp>
-
-namespace stdair {
-
- /** Class modeling the distribution of values that can be taken by a
- categorical attribute. */
- template <class T>
- struct CategoricalAttributeLite {
- public:
- /** Define the probability mass function type. */
- typedef std::map<T, Probability_T> ProbabilityMassFunction_T;
-
- public:
- // /////////////// Business Methods //////////
- /** Get value from inverse cumulative distribution. */
- const T getValue (Probability_T iCumulativeProbability) const {
- const DictionaryKey_T lKey =
- DictionaryManager::valueToKey (iCumulativeProbability);
-
- for (unsigned int idx = 0; idx < _size; ++idx) {
- if (_cumulativeDistribution[idx] >= lKey) {
- return _valueArray[idx];
- }
- }
-
- STDAIR_LOG_ERROR ("The following cumulative probability "
- << "is out of range: " << iCumulativeProbability);
- assert (false);
- T t;
- return t;
- }
-
- public:
- // ////////////// Display Support Methods //////////
- /** Display probability mass function. */
- const std::string displayProbabilityMass () const {
- std::ostringstream oStr;
-
- for (unsigned int idx = 0; idx < _size; ++idx) {
- if (idx != 0) {
- oStr << ", ";
- }
- oStr << _valueArray [idx] << ":"
- << DictionaryManager::keyToValue (_cumulativeDistribution[idx]);
- }
- return oStr.str();
- }
-
- public:
- // ////////// Constructors and destructors /////////
- /** Constructor by default */
- CategoricalAttributeLite (const ProbabilityMassFunction_T& iValueMap)
- : _size (iValueMap.size()) {
- _cumulativeDistribution = new DictionaryKey_T[_size];
- _valueArray = new T[_size];
- init (iValueMap);
- }
- /** Destructor */
- virtual ~CategoricalAttributeLite () {
- // TODO: Verify that the arrays are correctly cleaned.
- delete _cumulativeDistribution; _cumulativeDistribution = NULL;
- delete _valueArray; _valueArray = NULL;
- }
-
- private:
- /** Default constructors. */
- CategoricalAttributeLite ();
- CategoricalAttributeLite (const CategoricalAttributeLite&);
-
-
- /** Initialise the two arrays from the given map. */
- void init (const ProbabilityMassFunction_T& iValueMap) {
-
- Probability_T cumulative_probability_so_far = 0.0;
- unsigned int idx = 0;
-
- // Browse the map to retrieve the values and to build the
- // cumulative probabilities.
- for (typename ProbabilityMassFunction_T::const_iterator itProbabilityMassFunction = iValueMap.begin();
- itProbabilityMassFunction != iValueMap.end();
- ++itProbabilityMassFunction, ++idx) {
-
- Probability_T attribute_probability_mass =
- itProbabilityMassFunction->second;
- if (attribute_probability_mass > 0) {
- T attribute_value = itProbabilityMassFunction->first;
- cumulative_probability_so_far += attribute_probability_mass;
- DictionaryKey_T lKey =
- DictionaryManager::valueToKey (cumulative_probability_so_far);
-
- // Build the two arrays.
- _cumulativeDistribution[idx] = lKey;
- _valueArray[idx] = attribute_value;
- }
- }
- }
-
- private:
- // ////////// Attributes //////////
- /** Size of the two arrays. */
- const unsigned int _size;
-
- /** Cumulative dictionary-coded distribution. */
- DictionaryKey_T* _cumulativeDistribution;
-
- /** The corresponding values. */
- T* _valueArray;
- };
-}
-#endif // __STDAIR_BAS_CATEGORICALATTRIBUTELITE_HPP
Deleted: trunk/stdair/stdair/basic/ContinuousAttribute.hpp
===================================================================
--- trunk/stdair/stdair/basic/ContinuousAttribute.hpp 2010-08-20 10:40:49 UTC (rev 272)
+++ trunk/stdair/stdair/basic/ContinuousAttribute.hpp 2010-08-20 14:53:57 UTC (rev 273)
@@ -1,154 +0,0 @@
-#ifndef __STDAIR_BAS_CONTINUOUSATTRIBUTE_HPP
-#define __STDAIR_BAS_CONTINUOUSATTRIBUTE_HPP
-
-// //////////////////////////////////////////////////////////////////////
-// Import section
-// //////////////////////////////////////////////////////////////////////
-// STL
-#include <string>
-#include <map>
-// STDAIR
-#include <stdair/STDAIR_Types.hpp>
-#include <stdair/basic/DictionaryManager.hpp>
-#include <stdair/service/Logger.hpp>
-
-namespace stdair {
-
- /** Class modeling the distribution of values that can be taken by a
- continuous attribute. */
- template <class T>
- struct ContinuousAttribute {
- public:
-
- // ///////////// Type definitions //////////////
- /** */
- typedef std::multimap<T, DictionaryKey_T> ContinuousDistribution_T;
- typedef std::multimap<DictionaryKey_T, T> ContinuousInverseDistribution_T;
-
- private:
- // ///////////// Getters ///////////
- /** Get the cumulative distribution. */
- const ContinuousDistribution_T& getCumulativeDistribution() const {
- return _cumulativeDistribution;
- }
-
- /** Get the inverse cumulative distribution. */
- const ContinuousInverseDistribution_T& getInverseCumulativeDistribution () const {
- return _inverseCumulativeDistribution;
- }
-
- private:
- // ///////////// Setters ///////////
- /** Set the cumulative distribution */
- void setCumulativeDistribution (const ContinuousDistribution_T& iCumulativeDistribution) {
- _cumulativeDistribution = iCumulativeDistribution;
- determineInverseCumulativeDistributionFromCumulativeDistribution();
- }
-
- public:
- // /////////////// Business Methods //////////
- /** Get value from inverse cumulative distribution. */
- const T getValue (const Probability_T& iCumulativeProbability) const {
- const DictionaryKey_T lKey =
- DictionaryManager::valueToKey (iCumulativeProbability);
- typename ContinuousInverseDistribution_T::const_iterator it =
- _inverseCumulativeDistribution.lower_bound (lKey);
-
- Probability_T cumulativeProbabilityNextPoint =
- DictionaryManager::keyToValue (it->first);
- T valueNextPoint = it->second;
-
- if (it == _inverseCumulativeDistribution.begin()) {
- STDAIR_LOG_DEBUG ("Last element");
- return valueNextPoint;
- }
- --it;
-
- Probability_T cumulativeProbabilityPreviousPoint =
- DictionaryManager::keyToValue (it->first);
- T valuePreviousPoint = it->second;
- if (cumulativeProbabilityNextPoint == cumulativeProbabilityPreviousPoint) {
- return valuePreviousPoint;
- }
-
- return valuePreviousPoint + (valueNextPoint - valuePreviousPoint)
- * (iCumulativeProbability - cumulativeProbabilityPreviousPoint)
- / (cumulativeProbabilityNextPoint - cumulativeProbabilityPreviousPoint);
- }
-
- public:
- // ////////////// Display Support Methods //////////
- /** Display cumulative distribution */
- const std::string displayCumulativeDistribution() const {
- std::ostringstream oStr;
- unsigned int idx = 0;
- for (typename ContinuousDistribution_T::const_iterator it =
- _cumulativeDistribution.begin();
- it != _cumulativeDistribution.end(); ++it, ++idx) {
- if (idx != 0) {
- oStr << ", ";
- }
- oStr << it->first << ":"
- << DictionaryManager::keyToValue (it->second);
- }
- return oStr.str();
- }
-
- /** Display inverse cumulative distribution */
- const std::string displayInverseCumulativeDistribution() const {
- std::ostringstream oStr;
- for (typename ContinuousInverseDistribution_T::const_iterator it =
- _inverseCumulativeDistribution.begin();
- it != _inverseCumulativeDistribution.end(); ++it) {
- oStr << "cumulative prob: " << DictionaryManager::keyToValue (it->first)
- << " value: " << it->second << std::endl;
- }
- return oStr.str();
- }
-
- public:
- // ////////// Constructors and destructors /////////
- /** Constructor by default */
- ContinuousAttribute () { }
-
- /** Constructor */
- ContinuousAttribute (const ContinuousDistribution_T& iCumulativeDistribution)
- : _cumulativeDistribution (iCumulativeDistribution) {
- determineInverseCumulativeDistributionFromCumulativeDistribution();
- }
-
- /** Copy constructor */
- ContinuousAttribute (const ContinuousAttribute& iContinuousAttribute)
- : _cumulativeDistribution (iContinuousAttribute._cumulativeDistribution),
- _inverseCumulativeDistribution (iContinuousAttribute._inverseCumulativeDistribution) {
- }
-
- /** Destructor */
- virtual ~ContinuousAttribute () { }
-
- /** Determine inverse cumulative distribution from cumulative
- distribution (initialisation). */
- void determineInverseCumulativeDistributionFromCumulativeDistribution () {
- for (typename ContinuousDistribution_T::iterator itCumulativeDistribution =
- _cumulativeDistribution.begin();
- itCumulativeDistribution != _cumulativeDistribution.end();
- ++itCumulativeDistribution) {
- _inverseCumulativeDistribution.
- insert (typename ContinuousInverseDistribution_T::
- value_type (itCumulativeDistribution->second,
- itCumulativeDistribution->first));
- }
- }
-
- private:
- // ////////// Attributes //////////
-
- /** Cumulative distribution */
- ContinuousDistribution_T _cumulativeDistribution;
-
- /** Inverse cumulative distribution */
- ContinuousInverseDistribution_T _inverseCumulativeDistribution;
- };
-
-}
-#endif // __STDAIR_BAS_CONTINUOUSATTRIBUTE_HPP
Deleted: trunk/stdair/stdair/basic/ContinuousAttributeLite.hpp
===================================================================
--- trunk/stdair/stdair/basic/ContinuousAttributeLite.hpp 2010-08-20 10:40:49 UTC (rev 272)
+++ trunk/stdair/stdair/basic/ContinuousAttributeLite.hpp 2010-08-20 14:53:57 UTC (rev 273)
@@ -1,129 +0,0 @@
-#ifndef __STDAIR_BAS_CONTINUOUSATTRIBUTELITE_HPP
-#define __STDAIR_BAS_CONTINUOUSATTRIBUTELITE_HPP
-
-// //////////////////////////////////////////////////////////////////////
-// Import section
-// //////////////////////////////////////////////////////////////////////
-// STL
-#include <string>
-#include <map>
-// STDAIR
-#include <stdair/STDAIR_Types.hpp>
-#include <stdair/basic/DictionaryManager.hpp>
-#include <stdair/service/Logger.hpp>
-
-namespace stdair {
-
- /** Class modeling the distribution of values that can be taken by a
- continuous attribute. */
- template <class T>
- struct ContinuousAttributeLite {
- public:
- // ///////////// Type definitions //////////////
- typedef std::multimap<T, Probability_T> ContinuousDistribution_T;
-
- public:
- // /////////////// Business Methods //////////
- /** Get value from inverse cumulative distribution. */
- const T getValue (const Probability_T& iCumulativeProbability) const {
- const DictionaryKey_T lKey =
- DictionaryManager::valueToKey (iCumulativeProbability);
- unsigned int idx = 0;
-
- // Find the first cumulative probablity value greater or equal to lKey.
- for (; idx < _size; ++idx) {
- if (_cumulativeDistribution[idx] >= lKey) {
- break;
- }
- }
-
- if (idx == 0) {
- return _valueArray[idx];
- }
-
- Probability_T lCumulativeCurrentPoint =
- DictionaryManager::keyToValue (_cumulativeDistribution[idx]);
- Probability_T lCumulativePreviousPoint =
- DictionaryManager::keyToValue (_cumulativeDistribution[idx-1]);
- T lValueCurrentPoint = _valueArray[idx];
- T lValuePreviousPoint = _valueArray[idx-1];
-
- if (lCumulativePreviousPoint == lCumulativeCurrentPoint) {
- return lValuePreviousPoint;
- }
-
- return lValuePreviousPoint + (lValueCurrentPoint - lValuePreviousPoint)
- * (iCumulativeProbability - lCumulativePreviousPoint)
- / (lCumulativeCurrentPoint - lCumulativePreviousPoint);
- }
-
- public:
- // ////////////// Display Support Methods //////////
- /** Display cumulative distribution */
- const std::string displayCumulativeDistribution() const {
- std::ostringstream oStr;
-
- for (unsigned int idx = 0; idx < _size; ++idx) {
- if (idx != 0) {
- oStr << ", ";
- }
- oStr << _valueArray[idx] << ":"
- << DictionaryManager::keyToValue (_cumulativeDistribution[idx]);
- }
- return oStr.str();
- }
-
- public:
- // ////////// Constructors and destructors /////////
- /** Constructor */
- ContinuousAttributeLite (const ContinuousDistribution_T& iValueMap)
- : _size (iValueMap.size()) {
- _cumulativeDistribution = new DictionaryKey_T[_size];
- _valueArray = new T[_size];
- init (iValueMap);
- }
-
- /** Destructor */
- virtual ~ContinuousAttributeLite () {
- // TODO: Verify that the arrays are correctly cleaned.
- delete _cumulativeDistribution; _cumulativeDistribution = NULL;
- delete _valueArray; _valueArray = NULL;
- }
-
- private:
- /** Constructors by default */
- ContinuousAttributeLite ();
- ContinuousAttributeLite (const ContinuousAttributeLite&);
-
- /** Determine inverse cumulative distribution from cumulative
- distribution (initialisation). */
- void init (const ContinuousDistribution_T& iValueMap) {
- unsigned int idx = 0;
-
- // Browse the map to retrieve the values and cumulative probabilities.
- for (typename ContinuousDistribution_T::const_iterator it =
- iValueMap.begin(); it != iValueMap.end(); ++it, ++idx) {
-
- T attributeValue = it->first;
- DictionaryKey_T lKey = DictionaryManager::valueToKey (it->second);
-
- // Build the two arrays.
- _cumulativeDistribution[idx] = lKey;
- _valueArray[idx] = attributeValue;
- }
- }
-
- private:
- // ////////// Attributes //////////
- /** Size of the two arrays. */
- const unsigned int _size;
-
- /** Cumulative dictionary-coded distribution. */
- DictionaryKey_T* _cumulativeDistribution;
-
- /** The corresponding values. */
- T* _valueArray;
- };
-
-}
-#endif // __STDAIR_BAS_CONTINUOUSATTRIBUTELITE_HPP
Deleted: trunk/stdair/stdair/basic/DemandCharacteristicTypes.hpp
===================================================================
--- trunk/stdair/stdair/basic/DemandCharacteristicTypes.hpp 2010-08-20 10:40:49 UTC (rev 272)
+++ trunk/stdair/stdair/basic/DemandCharacteristicTypes.hpp 2010-08-20 14:53:57 UTC (rev 273)
@@ -1,69 +0,0 @@
-#ifndef __STDAIR_BAS_DEMANDCHARACTERISTICTYPES_HPP
-#define __STDAIR_BAS_DEMANDCHARACTERISTICTYPES_HPP
-
-// //////////////////////////////////////////////////////////////////////
-// Import section
-// //////////////////////////////////////////////////////////////////////
-// StdAir
-#include <stdair/STDAIR_Types.hpp>
-#include <stdair/basic/ContinuousAttributeLite.hpp>
-#include <stdair/basic/CategoricalAttributeLite.hpp>
-
-namespace stdair {
-
- /** Type definition for the continuous distribition of the duration
- (as a float number). */
- typedef ContinuousAttributeLite<FloatDuration_T> ContinuousFloatDuration_T;
-
- /** Type definition for the arrival pattern cumulative distribution. */
- typedef ContinuousFloatDuration_T::ContinuousDistribution_T ArrivalPatternCumulativeDistribution_T;
-
- /** Define the point-of-sale probablity mass. */
- typedef CategoricalAttributeLite<AirportCode_T> POSProbabilityMass_T;
-
- /** Define the probability mass function type of point-of-sale. */
- typedef POSProbabilityMass_T::ProbabilityMassFunction_T POSProbabilityMassFunction_T;
-
- /** Define the booking channel probablity mass. */
- typedef CategoricalAttributeLite<ChannelLabel_T> ChannelProbabilityMass_T;
-
- /** Define the probability mass function type of booking channel. */
- typedef ChannelProbabilityMass_T::ProbabilityMassFunction_T ChannelProbabilityMassFunction_T;
-
- /** Define the trip type probablity mass. */
- typedef CategoricalAttributeLite<TripType_T> TripTypeProbabilityMass_T;
-
- /** Define the probability mass function type of trip type. */
- typedef TripTypeProbabilityMass_T::ProbabilityMassFunction_T TripTypeProbabilityMassFunction_T;
-
- /** Define the stay duration probablity mass. */
- typedef CategoricalAttributeLite<DayDuration_T> StayDurationProbabilityMass_T;
-
- /** Define the probability mass function type of stay duration. */
- typedef StayDurationProbabilityMass_T::ProbabilityMassFunction_T StayDurationProbabilityMassFunction_T;
-
- /** Define the frequent flyer probablity mass. */
- typedef CategoricalAttributeLite<FrequentFlyer_T> FrequentFlyerProbabilityMass_T;
-
- /** Define the probability mass function type of frequent flyer. */
- typedef FrequentFlyerProbabilityMass_T::ProbabilityMassFunction_T FrequentFlyerProbabilityMassFunction_T;
-
- /** Define the preferred departure time cumulative distribution. */
- typedef ContinuousAttributeLite<IntDuration_T> PreferredDepartureTimeCumulativeDistribution_T;
-
- /** Define the preferred departure time continuous distribution. */
- typedef PreferredDepartureTimeCumulativeDistribution_T::ContinuousDistribution_T PreferredDepartureTimeContinuousDistribution_T;
-
- /** Define the willingness-to-pay cumulative distribution. */
- typedef ContinuousAttributeLite<WTP_T> WTPCumulativeDistribution_T;
-
- /** Define the willingness-to-pay continuous distribution. */
- typedef WTPCumulativeDistribution_T::ContinuousDistribution_T WTPContinuousDistribution_T;
-
- /** Define the value of time cumulative distribution. */
- typedef ContinuousAttributeLite<PriceValue_T> ValueOfTimeCumulativeDistribution_T;
-
- /** Define the value of time continuous distribution. */
- typedef ValueOfTimeCumulativeDistribution_T::ContinuousDistribution_T ValueOfTimeContinuousDistribution_T;
-}
-#endif // __STDAIR_BAS_DEMANDCHARACTERISTICTYPES_HPP
Deleted: trunk/stdair/stdair/basic/DemandCharacteristics.cpp
===================================================================
--- trunk/stdair/stdair/basic/DemandCharacteristics.cpp 2010-08-20 10:40:49 UTC (rev 272)
+++ trunk/stdair/stdair/basic/DemandCharacteristics.cpp 2010-08-20 14:53:57 UTC (rev 273)
@@ -1,78 +0,0 @@
-// //////////////////////////////////////////////////////////////////////
-// Import section
-// //////////////////////////////////////////////////////////////////////
-// STL
-#include <cassert>
-#include <sstream>
-// StdAir
-#include <stdair/STDAIR_Types.hpp>
-#include <stdair/basic/BasConst_General.hpp>
-#include <stdair/basic/DemandCharacteristics.hpp>
-
-namespace stdair {
-
- // /////////////////////////////////////////////////////
- DemandCharacteristics::
- DemandCharacteristics (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 WTPContinuousDistribution_T& iWTPContinuousDistribution,
- const ValueOfTimeContinuousDistribution_T& iValueOfTimeContinuousDistribution)
- : _arrivalPattern (iArrivalPattern),
- _posProbabilityMass (iPOSProbMass),
- _channelProbabilityMass (iChannelProbMass),
- _tripTypeProbabilityMass (iTripTypeProbMass),
- _stayDurationProbabilityMass (iStayDurationProbMass),
- _frequentFlyerProbabilityMass (iFrequentFlyerProbMass),
- _preferredDepartureTimeCumulativeDistribution (iPreferredDepartureTimeContinuousDistribution),
- _wtpCumulativeDistribution (iWTPContinuousDistribution),
- _valueOfTimeCumulativeDistribution (iValueOfTimeContinuousDistribution) {
- }
-
- // /////////////////////////////////////////////////////
- DemandCharacteristics::~DemandCharacteristics () {
- }
-
- // /////////////////////////////////////////////////////
- std::string DemandCharacteristics::display() const {
- std::ostringstream oStr;
-
- //
- oStr << "****************** Demand characteristics ******************"
- << std::endl;
- oStr << "Arrival pattern (days from departure, proportion): ";
- oStr << _arrivalPattern.displayCumulativeDistribution() << std::endl;
- oStr << "POS probability mass (POS, propotion): ";
- oStr << _posProbabilityMass.displayProbabilityMass()
- << std::endl;
- oStr << "Channel probability mass (channel, propotion): ";
- oStr << _channelProbabilityMass.displayProbabilityMass()
- << std::endl;
- oStr << "Trip type probability mass (trip type, propotion): ";
- oStr << _tripTypeProbabilityMass.displayProbabilityMass()
- << std::endl;
- oStr << "Stay duration probability mass (number of days, propotion): ";
- oStr << _stayDurationProbabilityMass.displayProbabilityMass()
- << std::endl;
- oStr << "Frequent flyer probability mass (frequent flyer, propotion): ";
- oStr << _frequentFlyerProbabilityMass.displayProbabilityMass()
- << std::endl;
- oStr << "Preferred departure time cumulative distribution (time, proportion: ";
- oStr << _preferredDepartureTimeCumulativeDistribution.displayCumulativeDistribution() << std::endl;
- oStr << "WTP cumulative distribution (WTP, proportion: ";
- oStr << _wtpCumulativeDistribution.displayCumulativeDistribution()
- << std::endl;
- oStr << "Value of time cumulative distribution (value of time, proportion: ";
- oStr << _valueOfTimeCumulativeDistribution.displayCumulativeDistribution()
- << std::endl;
-
-
- return oStr.str();
- }
-
-}
-
Deleted: trunk/stdair/stdair/basic/DemandCharacteristics.hpp
===================================================================
--- trunk/stdair/stdair/basic/DemandCharacteristics.hpp 2010-08-20 10:40:49 UTC (rev 272)
+++ trunk/stdair/stdair/basic/DemandCharacteristics.hpp 2010-08-20 14:53:57 UTC (rev 273)
@@ -1,79 +0,0 @@
-#ifndef __STDAIR_BAS_DEMAND_CHARACTERISTICS_HPP
-#define __STDAIR_BAS_DEMAND_CHARACTERISTICS_HPP
-
-// //////////////////////////////////////////////////////////////////////
-// Import section
-// //////////////////////////////////////////////////////////////////////
-// STL
-#include <string>
-// StdAir
-#include <stdair/STDAIR_Types.hpp>
-#include <stdair/basic/DemandCharacteristicTypes.hpp>
-#include <stdair/bom/DemandStreamKey.hpp>
-
-namespace stdair {
-
- /** Class modeling the characteristics of a demand type. */
- struct DemandCharacteristics {
-
- public:
- // ////////////// Display Support Methods //////////
- /** Display demand characteristics */
- std::string display() const;
-
-
- public:
- // ////////// Constructors and destructors /////////
- /** Default constructor. */
- DemandCharacteristics (const ArrivalPatternCumulativeDistribution_T&,
- const POSProbabilityMassFunction_T&,
- const ChannelProbabilityMassFunction_T&,
- const TripTypeProbabilityMassFunction_T&,
- const StayDurationProbabilityMassFunction_T&,
- const FrequentFlyerProbabilityMassFunction_T&,
- const PreferredDepartureTimeContinuousDistribution_T&,
- const WTPContinuousDistribution_T&,
- const ValueOfTimeContinuousDistribution_T&);
-
- /** Destructor */
- ~DemandCharacteristics ();
- private:
- /** Default constructor. */
- DemandCharacteristics ();
- /** Copy constructor. */
- DemandCharacteristics (const DemandCharacteristics&);
-
- public:
- // //////////////////// Attributes /////////////////////
- /** Arrival pattern (cumulative distribution of timing of arrival
- of requests (negative number of days between departure date
- and request date). */
- const ContinuousFloatDuration_T _arrivalPattern;
-
- /** POS probability mass. */
- const POSProbabilityMass_T _posProbabilityMass;
-
- /** Channel probability mass. */
- const ChannelProbabilityMass_T _channelProbabilityMass;
-
- /** Trip type probability mass */
- const TripTypeProbabilityMass_T _tripTypeProbabilityMass;
-
- /** Stay duration probability mass */
- const StayDurationProbabilityMass_T _stayDurationProbabilityMass;
-
- /** Frequent flyer probability mass */
- const FrequentFlyerProbabilityMass_T _frequentFlyerProbabilityMass;
-
- /** Preferred departure time cumulative distribution. */
- const PreferredDepartureTimeCumulativeDistribution_T _preferredDepartureTimeCumulativeDistribution;
-
- /** Willingness-to-pay cumulative distribution */
- const WTPCumulativeDistribution_T _wtpCumulativeDistribution;
-
- /** Value of time cumulative distribution. */
- const ValueOfTimeCumulativeDistribution_T _valueOfTimeCumulativeDistribution;
- };
-
-}
-#endif // __STDAIR_BAS_DEMAND_CHARACTERISTICS_HPP
Deleted: trunk/stdair/stdair/basic/DemandDistribution.cpp
===================================================================
--- trunk/stdair/stdair/basic/DemandDistribution.cpp 2010-08-20 10:40:49 UTC (rev 272)
+++ trunk/stdair/stdair/basic/DemandDistribution.cpp 2010-08-20 14:53:57 UTC (rev 273)
@@ -1,51 +0,0 @@
-// //////////////////////////////////////////////////////////////////////
-// Import section
-// //////////////////////////////////////////////////////////////////////
-// STL
-#include <cassert>
-#include <sstream>
-// STDAIR
-#include <stdair/STDAIR_Types.hpp>
-#include <stdair/basic/DemandDistribution.hpp>
-
-namespace stdair {
-
- // /////////////////////////////////////////////////////
- DemandDistribution::
- DemandDistribution (const NbOfRequests_T& iMean,
- const StandardDeviationValue_T& iStandardDeviation)
- : _meanNumberOfRequests (iMean),
- _standardDeviationNumberOfRequests (iStandardDeviation){
- }
-
- // /////////////////////////////////////////////////////
- DemandDistribution::DemandDistribution () {
- }
-
- // /////////////////////////////////////////////////////
- DemandDistribution::~DemandDistribution () {
- }
-
- // /////////////////////////////////////////////////////
- DemandDistribution::
- DemandDistribution (const DemandDistribution& iDemandDistribution)
- : _meanNumberOfRequests (iDemandDistribution._meanNumberOfRequests),
- _standardDeviationNumberOfRequests (iDemandDistribution._standardDeviationNumberOfRequests) {
- }
-
- // /////////////////////////////////////////////////////
- std::string DemandDistribution::display() const {
- std::ostringstream oStr;
-
- oStr << "****************** Demand distribution ******************"
- << std::endl;
- oStr << "Mean number of requests .......... : "
- << _meanNumberOfRequests << std::endl;
- oStr << "Std dev of number of requests .... : "
- << _standardDeviationNumberOfRequests << std::endl;
-
- return oStr.str();
- }
-
-}
-
Deleted: trunk/stdair/stdair/basic/DemandDistribution.hpp
===================================================================
--- trunk/stdair/stdair/basic/DemandDistribution.hpp 2010-08-20 10:40:49 UTC (rev 272)
+++ trunk/stdair/stdair/basic/DemandDistribution.hpp 2010-08-20 14:53:57 UTC (rev 273)
@@ -1,44 +0,0 @@
-#ifndef __STDAIR_BAS_DEMAND_DISTRIBUTION_HPP
-#define __STDAIR_BAS_DEMAND_DISTRIBUTION_HPP
-
-// //////////////////////////////////////////////////////////////////////
-// Import section
-// //////////////////////////////////////////////////////////////////////
-// STL
-#include <string>
-// STDAIR
-#include <stdair/STDAIR_Types.hpp>
-#include <stdair/basic/ContinuousAttribute.hpp>
-
-namespace stdair {
-
- /** Class modeling the distribution of a demand type. */
- struct DemandDistribution {
-
- // ////////////// Display Support Methods //////////
- /** Display demand distribution */
- std::string display() const;
-
-
- // ////////// Constructors and destructors /////////
- /** Constructor. */
- DemandDistribution (const NbOfRequests_T& iMean,
- const StandardDeviationValue_T& iStandardDeviation);
- /** Default constructor. */
- DemandDistribution ();
- /** Copy constructor. */
- DemandDistribution (const DemandDistribution&);
- /** Destructor. */
- ~DemandDistribution ();
-
-
- // ////////// Attributes //////////
- /** Mean number of requests */
- NbOfRequests_T _meanNumberOfRequests;
-
- /** Standard deviation of number of requests */
- StandardDeviationValue_T _standardDeviationNumberOfRequests;
- };
-
-}
-#endif // __STDAIR_BAS_DEMAND_DISTRIBUTION_HPP
Deleted: trunk/stdair/stdair/basic/DictionaryManager.cpp
===================================================================
--- trunk/stdair/stdair/basic/DictionaryManager.cpp 2010-08-20 10:40:49 UTC (rev 272)
+++ trunk/stdair/stdair/basic/DictionaryManager.cpp 2010-08-20 14:53:57 UTC (rev 273)
@@ -1,21 +0,0 @@
-// //////////////////////////////////////////////////////////////////////
-// Import section
-// //////////////////////////////////////////////////////////////////////
-// STDAIR
-#include <stdair/basic/DictionaryManager.hpp>
-
-namespace stdair {
- // ////////////////////////////////////////////////////////////////////
- const Probability_T DictionaryManager::keyToValue(const DictionaryKey_T iKey) {
- return static_cast<Probability_T>(iKey) / 200;
- }
-
- // ////////////////////////////////////////////////////////////////////
- const DictionaryKey_T DictionaryManager::
- valueToKey (const Probability_T iValue) {
- return iValue * 200;
- }
-
- // DEBUG
- unsigned int COUNT = 0;
-}
Deleted: trunk/stdair/stdair/basic/DictionaryManager.hpp
===================================================================
--- trunk/stdair/stdair/basic/DictionaryManager.hpp 2010-08-20 10:40:49 UTC (rev 272)
+++ trunk/stdair/stdair/basic/DictionaryManager.hpp 2010-08-20 14:53:57 UTC (rev 273)
@@ -1,25 +0,0 @@
-// //////////////////////////////////////////////////////////////////////
-#ifndef __STDAIR_BOM_DICTIONARYMANAGER_HPP
-#define __STDAIR_BOM_DICTIONARYMANAGER_HPP
-
-// //////////////////////////////////////////////////////////////////////
-// Import section
-// //////////////////////////////////////////////////////////////////////
-// STDAIR
-#include <stdair/STDAIR_Types.hpp>
-
-namespace stdair {
-
- /** Class wrapper of dictionary business methods. */
- class DictionaryManager {
- public:
- // //////////// Business methods /////////////////
- /** Convert from key to value. */
- static const Probability_T keyToValue (const DictionaryKey_T);
-
- /** Convert from value to key. */
- static const DictionaryKey_T valueToKey (const Probability_T);
-
- };
-}
-#endif // __STDAIR_BOM_DICTIONARYMANAGER_HPP
Deleted: trunk/stdair/stdair/basic/RandomGeneration.cpp
===================================================================
--- trunk/stdair/stdair/basic/RandomGeneration.cpp 2010-08-20 10:40:49 UTC (rev 272)
+++ trunk/stdair/stdair/basic/RandomGeneration.cpp 2010-08-20 14:53:57 UTC (rev 273)
@@ -1,72 +0,0 @@
-// STL
-#include <cassert>
-#include <iostream>
-// Boost
-#include <boost/version.hpp>
-#if BOOST_VERSION >= 103500
-#include <boost/math/distributions/normal.hpp>
-#endif // BOOST_VERSION >= 103500
-//STDAIR
-#include <stdair/basic/RandomGeneration.hpp>
-
-namespace stdair {
-
- // //////////////////////////////////////////////////////////////////////
- RandomGeneration::RandomGeneration (const RandomSeed_T& iSeed)
- : _seed (iSeed), _generator (iSeed),
- _uniformGenerator (_generator, boost::uniform_real<> (0, 1)) {
- init ();
- }
-
- // //////////////////////////////////////////////////////////////////////
- RandomGeneration::RandomGeneration (const RandomGeneration& iRandomGeneration)
- : _seed (iRandomGeneration._seed),
- _generator (iRandomGeneration._generator),
- _uniformGenerator (iRandomGeneration._uniformGenerator) {
- }
-
- // //////////////////////////////////////////////////////////////////////
- RandomGeneration::RandomGeneration ()
- : _seed (0), _generator (0),
- _uniformGenerator (_generator, boost::uniform_real<> (0, 1)) {
- assert (false);
- }
-
- // //////////////////////////////////////////////////////////////////////
- RandomGeneration::~RandomGeneration () {
- }
-
- // //////////////////////////////////////////////////////////////////////
- void RandomGeneration::init () {
- }
-
- // //////////////////////////////////////////////////////////////////////
- RealNumber_T RandomGeneration::generateUniform01 () {
- const RealNumber_T lVariateUnif = _uniformGenerator();
- return lVariateUnif;
- }
-
- // //////////////////////////////////////////////////////////////////////
- RealNumber_T RandomGeneration::
- generateUniform (const RealNumber_T& iMinValue, const RealNumber_T& iMaxValue){
- const RealNumber_T lVariateUnif =
- iMinValue + _uniformGenerator() * (iMaxValue - iMinValue);
- return lVariateUnif;
- }
-
- // //////////////////////////////////////////////////////////////////////
- RealNumber_T RandomGeneration::
- generateNormal (const RealNumber_T& mu, const RealNumber_T& sigma) {
-#if BOOST_VERSION >= 103500
- const Probability_T lVariateUnif = generateUniform01 ();
- const boost::math::normal lNormal (mu, sigma);
- const RealNumber_T lRealNumberOfRequestsToBeGenerated =
- boost::math::quantile(lNormal, lVariateUnif);
-#else // BOOST_VERSION >= 103500
- // TODO: rely on GSL when Boost version smaller than 1.35
- const RealNumber_T lRealNumberOfRequestsToBeGenerated = 0.0;
-#endif // BOOST_VERSION >= 103500
-
- return lRealNumberOfRequestsToBeGenerated;
- }
-}
Deleted: trunk/stdair/stdair/basic/RandomGeneration.hpp
===================================================================
--- trunk/stdair/stdair/basic/RandomGeneration.hpp 2010-08-20 10:40:49 UTC (rev 272)
+++ trunk/stdair/stdair/basic/RandomGeneration.hpp 2010-08-20 14:53:57 UTC (rev 273)
@@ -1,64 +0,0 @@
-#ifndef __STDAIR_BAS_BOM_RANDOMGENERATION_HPP
-#define __STDAIR_BAS_BOM_RANDOMGENERATION_HPP
-
-// //////////////////////////////////////////////////////////////////////
-// Import section
-// //////////////////////////////////////////////////////////////////////
-// Boost Random
-#include <boost/random/uniform_real.hpp>
-#include <boost/random/variate_generator.hpp>
-// STDAIR
-#include <stdair/STDAIR_Types.hpp>
-
-namespace stdair {
-
- /** Random generator. */
- struct RandomGeneration {
- // //////////// Business Methods /////////////
- /** Generate a randomized number following a uniform distribution
- between 0 (included) and 1 (excluded). */
- RealNumber_T generateUniform01 ();
-
- /** Generate a randomized number following a uniform distribution
- between a minimum (included) and a maximum (excluded)
- value. */
- RealNumber_T generateUniform (const RealNumber_T&, const RealNumber_T&);
-
- /** Generate a randomized number following a normal distribution
- specified by a mean and a standard deviation. */
- RealNumber_T generateNormal (const RealNumber_T&, const RealNumber_T&);
-
- // ////////// Constructors and destructors /////////
- /** Constructor. */
- RandomGeneration (const RandomSeed_T&);
- /** Default constructors. */
- RandomGeneration ();
- RandomGeneration (const RandomGeneration&);
- /** Destructor. */
- ~RandomGeneration ();
- /** Initialize the random generator.
- <br>A uniform random number distribution is defined, which
- produces "real" values between 0 and 1 (0 inclusive, 1
- exclusive). */
- void init ();
-
- // ////////// Attributes //////////
- /** The seed of the random generator.
- <br>The seed is unsigned, otherwise the wrong overload may be
- selected when using mt19937 as the boost::base_generator_type. */
- RandomSeed_T _seed;
-
- /** Random number generator engine.
- <br>The random number generator is currently based on boost::minstd_rand.
- Alternates are boost::mt19937, boost::ecuyer1988. */
- BaseGenerator_T _generator;
-
- /** Random number generator.
- <br>It is initialized with a reproducible seed and a uniform
- distribution. */
- boost::variate_generator<BaseGenerator_T&,
- boost::uniform_real<> > _uniformGenerator;
- };
-
-}
-#endif // __STDAIR_BAS_BOM_RANDOMGENERATION_HPP
Deleted: trunk/stdair/stdair/basic/RandomGenerationContext.cpp
===================================================================
--- trunk/stdair/stdair/basic/RandomGenerationContext.cpp 2010-08-20 10:40:49 UTC (rev 272)
+++ trunk/stdair/stdair/basic/RandomGenerationContext.cpp 2010-08-20 14:53:57 UTC (rev 273)
@@ -1,38 +0,0 @@
-// //////////////////////////////////////////////////////////////////////
-// Import section
-// //////////////////////////////////////////////////////////////////////
-// STL
-#include <iosfwd>
-// STDAIR
-#include <stdair/basic/RandomGenerationContext.hpp>
-
-namespace stdair {
-
- // //////////////////////////////////////////////////////////////////////
- RandomGenerationContext::RandomGenerationContext ()
- : _cumulativeProbabilitySoFar (0.0),
- _numberOfRequestsGeneratedSoFar (0) {
- }
-
- // //////////////////////////////////////////////////////////////////////
- RandomGenerationContext::RandomGenerationContext (const RandomGenerationContext& iRandomGenerationContext)
- : _cumulativeProbabilitySoFar (iRandomGenerationContext._cumulativeProbabilitySoFar),
- _numberOfRequestsGeneratedSoFar (iRandomGenerationContext._numberOfRequestsGeneratedSoFar) {
- }
-
- // //////////////////////////////////////////////////////////////////////
- RandomGenerationContext::~RandomGenerationContext () {
- }
-
- // //////////////////////////////////////////////////////////////////////
- void RandomGenerationContext::incrementGeneratedRequestsCounter () {
- ++_numberOfRequestsGeneratedSoFar;
- }
-
- // //////////////////////////////////////////////////////////////////////
- void RandomGenerationContext::reset () {
- _cumulativeProbabilitySoFar = 0.0;
- _numberOfRequestsGeneratedSoFar = 0;
- }
-
-}
Deleted: trunk/stdair/stdair/basic/RandomGenerationContext.hpp
===================================================================
--- trunk/stdair/stdair/basic/RandomGenerationContext.hpp 2010-08-20 10:40:49 UTC (rev 272)
+++ trunk/stdair/stdair/basic/RandomGenerationContext.hpp 2010-08-20 14:53:57 UTC (rev 273)
@@ -1,43 +0,0 @@
-#ifndef __STDAIR_BAS_RANDOM_GENERATION_CONTEXT_HPP
-#define __STDAIR_BAS_RANDOM_GENERATION_CONTEXT_HPP
-
-// //////////////////////////////////////////////////////////////////////
-// Import section
-// //////////////////////////////////////////////////////////////////////
-// STL
-#include <iosfwd>
-// STDAIR
-#include <stdair/STDAIR_Types.hpp>
-
-namespace stdair {
-
- /** Structure holding the context necessary for demand random generation. */
- struct RandomGenerationContext {
-
- // ////////// Constructors and destructors /////////
- /** Constructor by default */
- RandomGenerationContext ();
- /** Default constructors. */
- RandomGenerationContext (const RandomGenerationContext&);
- /** Destructor */
- ~RandomGenerationContext ();
-
- // /////////////// Business Methods //////////
- /** Increment counter of requests generated so far */
- void incrementGeneratedRequestsCounter ();
-
- /** Reset the counters. */
- void reset ();
-
- // ////////// Attributes //////////
- /** Cumulative probability in arrival pattern for last request
- generated so far (needed for sequential generat...
[truncated message content] |
|
From: <den...@us...> - 2010-08-20 10:40:55
|
Revision: 272
http://stdair.svn.sourceforge.net/stdair/?rev=272&view=rev
Author: denis_arnaud
Date: 2010-08-20 10:40:49 +0000 (Fri, 20 Aug 2010)
Log Message:
-----------
[Build] Added a missing tab in the Makefile.
Modified Paths:
--------------
trunk/stdair/Makefile.am
Modified: trunk/stdair/Makefile.am
===================================================================
--- trunk/stdair/Makefile.am 2010-08-19 09:52:38 UTC (rev 271)
+++ trunk/stdair/Makefile.am 2010-08-20 10:40:49 UTC (rev 272)
@@ -57,7 +57,7 @@
snapshot-src:
- $(MAKE) dist distdir=@PACKAGE_TARNAME@-`date +"%Y%m%d"`
+ $(MAKE) dist distdir=@PACKAGE_TARNAME@-`date +"%Y%m%d"`
snapshot-html:
$(MAKE) -C doc dist-html html_tarname=@PACKAGE_TARNAME@-doc-`date +"%Y%m%d"`
@@ -78,3 +78,4 @@
upload-pdf: dist-pdf
@UPLOAD_COMMAND@ @PACKAGE_TARNAME@-pdf-@VERSION@.tar.gz \
@PACKAGE_TARNAME@-pdf-@VERSION@.tar.bz2
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <den...@us...> - 2010-08-19 09:52:44
|
Revision: 271
http://stdair.svn.sourceforge.net/stdair/?rev=271&view=rev
Author: denis_arnaud
Date: 2010-08-19 09:52:38 +0000 (Thu, 19 Aug 2010)
Log Message:
-----------
[Test Samples] Added samples for the revenue management module.
Added Paths:
-----------
trunk/stdair/test/samples/rm05.csv
trunk/stdair/test/samples/rm06.csv
trunk/stdair/test/samples/rm07.csv
Added: trunk/stdair/test/samples/rm05.csv
===================================================================
--- trunk/stdair/test/samples/rm05.csv (rev 0)
+++ trunk/stdair/test/samples/rm05.csv 2010-08-19 09:52:38 UTC (rev 271)
@@ -0,0 +1,4 @@
+price; mean; standard deviation;
+1000; 20; 5;
+500; 80; 20;
+200; 120; 30;
Added: trunk/stdair/test/samples/rm06.csv
===================================================================
--- trunk/stdair/test/samples/rm06.csv (rev 0)
+++ trunk/stdair/test/samples/rm06.csv 2010-08-19 09:52:38 UTC (rev 271)
@@ -0,0 +1,4 @@
+price; mean; standard deviation;
+1000; 50; 10;
+500; 100; 20;
+200; 200; 30;
Added: trunk/stdair/test/samples/rm07.csv
===================================================================
--- trunk/stdair/test/samples/rm07.csv (rev 0)
+++ trunk/stdair/test/samples/rm07.csv 2010-08-19 09:52:38 UTC (rev 271)
@@ -0,0 +1,4 @@
+price; mean; standard deviation;
+1000; 20; 5;
+500; 80; 20;
+200; 120; 50;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|