Package core
Class Scenario
- java.lang.Object
-
- core.Scenario
-
public class Scenario extends Object
Methods for extracting information and manipulating the scenario. This is the main class of the simulation. It contains references to all of the components of the simulation. Scenario elements can be retrieved from maps using their ids. Each scenario element has its own API. You should only interact with the scenario elements through the docuemented API. There are additional public methods, but these should not be used if they are not part of the documented API.
-
-
Field Summary
Fields Modifier and Type Field Description Map<Long,AbstractActuator>
actuators
Map of actuatorsMap<Long,Commodity>
commodities
Map of commoditiesMap<Long,AbstractController>
controllers
Map of controllersMap<Long,Set<DemandInfo>>
demands
Map of demandsdispatch.Dispatcher
dispatcher
Map<Long,AbstractScenarioEvent>
events
Map of eventsMap<String,AbstractModel>
models
Map of modelsNetwork
network
Container for the networkSet<AbstractOutput>
outputs
traveltime.LinkTravelTimeManager
path_tt_manager
Map<Long,AbstractSensor>
sensors
Map of sensorsMap<Long,Subnetwork>
subnetworks
Map of subnetworks
-
Constructor Summary
Constructors Constructor Description Scenario()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<Long>
actuator_ids()
Get actuator idsvoid
add_path_travel_time(output.OutputPathTravelTime path_tt_writer)
long
add_subnetwork(String name, Set<Long> linkids, Set<Long> comm_ids)
Set<Long>
commodity_ids()
Get commodity idsCollection<Long>
controller_ids()
Get controller idsAbstractActuator
get_actuator(long id)
Get actuator by idMap<Long,AbstractActuator>
get_actuators()
Get map of actuatorsoutput.animation.AnimationInfo
get_animation_info()
Undocumentedoutput.animation.AnimationInfo
get_animation_info(List<Long> link_ids)
Map<Long,Commodity>
get_commodities()
Get map of commoditiesCommodity
get_commodity(long id)
Get commodity by idAbstractController
get_controller(long id)
Get controller by idMap<Long,AbstractController>
get_controllers()
Get map of controllersMap<Long,Set<DemandInfo>>
get_demands()
Get map of demandsSet<profiles.Profile1D>
get_demands_for_commodity(Long commodity_id)
Extract all of the demands for a given commodity.Set<profiles.Profile1D>
get_demands_for_link(Long link_id)
Extract all of the demands for a given link.core.InterfaceScenarioElement
get_element(core.ScenarioElementType type, Long id)
Get a scenario element by type and idMap<Long,AbstractScenarioEvent>
get_events()
Get map of eventsAbstractModel
get_model(long id)
Get model by idMap<String,AbstractModel>
get_models()
Get map of modelsNetwork
get_network()
Get networkAbstractSensor
get_sensor(long id)
Get sensor by idMap<Long,AbstractSensor>
get_sensors()
Get map of sensorsSubnetwork
get_subnetwork(long id)
Get subnetwork by idMap<Long,Subnetwork>
get_subnetworks()
Get map of subnetworksdouble
get_total_trips()
Integrate the demands to obtain the total number of trips that will take place.Set<Long>
path_ids()
Get ids of subnetworks that are pathsCollection<Long>
sensor_ids()
Get sensor idsvoid
set_model(jaxb.Model jmodel)
Assign a model to a set of links.Set<Long>
subnetwork_ids()
Get subnetwork idsjaxb.Scenario
to_jaxb()
Create a jaxb object for this scenario
-
-
-
Field Detail
-
dispatcher
public dispatch.Dispatcher dispatcher
-
outputs
public Set<AbstractOutput> outputs
-
network
public Network network
Container for the network
-
models
public Map<String,AbstractModel> models
Map of models
-
subnetworks
public Map<Long,Subnetwork> subnetworks
Map of subnetworks
-
controllers
public Map<Long,AbstractController> controllers
Map of controllers
-
actuators
public Map<Long,AbstractActuator> actuators
Map of actuators
-
sensors
public Map<Long,AbstractSensor> sensors
Map of sensors
-
demands
public Map<Long,Set<DemandInfo>> demands
Map of demands
-
events
public Map<Long,AbstractScenarioEvent> events
Map of events
-
path_tt_manager
public traveltime.LinkTravelTimeManager path_tt_manager
-
-
Method Detail
-
to_jaxb
public jaxb.Scenario to_jaxb()
Create a jaxb object for this scenario
-
add_path_travel_time
public void add_path_travel_time(output.OutputPathTravelTime path_tt_writer) throws error.OTMException
- Throws:
error.OTMException
-
get_element
public core.InterfaceScenarioElement get_element(core.ScenarioElementType type, Long id)
Get a scenario element by type and id
-
get_network
public Network get_network()
Get network
-
get_models
public Map<String,AbstractModel> get_models()
Get map of models
-
get_subnetworks
public Map<Long,Subnetwork> get_subnetworks()
Get map of subnetworks
-
get_controllers
public Map<Long,AbstractController> get_controllers()
Get map of controllers
-
get_actuators
public Map<Long,AbstractActuator> get_actuators()
Get map of actuators
-
get_sensors
public Map<Long,AbstractSensor> get_sensors()
Get map of sensors
-
get_demands
public Map<Long,Set<DemandInfo>> get_demands()
Get map of demands
-
get_events
public Map<Long,AbstractScenarioEvent> get_events()
Get map of events
-
actuator_ids
public Collection<Long> actuator_ids()
Get actuator ids
-
sensor_ids
public Collection<Long> sensor_ids()
Get sensor ids
-
controller_ids
public Collection<Long> controller_ids()
Get controller ids
-
get_model
public AbstractModel get_model(long id) throws error.OTMException
Get model by id- Throws:
error.OTMException
-
get_commodity
public Commodity get_commodity(long id) throws error.OTMException
Get commodity by id- Throws:
error.OTMException
-
get_subnetwork
public Subnetwork get_subnetwork(long id) throws error.OTMException
Get subnetwork by id- Throws:
error.OTMException
-
get_actuator
public AbstractActuator get_actuator(long id) throws error.OTMException
Get actuator by id- Throws:
error.OTMException
-
get_sensor
public AbstractSensor get_sensor(long id) throws error.OTMException
Get sensor by id- Throws:
error.OTMException
-
get_controller
public AbstractController get_controller(long id) throws error.OTMException
Get controller by id- Throws:
error.OTMException
-
set_model
public void set_model(jaxb.Model jmodel) throws error.OTMException
Assign a model to a set of links.- Parameters:
jmodel
- Model in jaxb format. Please refer to otm.xsd for the details.- Throws:
error.OTMException
-
get_demands_for_commodity
public Set<profiles.Profile1D> get_demands_for_commodity(Long commodity_id)
Extract all of the demands for a given commodity.- Parameters:
commodity_id
- Commodity id.- Returns:
-
get_demands_for_link
public Set<profiles.Profile1D> get_demands_for_link(Long link_id)
Extract all of the demands for a given link.- Parameters:
link_id
- Link id.- Returns:
-
add_subnetwork
public long add_subnetwork(String name, Set<Long> linkids, Set<Long> comm_ids) throws error.OTMException
- Throws:
error.OTMException
-
get_total_trips
public double get_total_trips()
Integrate the demands to obtain the total number of trips that will take place.- Returns:
- The number of trips.
-
get_animation_info
public output.animation.AnimationInfo get_animation_info(List<Long> link_ids) throws error.OTMException
- Parameters:
link_ids
- Undocumented- Returns:
- Undocumented
- Throws:
error.OTMException
- Undocumented
-
get_animation_info
public output.animation.AnimationInfo get_animation_info() throws error.OTMException
Undocumented- Returns:
- Undocumented
- Throws:
error.OTMException
- Undocumented
-
-