Class Demands

  • All Implemented Interfaces:
    Serializable, org.djutils.event.EventProducerInterface

    public class Demands
    extends TrafficAssignmentComponent<Demands>
    implements Serializable
    Container class for all demands registered on the project. In PlanIt we assume that all traffic flows between an origin and destination. Hence all demand for a given time period and mode is provided between an origin and destination via ODDemand. Further, unlike other components, we let anyone register ODDemand compatible instances on this class to provide maximum flexibility in the underlying container since depending on the od data different containers might be preferred for optimizing memory usage. Also not all ODDemand instances on the same Demands instance might utilize the same data structure, hence the need to avoid a general approach across all entries within a Demands instance
    Author:
    markr
    See Also:
    Serialized Form
    • Field Detail

      • timePeriods

        public final Demands.TimePeriods timePeriods
        internal class instance containing all time periods on this demand instance
      • userClasses

        public final Demands.UserClasses userClasses
        internal class instance containing all user classes on this demand instance
      • travelerTypes

        public final Demands.TravelerTypes travelerTypes
        internal class instance containing all traveler types on this demand instance
    • Constructor Detail

      • Demands

        public Demands​(IdGroupingToken groupId)
        Constructor
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
    • Method Detail

      • registerODDemand

        public ODDemandMatrix registerODDemand​(TimePeriod timePeriod,
                                               Mode mode,
                                               ODDemandMatrix odDemandMatrix)
        Register provided odDemand
        Parameters:
        timePeriod - the time period for this origin-demand object
        mode - the mode for this origin-demand object
        odDemandMatrix - the origin-demand object to be registered
        Returns:
        oldODDemand if there already existed an odDemand for the given mode and time period, the overwritten entry is returned
      • get

        public ODDemandMatrix get​(Mode mode,
                                  TimePeriod timePeriod)
        Get an ODDemand by mode and time period
        Parameters:
        mode - the mode for which the ODDemand object is required
        timePeriod - the time period for which the ODDemand object is required
        Returns:
        ODDemand object if found, otherwise null
      • getRegisteredModesForTimePeriod

        public Set<Mode> getRegisteredModesForTimePeriod​(TimePeriod timePeriod)
        Get modes registered for the given time period
        Parameters:
        timePeriod - the specified time period
        Returns:
        Set of modes for this time period