Search Results for

    Show / Hide Table of Contents

    Class schedule::Segments

    Segments Schedule.

    Concatenate multiple schedules to a single schedule. Configuration:

    • Basic definition:
    "schedule": {
      "type": "segments",
      "segments": [
        {
          "type": "constant",
          "value": 3,
          "count": 100,
        },
        {
          "type": "linear",
          "initial": 3,
          "final": 0.3,
          "count": 1000
        },
        {
          "type": "constant",
          "value": 0.3,
          "count": 500
        }
      ]
    }
    
    • From an array:
    "schedule": {
      "type": "segments",
      "segments": [1,2,3]
    }
    
    • From an array, shorthand
    "schedule": [1,2,3]
    
    Note

    Unless otherwise specified, each segment is assumed to have a width of 1, with the start point coinciding with the stop of the previous segment. You can modify this default behavior by specifying the (absolute) stop point of the segment or by adjusting the width via count.

    Note

    Segments specified as an array of scalar values are presumed to be points of zero input range width spaced by 1. As a result, the total width of the array is mapped to 0..(size-1) and discretization with default count yields back the array. Input values between these points are interpolated linearly.

    Inheritance
    schedule::ScheduleGenerator
    schedule::Segments
    Inherited Members
    get_count
    ScheduleGenerator
    get_stop
    ~ScheduleGenerator
    get_initial_value
    get_start
    set_stop
    has_count
    get_final_value
    has_stop
    has_start
    is_repeated
    ~Component
    Component
    get_status
    param
    get_class_name

    Constructors

    Segments()

    Declaration
    schedule::Segments::Segments()=default

    Segments()

    Declaration
    schedule::Segments::Segments(const std::vector<double>&values)

    Methods

    get_progress_value()

    Get the value at a relative position in the input interval.

    Arguments: progress relative input position \in [0..1] Returns: the value of the segment covering progress.

    Declaration
    double schedule::Segments::get_progress_value(double progress) const override

    configure()

    Configure the Segments generator from input.

    This expects the segments to be concatenated.

    Declaration
    void schedule::Segments::configure(const utils::Json&json) override

    adjust()

    Declaration
    void schedule::Segments::adjust()

    render()

    Return the config value for schedule.

    Declaration
    utils::Structure schedule::Segments::render() const override
    In This Article
    Back to top Generated with Doxygen and DocFX