///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2020 Equinor ASA // // ResInsight is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. // // See the GNU General Public License at // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include #include #include class RimSummaryCase; class RimSummaryCaseCollection; class RifEclipseSummaryAddress; //================================================================================================== /// //================================================================================================== class RimObjectiveFunction { public: enum class FunctionType { M1 = 0, M2 }; QString uiName() const; RimObjectiveFunction::FunctionType functionType(); void setTimeStepRange( time_t startTime, time_t endTime ); void setTimeStepList( std::vector timeSteps ); RimObjectiveFunction( const RimSummaryCaseCollection* summaryCaseCollection, FunctionType type ); double value( size_t caseIndex, std::vector vectorSummaryAddresses, bool* hasWarning = nullptr ) const; double value( RimSummaryCase* summaryCase, std::vector vectorSummaryAddresses, bool* hasWarning = nullptr ) const; std::pair minMaxValues( std::vector vectorSummaryAddresses ) const; std::pair range() const; std::vector values( std::vector vectorSummaryAddresses ) const; bool isValid( std::vector vectorSummaryAddresses ) const; QString formulaString( std::vector vectorSummaryAddresses ); bool operator<( const RimObjectiveFunction& other ) const; private: const RimSummaryCaseCollection* m_summaryCaseCollection; time_t m_startTimeStep; time_t m_endTimeStep; std::vector m_timeSteps; FunctionType m_functionType; };