Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MELSegment.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2026 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// A LIFT-model segment
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include <deque>
24#include "MESegment.h"
25
26
27// ===========================================================================
28// class declarations
29// ===========================================================================
30
31// ===========================================================================
32// class definitions
33// ===========================================================================
38class MELSegment : public MESegment {
39public:
40
41
42public:
53 MELSegment(const std::string& id,
54 const MSEdge& parent, MESegment* next,
55 const double length, const double speed,
56 const int idx,
57 const bool multiQueue,
58 const MesoEdgeType& edgeType);
59
67 void send(MEVehicle* veh, MESegment* const next, const int nextQIdx, SUMOTime time, const MSMoveReminder::Notification reason) override;
68
70 void updateEntryBlockTime(SUMOTime time) override;
71
72protected:
74 void updateBlockTime(Queue& q, const Queue& qNext, const MESegment* const next, const MEVehicle* veh) override;
75
77 bool hasSpaceForInsertion(const Queue& q, int qIdx, double newOccupancy, SUMOTime entryTime) const override;
78
79private:
81 // @note: could be slightly faster as a double-index ring-buffer
82 typedef std::vector<SUMOTime> GapTimes;
83 std::vector<GapTimes> myGapTimes;
84
85private:
88
91
93 MELSegment(const std::string& id);
94};
long long int SUMOTime
Definition GUI.h:36
A single mesoscopic segment (cell)
Definition MELSegment.h:38
void updateBlockTime(Queue &q, const Queue &qNext, const MESegment *const next, const MEVehicle *veh) override
update blockTime of Queue q
void send(MEVehicle *veh, MESegment *const next, const int nextQIdx, SUMOTime time, const MSMoveReminder::Notification reason) override
Removes the vehicle from the segment, adapting its parameters.
MELSegment(const std::string &id)
constructor for dummy segment
void updateEntryBlockTime(SUMOTime time) override
update entry blockTime for all queues
bool hasSpaceForInsertion(const Queue &q, int qIdx, double newOccupancy, SUMOTime entryTime) const override
check jam-avoidance constraints during insertion
std::vector< GapTimes > myGapTimes
Definition MELSegment.h:83
MELSegment(const MELSegment &)
Invalidated copy constructor.
MELSegment & operator=(const MELSegment &)
Invalidated assignment operator.
std::vector< SUMOTime > GapTimes
upstream arrival times of traveling gaps between cars (for each queue)
Definition MELSegment.h:82
A single mesoscopic segment (cell)
Definition MESegment.h:50
A vehicle from the mesoscopic point of view.
Definition MEVehicle.h:42
A road/street connecting two junctions.
Definition MSEdge.h:77
Notification
Definition of a vehicle state.
edge type specific meso parameters
Definition MESegment.h:58