Interface PerceivableContext
- All Superinterfaces:
 Definitions,Identifiable
- All Known Implementing Classes:
 ExpansionNetwork,OTSNetwork
public interface PerceivableContext extends Definitions, Identifiable
The Model package guarantees that objects that are used in an OTS study such as GTUs are retrievable. In a spatial model, for
 instance, objects need to be able to find each other. The model interface guarantees access to a number of important objects
 in the study.
 
 Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. 
 BSD-style license. See OpenTrafficSim License.
 
- Author:
 - Alexander Verbraeck, Peter Knoppers
 
- 
Method Summary
Modifier and Type Method Description voidaddGTU(GTU gtu)Add a GTU to the network.booleancontainsGTU(GTU gtu)Test whether a GTU is registered in the network.booleancontainsGtuId(java.lang.String gtuId)Test whether a GTU ID is registered in the network.GTUgetGTU(java.lang.String gtuId)Get a GTU in the model.java.util.Set<GTU>getGTUs()Get an overview of the GTUs in the model.java.lang.StringgetId()Get a descriptive Id of the perceivable context (e.g., useful for debugging purposes).voidremoveGTU(GTU gtu)Remove a GTU from the network.Methods inherited from interface org.opentrafficsim.core.definitions.Definitions
addDefaultGtuTypes, addDefaultLinkTypes, addGtuType, addLinkType, getGtuType, getGtuType, getGtuTypes, getLinkType, getLinkType, getLinkTypes 
- 
Method Details
- 
getId
java.lang.String getId()Get a descriptive Id of the perceivable context (e.g., useful for debugging purposes).- Specified by:
 getIdin interfaceIdentifiable- Returns:
 - the id of the context
 
 - 
getGTUs
java.util.Set<GTU> getGTUs()Get an overview of the GTUs in the model. The set returned is a defensive copy.- Returns:
 - a set of GTUs as registered in the current model.
 
 - 
getGTU
Get a GTU in the model.- Parameters:
 gtuId- String; the id of the GTU- Returns:
 - a GTU as registered in the current model, or null when the id could not be found.
 
 - 
addGTU
Add a GTU to the network.- Parameters:
 gtu- GTU; the GTU to add
 - 
removeGTU
Remove a GTU from the network.- Parameters:
 gtu- GTU; the GTU to remove
 - 
containsGTU
Test whether a GTU is registered in the network.- Parameters:
 gtu- GTU; the GTU to search for- Returns:
 - whether the network contains this GTU
 
 - 
containsGtuId
boolean containsGtuId(java.lang.String gtuId)Test whether a GTU ID is registered in the network.- Parameters:
 gtuId- String; the GTU ID to search for- Returns:
 - whether the network contains a GTU with this ID
 
 
 -