Search Results for

    Show / Hide Table of Contents

    Class observe::Constant

    Constant observable.

    Keeps track of the last value (the assumption is that this observable is used to indicate a constant associated with other observables, hence the name). It does not keep track of previously recorded values.

    Inheritance
    observe::Observable
    observe::Constant
    Inherited Members
    record
    ~Observable
    record
    record
    configure
    ~Component
    Component
    get_status
    param
    get_class_name

    Constructors

    Constant()

    Declaration
    observe::Constant::Constant()

    Methods

    reset()

    Declaration
    void observe::Constant::reset() override

    record()

    Declaration
    void observe::Constant::record(double value, double weight) override

    render()

    render the object in structured form

    Return a structured representation of the object. This is intended for output purposes. For instance, the solution your solver finds should have a render method which allows it to be returned as part of the result. Example:

    {c++}
     MySolution : public Component {
      public:
       // Represent the internal bool vector as +-1 output.
       utils::Structure render() const override {
         utils::Structure rendered;
         for (bool item : solution_) rendered.push_back(item ? 1 : -1);
         return rendered;
       }
    
      private:
       std::vector<bool> solution_;
     }
    
     MySolution solution;
     std::cout << solution.render().to_string() << std::endl;
    

    utils::Structure

    Declaration
    Structure observe::Constant::render() const override

    record()

    Declaration
    void observe::Observable::record(double value)

    record()

    Declaration
    void observe::Observable::record(int value)

    record()

    Declaration
    void observe::Observable::record(size_t value)

    record()

    Declaration
    virtual void observe::Observable::record(double value, double weight)=0
    In This Article
    Back to top Generated with Doxygen and DocFX