21 package org.matsim.withinday.replanning.identifiers.tools;
23 import java.util.Collections;
24 import java.util.HashSet;
25 import java.util.Map.Entry;
28 import jakarta.inject.Inject;
30 import org.apache.logging.log4j.LogManager;
31 import org.apache.logging.log4j.Logger;
80 EXACT, RESTRICTED, UNRESTRICTED
90 log.info(
"Note that the LinkReplanningMap has to be registered as an EventHandler and a SimulationListener!");
93 this.legJustStartedAgents =
new HashSet<Id<Person>>();
98 this.legJustStartedAgents.remove(event.
getPersonId());
104 this.legJustStartedAgents.add(event.
getPersonId());
109 this.legJustStartedAgents.remove(event.
getPersonId());
122 if (time > currentTime) {
123 this.currentTime = time;
124 this.legJustStartedAgents.clear();
131 this.legJustStartedAgents.clear();
141 if (
set != null)
return Collections.unmodifiableSet(
set);
142 else return new HashSet<>();
163 Set<Id<Person>>
set =
new HashSet<>();
172 if (time <= earliestLinkExitTime.
seconds())
continue;
174 if (time > earliestLinkExitTime.
seconds())
continue;
176 throw new RuntimeException(
"Unexpected TimeFilterMode was found: " + timeMode.toString());
180 set.addAll(entry.getValue());
199 return Collections.unmodifiableSet(this.legJustStartedAgents);
Set< Id< Person > > getEarliestLinkExitTimesPerTimeStep(double time)
Id< Person > getPersonId()
Map< Id< Person >, OptionalTime > getEarliestLinkExitTimes()
void addHandler(final EventHandler handler)
Id< Person > getPersonId()
Id< Person > getPersonId()
double getSimulationTime()