[Refactor/Modelling] Revert changes from group model extension
Problem
A bachelor student worked on the group model a year ago. He introduced several changes in the simulator which overwrites important settings during the simulation. Many of these features are hidden in wrapper methods which makes it quite difficult to understand and extend the code.
Example: In Agent.class
, the free flow speed is overwritten (this.setFreeFlowSpeed(nextSpeed);
) in the method checkNextTarget
.
public void checkNextTarget(double nextSpeed) {
final int nextTargetListIndex = this.getNextTargetListIndex();
// Deprecated target list usage
if (nextTargetListIndex <= -1 && !this.getTargets().isEmpty()) {
this.getTargets().removeFirst();
}
// The right way (later this first check should not be necessary anymore):
if (this.hasNextTarget()) {
this.incrementNextTargetListIndex();
for (AgentListener listener: listeners) {
listener.agentNextTargetSet(nextSpeed, this.getId());
}
}
// set a new desired speed, if possible. you can model street networks with differing
// maximal speeds with this.
if (nextSpeed >= 0) {
this.setFreeFlowSpeed(nextSpeed);
}
}
Most importantly, the changes have never been validated.
Solution
I think we should revert the changes to ensure that our models are still validated.
- Please find all changes made by the bachelor student (use git)
- Revert the changes!
- Add changes to changelog