Class OutputTypeAdapterImpl

    • Field Detail

      • outputType

        protected OutputType outputType
        The OutputType this OutputTypeAdapter is used for
    • Constructor Detail

      • OutputTypeAdapterImpl

        public OutputTypeAdapterImpl​(OutputType outputType,
                                     TrafficAssignment trafficAssignment)
        Constructor
        Parameters:
        outputType - the OutputType this adapter corresponds to
        trafficAssignment - TrafficAssignment object which this adapter wraps
    • Method Detail

      • getAssignment

        protected TrafficAssignment getAssignment()
        Access the assignment
        Returns:
        the assignment
      • createConvertedUnitsValue

        protected static Optional<?> createConvertedUnitsValue​(OutputProperty outputProperty,
                                                               Optional<?> unconvertedValue)
                                                        throws PlanItException
        Convert the output property value that is assumed to be in the properties default units in the desired units indicated on the property
        Parameters:
        outputProperty - to base conversion on
        unconvertedValue - original value in default units
        Returns:
        converted value as optional
        Throws:
        PlanItException - thrown if error
      • getOutputTypeIndependentPropertyValue

        protected Optional<?> getOutputTypeIndependentPropertyValue​(OutputProperty outputProperty,
                                                                    Mode mode,
                                                                    TimePeriod timePeriod)
        Returns the value of properties which are common to all output type adapters
        Parameters:
        outputProperty - the specified output property
        mode - the current mode
        timePeriod - the current time period
        Returns:
        the value of the specified property, or null if the specified property is not common to all output adapters (or an Exception message if an error has occurred)
      • getOutputType

        public OutputType getOutputType()
        Return the output type corresponding to this output adapter
        Specified by:
        getOutputType in interface OutputTypeAdapter
        Returns:
        the output type corresponding to this output adapter
      • getIterationIndexForSubOutputType

        public Optional<Integer> getIterationIndexForSubOutputType​(SubOutputTypeEnum outputTypeEnum)
                                                            throws PlanItException
        Default implementation assumes that regular iteration index is used, which in most cases it true, only when for example costs are trailing one iteration behind in case they are only revealed in the next iteration this method should be overridden
        Specified by:
        getIterationIndexForSubOutputType in interface OutputTypeAdapter
        Parameters:
        outputTypeEnum - , allowed to be null, in that case it is assumed there does not exist a suboutputtype for this output type
        Returns:
        iterationIndexForData
        Throws:
        PlanItException - thrown if exception