Class TrafficManagementCenterUnit
- java.lang.Object
-
- org.eclipse.mosaic.fed.application.ambassador.simulation.AbstractSimulationUnit
-
- org.eclipse.mosaic.fed.application.ambassador.simulation.ServerUnit
-
- org.eclipse.mosaic.fed.application.ambassador.simulation.TrafficManagementCenterUnit
-
- All Implemented Interfaces:
CommunicationModuleOwner
,CellCommunicative
,Routable
,OperatingSystem
,ServerOperatingSystem
,TrafficManagementCenterOperatingSystem
,EventProcessor
public class TrafficManagementCenterUnit extends ServerUnit implements TrafficManagementCenterOperatingSystem
This class represents a Traffic Management Center in the application simulator.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.mosaic.fed.application.app.api.os.TrafficManagementCenterOperatingSystem
TrafficManagementCenterOperatingSystem.ChangeLaneState
-
-
Constructor Summary
Constructors Constructor Description TrafficManagementCenterUnit(TmcMapping applicationTmc)
Constructor forTrafficManagementCenterUnit
, sets operating system and traffic detectors.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TrafficManagementCenterOperatingSystem.ChangeLaneState
changeLaneState(String edge, int laneIndex)
Provides a facility to change the lane state of the given lane.InductionLoop
getInductionLoop(String id)
Returns the lane detector, which provides various measurements, such as traffic flow.Collection<String>
getInductionLoopIds()
Returns the list of mapped induction loop ids.Collection<InductionLoop>
getInductionLoops()
Returns allInductionLoop
s configured for this traffic management center.LaneAreaDetector
getLaneAreaDetector(String id)
Returns the lane segment, which provides various measurements, such as density.Collection<LaneAreaDetector>
getLaneAreaDetectors()
Returns allLaneAreaDetector
s configured for this traffic management center.Collection<String>
getLaneAreaIds()
Returns the list of mapped lane area detector ids.void
processEvent(Event event)
Processes the given event.-
Methods inherited from class org.eclipse.mosaic.fed.application.ambassador.simulation.ServerUnit
assembleCamMessage, getRoutingModule
-
Methods inherited from class org.eclipse.mosaic.fed.application.ambassador.simulation.AbstractSimulationUnit
cleanPastEnvironmentEvents, getAdHocModule, getApplications, getApplicationsIterator, getCellModule, getConfigurationPath, getEventManager, getGroup, getId, getInitialPosition, getOsLog, getSimulationTime, getStateOfEnvironmentSensor, loadApplications, preProcessEvent, processSumoTraciMessage, putEnvironmentEvent, sendInteractionToRti, sendItefLogTuple, sendSumoTraciRequest, setGroup, setUp, tearDown, triggerOnSendMessage
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.mosaic.fed.application.app.api.os.modules.CellCommunicative
getCellModule
-
Methods inherited from interface org.eclipse.mosaic.lib.util.scheduling.EventProcessor
canProcessEvent
-
Methods inherited from interface org.eclipse.mosaic.fed.application.app.api.os.OperatingSystem
getApplications, getApplicationsIterator, getConfigurationPath, getEventManager, getGroup, getId, getSimulationTime, getSimulationTimeMs, getStateOfEnvironmentSensor, sendInteractionToRti, sendItefLogTuple, sendSumoTraciRequest
-
Methods inherited from interface org.eclipse.mosaic.fed.application.app.api.os.modules.Routable
getRoutingModule
-
-
-
-
Constructor Detail
-
TrafficManagementCenterUnit
public TrafficManagementCenterUnit(TmcMapping applicationTmc)
Constructor forTrafficManagementCenterUnit
, sets operating system and traffic detectors.- Parameters:
applicationTmc
- the configuration of the tmc including traffic detectors
-
-
Method Detail
-
getInductionLoopIds
public Collection<String> getInductionLoopIds()
Returns the list of mapped induction loop ids.- Returns:
- The list of mapped induction loop ids.
-
getLaneAreaIds
public Collection<String> getLaneAreaIds()
Returns the list of mapped lane area detector ids.- Returns:
- The list of mapped lane area detector ids.
-
getInductionLoop
public InductionLoop getInductionLoop(String id)
Description copied from interface:TrafficManagementCenterOperatingSystem
Returns the lane detector, which provides various measurements, such as traffic flow.- Specified by:
getInductionLoop
in interfaceTrafficManagementCenterOperatingSystem
- Parameters:
id
- The id of the lane detector- Returns:
- The
InductionLoop
with the given id.
-
getLaneAreaDetector
public LaneAreaDetector getLaneAreaDetector(String id)
Description copied from interface:TrafficManagementCenterOperatingSystem
Returns the lane segment, which provides various measurements, such as density.- Specified by:
getLaneAreaDetector
in interfaceTrafficManagementCenterOperatingSystem
- Parameters:
id
- The id of the lane segment.- Returns:
- The
LaneAreaDetector
with the given id.
-
getInductionLoops
public Collection<InductionLoop> getInductionLoops()
Description copied from interface:TrafficManagementCenterOperatingSystem
Returns allInductionLoop
s configured for this traffic management center.- Specified by:
getInductionLoops
in interfaceTrafficManagementCenterOperatingSystem
- Returns:
- A list of all configured
InductionLoop
s.
-
getLaneAreaDetectors
public Collection<LaneAreaDetector> getLaneAreaDetectors()
Description copied from interface:TrafficManagementCenterOperatingSystem
Returns allLaneAreaDetector
s configured for this traffic management center.- Specified by:
getLaneAreaDetectors
in interfaceTrafficManagementCenterOperatingSystem
- Returns:
- A list of all configured
LaneAreaDetector
s.
-
changeLaneState
public TrafficManagementCenterOperatingSystem.ChangeLaneState changeLaneState(String edge, int laneIndex)
Description copied from interface:TrafficManagementCenterOperatingSystem
Provides a facility to change the lane state of the given lane.- Specified by:
changeLaneState
in interfaceTrafficManagementCenterOperatingSystem
- Parameters:
edge
- The ID of the edge.laneIndex
- The index of the lane (0 = right-most lane).
-
processEvent
public void processEvent(Event event) throws Exception
Description copied from interface:EventProcessor
Processes the given event.- Specified by:
processEvent
in interfaceEventProcessor
- Overrides:
processEvent
in classServerUnit
- Parameters:
event
- the event to process- Throws:
Exception
-
-