Package core

Class 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.
    • Constructor Detail

      • Scenario

        public Scenario()
    • 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_commodities

        public Map<Long,​Commodity> get_commodities()
        Get map of commodities
      • get_subnetworks

        public Map<Long,​Subnetwork> get_subnetworks()
        Get map of subnetworks
      • commodity_ids

        public Set<Long> commodity_ids()
        Get commodity ids
      • subnetwork_ids

        public Set<Long> subnetwork_ids()
        Get subnetwork ids
      • path_ids

        public Set<Long> path_ids()
        Get ids of subnetworks that are paths
      • actuator_ids

        public Collection<Long> actuator_ids()
        Get actuator 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