NMPB08 Shared Libraries
Classes | Defines | Typedefs | Enumerations | Functions | Variables
RailwayEmissionNMPB08.h File Reference

Go to the source code of this file.

Classes

struct  RailwayEquivalentSource
 elementary emission data represents apparent sound power for an equivalent line source emitted in a given direction More...
struct  RailwayEmission
 the emission associated with a railway traffic is represented as a set of elementary point sources with associated sound power and directivity More...
struct  RailwayTrafficComponent
 a single railway traffic component. Each component is defined as a number of units (or trains) of a given type that ciruclate at the same speed on the same track, the same speed. A complete traffic may be composed of one or more components. More...
struct  RailwayTraffic
struct  ScreenBodyInteraction
struct  RailwayEntity
 structure used for enumerating the contents of the database More...
struct  RailwayElementarySource
 structure used for enumerating the equivalent acoustical sources associated with a train or a unit More...

Defines

#define _COMPILE_NMPB   extern "C"
 compiler specific options for creating shared libraries

Typedefs

typedef double NMPB_RailCorrectionType
 correction for rail and mounting conditions as specified in the document "Production des cartes strategiques des grands axes routiers et ferrovaires", published by SETRA, August 2007.

Note that the following values are indicative and not integral part of the method.


typedef bool(* EnumRailwayEntities )(RailwayEntity const &info, void *userdata)
 user defined callback function for enumerating the contents of the database
typedef bool(* EnumRailwaySources )(RailwayElementarySource const &info, void *userdata)
 user defined callback function for enumerating the equivalent acoustical sources associated with a train or a unit

Enumerations

enum  NPMP08_RailwayEmission_Error {
  ERROR_XML_PARSER = 1, ERROR_XML_SCHEMA = 2, ERROR_OPEN_FILE = 3, ERROR_INVALID_ID = 4,
  ERROR_INVALID_HEIGHT = 5, ERROR_XML_PARSER = 1, ERROR_XML_SCHEMA = 2, ERROR_OPEN_FILE = 3,
  ERROR_INVALID_ID = 4, ERROR_INVALID_HEIGHT = 5, ERROR_XML_PARSER = 1, ERROR_XML_SCHEMA = 2,
  ERROR_OPEN_FILE = 3, ERROR_INVALID_ID = 4, ERROR_INVALID_HEIGHT = 5
}
 error types returned from the NMPB08_Railway software library More...
enum  NMPB_RailwayEmission_HorizontalDirectivity {
  HDIR_OMNI = 0, HDIR_NMPB = 1, HDIR_OMNI = 0, HDIR_NMPB = 1,
  HDIR_OMNI = 0, HDIR_NMPB = 1
}
 predefined horizontal directivity models More...
enum  NMPB_RailwayEmission_VerticalDirectivity {
  VDIR_OMNI = 0, VDIR_NMPB = 1, VDIR_HEMI = 2, VDIR_OMNI = 0,
  VDIR_NMPB = 1, VDIR_HEMI = 2, VDIR_OMNI = 0, VDIR_NMPB = 1,
  VDIR_HEMI = 2
}
 predefined vertical directivity models More...
enum  NMPB_RailwayEmission_Options {
  OPTION_TRACE_DEBUG = 1, OPTION_NO_DIRECTIVITY = 2, OPTION_MODIFY_HEIGHTS = 4, OPTION_DEYGOUT_DIFFRACTION = 8,
  OPTION_TRACE_DEBUG = 1, OPTION_NO_DIRECTIVITY = 2, OPTION_MODIFY_HEIGHTS = 4, OPTION_DEYGOUT_DIFFRACTION = 8,
  OPTION_TRACE_DEBUG = 1, OPTION_NO_DIRECTIVITY = 2, OPTION_MODIFY_HEIGHTS = 4, OPTION_DEYGOUT_DIFFRACTION = 8
}
 options that modify the behaviour of the calculation model More...
enum  NMPB_RailwayEmission_Entities {
  ENTITY_UNIT = 1, ENTITY_TRAIN = 2, ENTITY_PARTIAL = 4, ENTITY_TRAFFIC = ENTITY_TRAIN | ENTITY_UNIT,
  ENTITY_ALL = ENTITY_TRAIN | ENTITY_UNIT | ENTITY_PARTIAL, ENTITY_UNIT = 1, ENTITY_TRAIN = 2, ENTITY_PARTIAL = 4,
  ENTITY_TRAFFIC = ENTITY_TRAIN | ENTITY_UNIT, ENTITY_ALL = ENTITY_TRAIN | ENTITY_UNIT | ENTITY_PARTIAL, ENTITY_UNIT = 1, ENTITY_TRAIN = 2,
  ENTITY_PARTIAL = 4, ENTITY_TRAFFIC = ENTITY_TRAIN | ENTITY_UNIT, ENTITY_ALL = ENTITY_TRAIN | ENTITY_UNIT | ENTITY_PARTIAL
}
 constants used for enumerating the contents of the database More...

Functions

_COMPILE_NMPB int NMPB08_LoadRailwayDatabase (const char *filename, bool log_stdout=false)
 loads the train database from an external file
_COMPILE_NMPB int NMPB08_DumpRailwayDatabase (const char *filename=0)
 writes the contents of the database to a file
_COMPILE_NMPB int NMPB08_EnumRailwayDatabase (EnumRailwayEntities enumProc, unsigned int include_types=ENTITY_TRAFFIC, void *userdata=0)
 enumerate the contents of the database
_COMPILE_NMPB void * NMPB08_CreateRailwayTraffic (double nb_hours)
 create a context for converting railway traffic into an equivalent source model
_COMPILE_NMPB int NMPB08_ClearRailwayTraffic (void *id)
 empties the traffic associated with the source model
_COMPILE_NMPB int NMPB08_AddRailwayTraffic (void *id, const char *unit_or_train, double number, double speed)
 adds a traffic component to the source model
_COMPILE_NMPB unsigned int NMPB08_SetRailwayOptions (void *id, unsigned int option, bool on_off)
 enables or disables selected options
_COMPILE_NMPB unsigned int NMPB08_GetRailwayOptions (void *id, unsigned int option)
 return the currently selected options
_COMPILE_NMPB unsigned int NMPB08_SetRailCorrection (void *id, NMPB_RailCorrectionType corr)
 set the rail correction
_COMPILE_NMPB
NMPB_RailCorrectionType 
NMPB08_GetRailCorrection (void *id)
 returns the current value of rail correction
_COMPILE_NMPB RailwayEmission
const * 
NMPB08_GetRailwayEmission (void *id, ScreenBodyInteraction *screenBodyInteraction=0)
 returns the equivalent source model for the current traffic state
_COMPILE_NMPB int NMPB08_SetRailwayEmissionAngles (void *id, double sin_h, double sin_v)
 sets de emission angles for the equivalent source model
_COMPILE_NMPB int NMPB08_DeleteRailwayTraffic (void *id)
 destroys the internal data structure used for converting railway traffic data into an equivalent source model.
_COMPILE_NMPB int NMPB08_EnumRailwaySources (EnumRailwaySources enumProc, const char *name, void *userdata)
 enumerate the equivalent acoustical sources associated with a train or unit

Variables

const NMPB_RailCorrectionType RAIL_LONG_TRAVERSES_BETON = 0.0
const NMPB_RailCorrectionType RAIL_LONG_TRAVERSES_AUTRE = 3.0
const NMPB_RailCorrectionType RAIL_COURT_TRAVERSES_BETON = 3.0
const NMPB_RailCorrectionType RAIL_COURT_TRAVERSES_AUTRE = 6.0
const NMPB_RailCorrectionType RAIL_ZONE_APPAREILS_VOIE = 6.0

Define Documentation

#define _COMPILE_NMPB   extern "C"

compiler specific options for creating shared libraries

Definition at line 54 of file RailwayEmissionNMPB08.h.


Typedef Documentation

typedef bool(* EnumRailwayEntities)(RailwayEntity const &info, void *userdata)

user defined callback function for enumerating the contents of the database

Definition at line 269 of file RailwayEmissionNMPB08.h.

typedef bool(* EnumRailwaySources)(RailwayElementarySource const &info, void *userdata)

user defined callback function for enumerating the equivalent acoustical sources associated with a train or a unit

Definition at line 447 of file RailwayEmissionNMPB08.h.

typedef double NMPB_RailCorrectionType

correction for rail and mounting conditions as specified in the document "Production des cartes strategiques des grands axes routiers et ferrovaires", published by SETRA, August 2007.

Note that the following values are indicative and not integral part of the method.

  • RAIL_LONG_TRAVERSES_BETON = 0 dB(A)
  • RAIL_LONG_TRAVERSES_AUTRE = 3 dB(A)
  • RAIL_COURT_TRAVERSES_BETON = 3 dB(A)
  • RAIL_COURT_TRAVERSES_AUTRE = 6 dB(A)

    The end user may supply other values, e.g. for points and metal bridges

Definition at line 126 of file RailwayEmissionNMPB08.h.


Enumeration Type Documentation

constants used for enumerating the contents of the database

Enumerator:
ENTITY_UNIT 

unit

ENTITY_TRAIN 

train

ENTITY_PARTIAL 

unit, only to be used as part of a train

ENTITY_TRAFFIC 

traffic units only

ENTITY_ALL 

all units and trains

ENTITY_UNIT 

unit

ENTITY_TRAIN 

train

ENTITY_PARTIAL 

unit, only to be used as part of a train

ENTITY_TRAFFIC 

traffic units only

ENTITY_ALL 

all units and trains

ENTITY_UNIT 

unit

ENTITY_TRAIN 

train

ENTITY_PARTIAL 

unit, only to be used as part of a train

ENTITY_TRAFFIC 

traffic units only

ENTITY_ALL 

all units and trains

Definition at line 242 of file RailwayEmissionNMPB08.h.

predefined horizontal directivity models

Enumerator:
HDIR_OMNI 

omnidirectionnel

HDIR_NMPB 

horizontal directivity as defined in NF S31-133

HDIR_OMNI 

omnidirectionnel

HDIR_NMPB 

horizontal directivity as defined in NF S31-133

HDIR_OMNI 

omnidirectionnel

HDIR_NMPB 

horizontal directivity as defined in NF S31-133

Definition at line 75 of file RailwayEmissionNMPB08.h.

options that modify the behaviour of the calculation model

Note:
OPTION_NO_DIRECTIVITY is useful if the directivity of the railway sources is integrated as part of the propagation model
OPTION_MODIFY_HEIGHTS is useful to adjust databases for different propagation models, i.e. when source heights in the database do not match those of the emission model
Enumerator:
OPTION_TRACE_DEBUG 

trace intermediate results to stdout

OPTION_NO_DIRECTIVITY 

do not include directivity

OPTION_MODIFY_HEIGHTS 

distribute sound powers over source heights

OPTION_DEYGOUT_DIFFRACTION 

use Deygout approximation for body/barrier interaction

OPTION_TRACE_DEBUG 

trace intermediate results to stdout

OPTION_NO_DIRECTIVITY 

do not include directivity

OPTION_MODIFY_HEIGHTS 

distribute sound powers over source heights

OPTION_DEYGOUT_DIFFRACTION 

use Deygout approximation for body/barrier interaction

OPTION_TRACE_DEBUG 

trace intermediate results to stdout

OPTION_NO_DIRECTIVITY 

do not include directivity

OPTION_MODIFY_HEIGHTS 

distribute sound powers over source heights

OPTION_DEYGOUT_DIFFRACTION 

use Deygout approximation for body/barrier interaction

Definition at line 103 of file RailwayEmissionNMPB08.h.

predefined vertical directivity models

Enumerator:
VDIR_OMNI 

omnidirectional

VDIR_NMPB 

vertical directivity as defined in NF S31-133

VDIR_HEMI 

hemispheric emission upwards

VDIR_OMNI 

omnidirectional

VDIR_NMPB 

vertical directivity as defined in NF S31-133

VDIR_HEMI 

hemispheric emission upwards

VDIR_OMNI 

omnidirectional

VDIR_NMPB 

vertical directivity as defined in NF S31-133

VDIR_HEMI 

hemispheric emission upwards

Definition at line 85 of file RailwayEmissionNMPB08.h.

error types returned from the NMPB08_Railway software library

Enumerator:
ERROR_XML_PARSER 

file could not be openened or parsed

ERROR_XML_SCHEMA 

incompatible XML file

ERROR_OPEN_FILE 

file could not be openened

ERROR_INVALID_ID 

identifier not defined in database

ERROR_INVALID_HEIGHT 

source height not supported in emission model

ERROR_XML_PARSER 

file could not be openened or parsed

ERROR_XML_SCHEMA 

incompatible XML file

ERROR_OPEN_FILE 

file could not be openened

ERROR_INVALID_ID 

identifier not defined in database

ERROR_INVALID_HEIGHT 

source height not supported in emission model

ERROR_XML_PARSER 

file could not be openened or parsed

ERROR_XML_SCHEMA 

incompatible XML file

ERROR_OPEN_FILE 

file could not be openened

ERROR_INVALID_ID 

identifier not defined in database

ERROR_INVALID_HEIGHT 

source height not supported in emission model

Definition at line 62 of file RailwayEmissionNMPB08.h.


Function Documentation

_COMPILE_NMPB int NMPB08_AddRailwayTraffic ( void *  id,
const char *  unit_or_train,
double  number,
double  speed 
)

adds a traffic component to the source model

Parameters:
idhandle to the internal structure used by the traffic model
unit_or_trainidentification of the type of unit or train
numbernumber of units or trains passing during the reference period
speedspeed in km/h
Returns:
O if sucessful, an error code otherwise

Definition at line 681 of file RailwayEmission.cpp.

_COMPILE_NMPB int NMPB08_ClearRailwayTraffic ( void *  id)

empties the traffic associated with the source model

Parameters:
idhandle to the internal structure used by the traffic model
Returns:
O if sucessful, an error code otherwise

Definition at line 670 of file RailwayEmission.cpp.

_COMPILE_NMPB void* NMPB08_CreateRailwayTraffic ( double  nb_hours)

create a context for converting railway traffic into an equivalent source model

Parameters:
nb_hoursduration of the period of reference in hours
Returns:
a handle to an internal structure to be uses in consecutive calls to other function inside the library, a NULL pointer if error occured

Definition at line 659 of file RailwayEmission.cpp.

_COMPILE_NMPB int NMPB08_DeleteRailwayTraffic ( void *  id)

destroys the internal data structure used for converting railway traffic data into an equivalent source model.

Parameters:
idhandle to an internal data structure as returned by /ref NMPB08_CreateRailwayTraffic.
Returns:
0 if successful, an error code otherwise.

Definition at line 703 of file RailwayEmission.cpp.

_COMPILE_NMPB int NMPB08_DumpRailwayDatabase ( const char *  filename = 0)

writes the contents of the database to a file

Parameters:
filenamethe name of the output file in case the filename is a zero pointer or a zero length string, the output will be written to stdout
Returns:
0 if successful, otherwise an error code

Definition at line 16 of file RailwayDatabase.cpp.

_COMPILE_NMPB int NMPB08_EnumRailwayDatabase ( EnumRailwayEntities  enumProc,
unsigned int  include_types = ENTITY_TRAFFIC,
void *  userdata = 0 
)

enumerate the contents of the database

Parameters:
enumProcuser defined callback function
include_typestype of database entries to be enumerated
userdatauser defined data to be passed to the callback function

Definition at line 21 of file RailwayDatabase.cpp.

_COMPILE_NMPB int NMPB08_EnumRailwaySources ( EnumRailwaySources  enumProc,
const char *  name,
void *  userdata 
)

enumerate the equivalent acoustical sources associated with a train or unit

Parameters:
enumProcuser defined callback function
nameidentification a train or unit
userdatauser defined data to be passed to the callback function

Definition at line 28 of file RailwayDatabase.cpp.

_COMPILE_NMPB NMPB_RailCorrectionType NMPB08_GetRailCorrection ( void *  id)

returns the current value of rail correction

Parameters:
idhandle to the internal structure used by the traffic model
Returns:
the current value of the rail correction
_COMPILE_NMPB RailwayEmission const* NMPB08_GetRailwayEmission ( void *  id,
ScreenBodyInteraction screenBodyInteraction = 0 
)

returns the equivalent source model for the current traffic state

Parameters:
idhandle to the internal structure used by the traffic model
screenBodyInteractionconfiguration of interaction between the train body and a nearby screen One interaction corresponds to a double reflection, once on the barrier, once on the car body. The equivalent reflection coefficient of the car bodies is encoded in the database and will modify the equivalent sound power of the image sources created through reflection. Absorption on the inner side of the barrier is also taken into account (see NF S 31-133, section 7.4.6).
Returns:
a pointer to the equivalent source model, a null pointer in case an invalid source height has been detected in the selected trains and units
Note:
if OPTION_H_INTERPOLATE is set, sources heights defined in the database will be automatically adapted to the 3 sources heights defined in the NMPB model. This is achieved by distributing the acoustical power over the predefined source heights proportional to the difference in height

Definition at line 692 of file RailwayEmission.cpp.

_COMPILE_NMPB unsigned int NMPB08_GetRailwayOptions ( void *  id,
unsigned int  option 
)

return the currently selected options

Parameters:
idhandle to the internal structure used by the traffic model
optionoptions to be reported
Returns:
the selected set of options

Definition at line 726 of file RailwayEmission.cpp.

_COMPILE_NMPB int NMPB08_LoadRailwayDatabase ( const char *  filename,
bool  log_stdout = false 
)

loads the train database from an external file

Parameters:
filenamename of the external file
log_stdoutif true, prints messages to stdout
Returns:
0 if successful, otherwise an error code

Definition at line 11 of file RailwayDatabase.cpp.

_COMPILE_NMPB unsigned int NMPB08_SetRailCorrection ( void *  id,
NMPB_RailCorrectionType  corr 
)

set the rail correction

Parameters:
idhandle to the internal structure used by the traffic model
corrnew correction for the rail / mounting condition
Returns:
O if sucessful, an error code otherwise

Definition at line 748 of file RailwayEmission.cpp.

_COMPILE_NMPB int NMPB08_SetRailwayEmissionAngles ( void *  id,
double  sin_h,
double  sin_v 
)

sets de emission angles for the equivalent source model

Parameters:
idhandle to the internal structure used by the traffic model
sin_hsinus of the angle of the propagation direction with the vertical plane perpendicular to the track
sin_vsinus of the angle of the propagation direction with the horizontal plane containing the track
Returns:
0 if successful, an error code otherwise
Note:
if the OPTION_NO_DIRECIVITY is set, this function has no effect on the reported equivalent source model

Definition at line 737 of file RailwayEmission.cpp.

_COMPILE_NMPB unsigned int NMPB08_SetRailwayOptions ( void *  id,
unsigned int  option,
bool  on_off 
)

enables or disables selected options

Parameters:
idhandle to the internal structure used by the traffic model
optionoptions to be set or cleared
on_offif true, options will be set, otherwise options will be cleared
Returns:
the modified set of options

Definition at line 715 of file RailwayEmission.cpp.


Variable Documentation

Definition at line 131 of file RailwayEmissionNMPB08.h.

Definition at line 130 of file RailwayEmissionNMPB08.h.

Definition at line 129 of file RailwayEmissionNMPB08.h.

Definition at line 128 of file RailwayEmissionNMPB08.h.

Definition at line 132 of file RailwayEmissionNMPB08.h.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines