SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSDevice_HBEFA Class Reference

A device which collects vehicular emissions (using HBEFA-reformulation) More...

#include <MSDevice_HBEFA.h>

Inheritance diagram for MSDevice_HBEFA:
MSDevice MSMoveReminder Named

Public Types

enum  Notification {
  NOTIFICATION_DEPARTED, NOTIFICATION_JUNCTION, NOTIFICATION_SEGMENT, NOTIFICATION_LANE_CHANGE,
  NOTIFICATION_TELEPORT, NOTIFICATION_PARKING, NOTIFICATION_ARRIVED, NOTIFICATION_VAPORIZED,
  NOTIFICATION_TELEPORT_ARRIVED
}
 Definition of a vehicle state. More...

Public Member Functions

void generateOutput () const
 Called on writing tripinfo output.
SUMOVehiclegetHolder () const
 Returns the vehicle that holds this device.
const std::string & getID () const
 Returns the id.
const MSLanegetLane () const
 Returns the lane the reminder works on.
virtual void notifyMoveInternal (SUMOVehicle &veh, SUMOReal timeOnLane, SUMOReal speed)
 Internal notification about the vehicle moves.
void setID (const std::string &newID)
 resets the id
 ~MSDevice_HBEFA ()
 Destructor.
Methods called on vehicle movement / state change, overwriting MSDevice
bool notifyMove (SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
 Computes current emission values and adds them to their sums.
Interface methods, to be derived by subclasses
virtual bool notifyEnter (SUMOVehicle &veh, Notification reason)
 Checks whether the reminder is activated by a vehicle entering the lane.
virtual bool notifyLeave (SUMOVehicle &veh, SUMOReal lastPos, Notification reason)
 Called if the vehicle leaves the reminder's lane.

Static Public Member Functions

static void buildVehicleDevices (SUMOVehicle &v, std::vector< MSDevice * > &into)
 Build devices for the given vehicle, if needed.
static void insertOptions ()
 Inserts MSDevice_HBEFA-options.

Protected Attributes

SUMOVehiclemyHolder
 The vehicle that stores the device.
std::string myID
 The name of the object.
MSLane *const myLane
 Lane on which the reminder works.

Private Member Functions

 MSDevice_HBEFA (SUMOVehicle &holder, const std::string &id)
 Constructor.
 MSDevice_HBEFA (const MSDevice_HBEFA &)
 Invalidated copy constructor.
MSDevice_HBEFAoperator= (const MSDevice_HBEFA &)
 Invalidated assignment operator.

Private Attributes

Internal storages for pollutant/fuel sum in mg or ml
SUMOReal myCO2
SUMOReal myCO
SUMOReal myHC
SUMOReal myPMx
SUMOReal myNOx
SUMOReal myFuel

Detailed Description

A device which collects vehicular emissions (using HBEFA-reformulation)

Each device collects the vehicular emissions / fuel consumption by being called each time step, computing the current values using HelpersHBEFA, and aggregating them into internal storages over the whol journey.

See Also
MSDevice
HelpersHBEFA

Definition at line 63 of file MSDevice_HBEFA.h.

Member Enumeration Documentation

Definition of a vehicle state.

Enumerator:
NOTIFICATION_DEPARTED 

The vehicle has departed (was inserted into the network)

NOTIFICATION_JUNCTION 

The vehicle arrived at a junction.

NOTIFICATION_SEGMENT 

The vehicle changes the segment (meso only)

NOTIFICATION_LANE_CHANGE 

The vehicle changes lanes (micro only)

NOTIFICATION_TELEPORT 

The vehicle is being teleported.

NOTIFICATION_PARKING 

The vehicle starts or ends parking.

NOTIFICATION_ARRIVED 

The vehicle arrived at its destination (is deleted)

NOTIFICATION_VAPORIZED 

The vehicle got vaporized.

NOTIFICATION_TELEPORT_ARRIVED 

The vehicle was teleported out of the net.

Definition at line 93 of file MSMoveReminder.h.

Constructor & Destructor Documentation

MSDevice_HBEFA::~MSDevice_HBEFA ( )

Destructor.

Definition at line 100 of file MSDevice_HBEFA.cpp.

MSDevice_HBEFA::MSDevice_HBEFA ( SUMOVehicle holder,
const std::string &  id 
)
private

Constructor.

Parameters
[in]holderThe vehicle that holds this device
[in]idThe ID of the device

Definition at line 94 of file MSDevice_HBEFA.cpp.

Referenced by buildVehicleDevices().

MSDevice_HBEFA::MSDevice_HBEFA ( const MSDevice_HBEFA )
private

Invalidated copy constructor.

Member Function Documentation

void MSDevice_HBEFA::buildVehicleDevices ( SUMOVehicle v,
std::vector< MSDevice * > &  into 
)
static

Build devices for the given vehicle, if needed.

The options are read and evaluated whether hbefa-devices shall be built for the given vehicle.

For each seen vehicle, the global vehicle index is increased.

The built device is stored in the given vector.

Parameters
[in]vThe vehicle for which a device may be built
in,filled]into The vector to store the built device in

Definition at line 69 of file MSDevice_HBEFA.cpp.

References OptionsCont::getBool(), OptionsCont::getFloat(), SUMOVehicle::getID(), MSNet::getInstance(), OptionsCont::getOptions(), MSNet::getVehicleControl(), MSVehicleControl::isInQuota(), OptionsCont::isInStringVector(), OptionsCont::isSet(), MSDevice_HBEFA(), and RandHelper::rand().

Referenced by MSBaseVehicle::MSBaseVehicle().

void MSDevice_HBEFA::generateOutput ( ) const
virtual

Called on writing tripinfo output.

Parameters
[in]osThe stream to write the information into
Exceptions
IOErrornot yet implemented
See Also
MSDevice::tripInfoOutput

Reimplemented from MSDevice.

Definition at line 119 of file MSDevice_HBEFA.cpp.

References OutputDevice::getDeviceByOption(), myCO, myCO2, myFuel, myHC, myNOx, myPMx, OutputDevice::openTag(), and OutputDevice::realString().

SUMOVehicle& MSDevice::getHolder ( ) const
inlineinherited

Returns the vehicle that holds this device.

Returns
The vehicle that holds this device

Definition at line 85 of file MSDevice.h.

References MSDevice::myHolder.

const std::string& Named::getID ( ) const
inlineinherited

Returns the id.

Returns
The stored id

Reimplemented in MS_E2_ZS_CollectorOverLanes.

Definition at line 61 of file Named.h.

References Named::myID.

Referenced by MSDetectorControl::add(), ShapeContainer::add(), RORouteDef_Alternatives::addAlternative(), MSNet::addBusStop(), NBLoadedSUMOTLDef::addConnection(), NLHandler::addConnection(), NIImporter_OpenDrive::addE2EConnectionsSecure(), RONet::addNode(), NIImporter_SUMO::addPhase(), RONet::addRouteDef(), NBDistrict::addSink(), NBDistrict::addSource(), MSRouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), NIVisumTL::build(), MS_E2_ZS_CollectorOverLanes::buildCollector(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), NBEdge::buildInnerEdges(), NIVissimEdge::buildNBEdge(), NBNodeCont::buildOffRamp(), NBNodeCont::buildOnRamp(), ODDistrictHandler::closeDistrict(), NBTrafficLightDefinition::collectEdges(), NBOwnTLDef::collectLinks(), NBTrafficLightDefinition::compute(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBNode::computeNodeShape(), NBTrafficLightLogicCont::computeSingleLogic(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NBEdge::connections_sorter(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSE3Collector::enter(), Command_SaveTLSSwitches::execute(), MSVTypeProbe::execute(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), MSNet::getBusStopID(), NIImporter_VISUM::getNamedEdgeContinuating(), NLTriggerBuilder::getPosition(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), NBEdgeCont::ignoreFilterMatch(), MSActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NBDistrictCont::insert(), NBTrafficLightLogicCont::insert(), NBNodeCont::insert(), NBEdgeCont::insert(), NBEdgeCont::joinSameNodeConnectingEdges(), MSE3Collector::leave(), NIImporter_OpenDrive::loadNetwork(), MSLane::moveCritical(), MSVehicle::MSVehicle(), RORDLoader_SUMOBase::myCharacters(), NBOwnTLDef::myCompute(), NBLoadedTLDef::myCompute(), NIXMLTrafficLightsHandler::myEndElement(), NIXMLEdgesHandler::myEndElement(), NIImporter_SUMO::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSTriggeredRerouter::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), MSDevice_Tripinfo::notifyEnter(), MSDevice_Tripinfo::notifyLeave(), Named::ComparatorIdLess::operator()(), NBTurningDirectionsComputer::combination_by_angle_sorter::operator()(), NBOwnTLDef::edge_by_incoming_priority_sorter::operator()(), NBNetBuilder::by_id_sorter::operator()(), NBContHelper::same_connection_edge_sorter::operator()(), NBNode::nodes_by_id_sorter::operator()(), NIImporter_VISUM::parse_EdgePolys(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_LanesConnections(), NIImporter_VISUM::parse_Turns(), NIImporter_VISUM::parse_TurnsToSignalGroups(), NIXMLConnectionsHandler::parseDeprecatedLaneDefinition(), NIXMLConnectionsHandler::parseLaneBound(), NBLoadedTLDef::SignalGroup::patchTYellow(), RORouteDef_Complete::preComputeCurrentRoute(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Vehicle::processGet(), NWWriter_SUMO::prohibitionConnection(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBNodeCont::rename(), NBEdgeCont::rename(), NBConnection::replaceFrom(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), MSLane::setCritical(), NIXMLEdgesHandler::setNodes(), NBOwnTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), RORDLoader_SUMOBase::startRoute(), NBEdge::startShapeAt(), NIXMLConnectionsHandler::validateLaneInfo(), MSInstantInductLoop::write(), NWWriter_SUMO::writeConnection(), NWWriter_SUMO::writeDistrict(), NWWriter_SUMO::writeEdge(), MSMeanData::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_SUMO::writeInternalConnections(), NWWriter_SUMO::writeJunction(), NWWriter_OpenDrive::writeNetwork(), NWWriter_XML::writeNodes(), MSInductLoop::writeTypedXMLOutput(), MSRouteProbe::writeXMLOutput(), and MSE2Collector::writeXMLOutput().

void MSDevice_HBEFA::insertOptions ( )
static

Inserts MSDevice_HBEFA-options.

!! describe

!! describe

!! describe

Definition at line 52 of file MSDevice_HBEFA.cpp.

References OptionsCont::addDescription(), OptionsCont::addOptionSubTopic(), OptionsCont::addSynonyme(), OptionsCont::doRegister(), and OptionsCont::getOptions().

Referenced by MSFrame::fillOptions().

virtual bool MSMoveReminder::notifyEnter ( SUMOVehicle veh,
Notification  reason 
)
inlinevirtualinherited

Checks whether the reminder is activated by a vehicle entering the lane.

Lane change means in this case that the vehicle changes to the lane the reminder is placed at.

Parameters
[in]vehThe entering vehicle.
[in]reasonhow the vehicle enters the lane
Returns
True if vehicle enters the reminder.
See Also
Notification

Reimplemented in MSMeanData::MeanDataValueTracker, MSE2Collector, MSInductLoop, MSInstantInductLoop, MSMeanData_Net::MSLaneMeanDataValues, MSDevice_Routing, MSTriggeredRerouter, MSMeanData_Harmonoise::MSLaneMeanDataValues, MSMeanData::MeanDataValues, MSRouteProbe, MSDevice_Person, MSDevice_Tripinfo, and MSDevice_Vehroutes.

Definition at line 128 of file MSMoveReminder.h.

References UNUSED_PARAMETER.

virtual bool MSMoveReminder::notifyLeave ( SUMOVehicle veh,
SUMOReal  lastPos,
Notification  reason 
)
inlinevirtualinherited

Called if the vehicle leaves the reminder's lane.

Informs if vehicle leaves reminder lane (due to lane change, removal from the network, or leaving to the next lane). The default is to do nothing.

Parameters
[in]vehThe leaving vehicle.
[in]lastPosPosition on the lane when leaving.
[in]reasonhow the vehicle leaves the lane
See Also
Notification
Returns
True if the reminder wants to receive further info.

Reimplemented in MSMeanData::MeanDataValueTracker, MSE2Collector, MSInductLoop, MSMeanData::MeanDataValues, MSInstantInductLoop, MSE3Collector::MSE3EntryReminder, MSMeanData_Net::MSLaneMeanDataValues, MSDevice_Person, MSDevice_Tripinfo, and MSDevice_Vehroutes.

Definition at line 173 of file MSMoveReminder.h.

References UNUSED_PARAMETER.

bool MSDevice_HBEFA::notifyMove ( SUMOVehicle veh,
SUMOReal  oldPos,
SUMOReal  newPos,
SUMOReal  newSpeed 
)
virtual

Computes current emission values and adds them to their sums.

The vehicle's current emission values are computed using the current velocity and acceleration.

Parameters
[in]vehThe regarded vehicle
[in]oldPosPosition before the move-micro-timestep.
[in]newPosPosition after the move-micro-timestep.
[in]newSpeedThe vehicle's current speed
Returns
false, if the vehicle is beyond the lane, true otherwise
See Also
MSMoveReminder
MSMoveReminder::notifyMove
HelpersHBEFA

Reimplemented from MSMoveReminder.

Definition at line 105 of file MSDevice_HBEFA.cpp.

References HelpersHBEFA::computeCO(), HelpersHBEFA::computeCO2(), HelpersHBEFA::computeFuel(), HelpersHBEFA::computeHC(), HelpersHBEFA::computeNOx(), HelpersHBEFA::computePMx(), MSVehicleType::getEmissionClass(), SUMOVehicle::getPreDawdleAcceleration(), SUMOVehicle::getVehicleType(), myCO, myCO2, myFuel, myHC, myNOx, myPMx, SUMOReal, and TS.

virtual void MSMoveReminder::notifyMoveInternal ( SUMOVehicle veh,
SUMOReal  timeOnLane,
SUMOReal  speed 
)
inlinevirtualinherited

Internal notification about the vehicle moves.

Indicator if the reminders is still active for the passed vehicle/parameters. If false, the vehicle will erase this reminder from it's reminder-container.

Parameters
[in]vehVehicle that asks this reminder.
[in]timeOnLanetime the vehicle spent on the lane.
[in]speedMoving speed.

Reimplemented in MSMeanData::MeanDataValueTracker, MSMeanData_Net::MSLaneMeanDataValues, MSMeanData_Harmonoise::MSLaneMeanDataValues, and MSMeanData_HBEFA::MSLaneMeanDataValues.

Definition at line 200 of file MSMoveReminder.h.

References UNUSED_PARAMETER.

MSDevice_HBEFA& MSDevice_HBEFA::operator= ( const MSDevice_HBEFA )
private

Invalidated assignment operator.

void Named::setID ( const std::string &  newID)
inlineinherited

resets the id

Definition at line 67 of file Named.h.

References Named::myID.

Referenced by NBNodeCont::rename(), and NBEdgeCont::rename().

Field Documentation

SUMOReal MSDevice_HBEFA::myCO
private

Definition at line 133 of file MSDevice_HBEFA.h.

Referenced by generateOutput(), and notifyMove().

SUMOReal MSDevice_HBEFA::myCO2
private

Definition at line 133 of file MSDevice_HBEFA.h.

Referenced by generateOutput(), and notifyMove().

SUMOReal MSDevice_HBEFA::myFuel
private

Definition at line 133 of file MSDevice_HBEFA.h.

Referenced by generateOutput(), and notifyMove().

SUMOReal MSDevice_HBEFA::myHC
private

Definition at line 133 of file MSDevice_HBEFA.h.

Referenced by generateOutput(), and notifyMove().

MSLane* const MSMoveReminder::myLane
protectedinherited
SUMOReal MSDevice_HBEFA::myNOx
private

Definition at line 133 of file MSDevice_HBEFA.h.

Referenced by generateOutput(), and notifyMove().

SUMOReal MSDevice_HBEFA::myPMx
private

Definition at line 133 of file MSDevice_HBEFA.h.

Referenced by generateOutput(), and notifyMove().


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