forked from eclipse-sumo/sumo
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add platoon-aware lane change model (MSLCM_LC2013_CC)
- Loading branch information
1 parent
3c595bc
commit 395f726
Showing
6 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/****************************************************************************/ | ||
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo | ||
// Copyright (C) 2001-2023 German Aerospace Center (DLR) and others. | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Eclipse Public License 2.0 which is available at | ||
// https://www.eclipse.org/legal/epl-2.0/ | ||
// This Source Code may also be made available under the following Secondary | ||
// Licenses when the conditions for such availability set forth in the Eclipse | ||
// Public License 2.0 are satisfied: GNU General Public License, version 2 | ||
// or later which is available at | ||
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html | ||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later | ||
/****************************************************************************/ | ||
/// @file MSLCM_LC2013.cpp | ||
/// @author Daniel Krajzewicz | ||
/// @author Jakob Erdmann | ||
/// @author Friedemann Wesner | ||
/// @author Sascha Krieg | ||
/// @author Michael Behrisch | ||
/// @author Laura Bieker | ||
/// @author Leonhard Luecken | ||
/// @date Fri, 08.10.2013 | ||
/// | ||
// A lane change model developed by J. Erdmann | ||
// based on the model of D. Krajzewicz developed between 2004 and 2011 (MSLCM_DK2004) | ||
/****************************************************************************/ | ||
#include "MSLCM_LC2013_CC.h" | ||
#include <microsim/cfmodels/MSCFModel_CC.h> | ||
|
||
// =========================================================================== | ||
// member method definitions | ||
// =========================================================================== | ||
MSLCM_LC2013_CC::MSLCM_LC2013_CC(MSVehicle& v) : MSLCM_LC2013(v) {} | ||
|
||
MSLCM_LC2013_CC::~MSLCM_LC2013_CC() {} | ||
|
||
int MSLCM_LC2013_CC::checkChangeBeforeCommitting(const MSVehicle *veh, int state) const { | ||
|
||
if (state & LCA_WANTS_LANECHANGE) { | ||
auto *cfm = dynamic_cast<const MSCFModel_CC *>(&veh->getCarFollowModel()); | ||
|
||
if (cfm) { | ||
bool left = (state & LCA_LEFT) != 0; | ||
return cfm->isPlatoonLaneChangeSafe(veh, left); | ||
} | ||
} | ||
return 0; | ||
} | ||
|
||
/****************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/****************************************************************************/ | ||
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo | ||
// Copyright (C) 2001-2023 German Aerospace Center (DLR) and others. | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Eclipse Public License 2.0 which is available at | ||
// https://www.eclipse.org/legal/epl-2.0/ | ||
// This Source Code may also be made available under the following Secondary | ||
// Licenses when the conditions for such availability set forth in the Eclipse | ||
// Public License 2.0 are satisfied: GNU General Public License, version 2 | ||
// or later which is available at | ||
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html | ||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later | ||
/****************************************************************************/ | ||
/// @file MSLCM_LC2013.h | ||
/// @author Daniel Krajzewicz | ||
/// @author Jakob Erdmann | ||
/// @author Friedemann Wesner | ||
/// @author Sascha Krieg | ||
/// @author Michael Behrisch | ||
/// @date Fri, 08.10.2013 | ||
/// | ||
// A lane change model developed by D. Krajzewicz, J. Erdmann et al. between 2004 and 2013 | ||
/****************************************************************************/ | ||
#pragma once | ||
|
||
#include "MSLCM_LC2013.h" | ||
|
||
// =========================================================================== | ||
// class definitions | ||
// =========================================================================== | ||
/** | ||
* @class MSLCM_LC2013_CC | ||
* @brief A lane change model developed by D. Krajzewicz, J. Erdmann | ||
* et al. between 2004 and 2013, extended for atomic lane change for platoons | ||
*/ | ||
class MSLCM_LC2013_CC : public MSLCM_LC2013 { | ||
public: | ||
|
||
MSLCM_LC2013_CC(MSVehicle& v); | ||
|
||
virtual ~MSLCM_LC2013_CC(); | ||
|
||
/// @brief Returns the model's id | ||
LaneChangeModel getModelID() const override { | ||
return LaneChangeModel::LC2013_CC; | ||
} | ||
|
||
int checkChangeBeforeCommitting(const MSVehicle* veh, int state) const override; | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters