My Project
Loading...
Searching...
No Matches
Opm::Action::State Class Reference

Management information about the current run's ACTION system, especially concerning the number of times each action has triggered/run and the last time it was run. More...

#include <State.hpp>

Classes

class  MatchSet
 Matching entities from a successfully triggered ActionX object. More...
 

Public Member Functions

void add_run (const ActionX &action, std::time_t sim_time, const Result &result)
 Record ActionX Run.
 
void add_run (const PyAction &action, bool result)
 Record PyAction Run.
 
std::size_t run_count (const ActionX &action) const
 Retrieve number of times an action has run.
 
std::time_t run_time (const ActionX &action) const
 Retrieve timestamp of the last time an action ran.
 
const MatchSetresult (const std::string &action) const
 Retrieve set of matching entities from the last time an action ran.
 
std::optional< bool > python_result (const std::string &action) const
 Query for the result of running a PyAction.
 
void load_rst (const Actions &action_config, const RestartIO::RstState &rst_state)
 Load action state from restart file.
 
template<class Serializer >
void serializeOp (Serializer &serializer)
 Convert between byte array and object representation.
 
bool operator== (const State &other) const
 Equality predicate.
 

Static Public Member Functions

static State serializationTestObject ()
 Create a serialisation test object.
 

Detailed Description

Management information about the current run's ACTION system, especially concerning the number of times each action has triggered/run and the last time it was run.

Member Function Documentation

◆ add_run() [1/2]

void Opm::Action::State::add_run ( const ActionX action,
std::time_t  sim_time,
const Result result 
)

Record ActionX Run.

Parameters
[in]actionAction object.
[in]sim_timeTime at which action object ran.
[in]resultResult of evaluating the action triggers, including any matching entities such as wells.

◆ add_run() [2/2]

void Opm::Action::State::add_run ( const PyAction action,
bool  result 
)

Record PyAction Run.

Parameters
[in]actionPyAction object.
[in]resultResult of evaluating the PyAction.

◆ load_rst()

void Opm::Action::State::load_rst ( const Actions action_config,
const RestartIO::RstState rst_state 
)

Load action state from restart file.

Parameters
[in]action_configRun's ActionX and PyAction objects.
[in]rst_stateRun state (time and count) for the run's ActionX objects.

◆ operator==()

bool Opm::Action::State::operator== ( const State other) const

Equality predicate.

Parameters
[in]otherObject against which
*this
will be tested for equality.
Returns
Whether or not
*this
is the same as other.

◆ python_result()

std::optional< bool > Opm::Action::State::python_result ( const std::string &  action) const

Query for the result of running a PyAction.

Parameters
[in]actionAction name.
Returns
PyAction result. Nullopt if the action has not yet run.

◆ result()

const Opm::Action::State::MatchSet * Opm::Action::State::result ( const std::string &  action) const

Retrieve set of matching entities from the last time an action ran.

Parameters
[in]actionAction name.
Returns
Set of matching entities. Nullptr if no such set exists–e.g., if the action did not yet run or if there were no matching entities the last time the action ran.

◆ run_count()

std::size_t Opm::Action::State::run_count ( const ActionX action) const

Retrieve number of times an action has run.

Parameters
[in]actionAction object.
Returns
Number of times action has run.

◆ run_time()

std::time_t Opm::Action::State::run_time ( const ActionX action) const

Retrieve timestamp of the last time an action ran.

Will throw an exception of type std::invalid_argument if the action has never run, i.e., if

run_count(action) == 0
std::size_t run_count(const ActionX &action) const
Retrieve number of times an action has run.
Definition State.cpp:75

.

Parameters
[in]actionAction object.
Returns
Time point of action's last execution.

◆ serializeOp()

template<class Serializer >
void Opm::Action::State::serializeOp ( Serializer serializer)
inline

Convert between byte array and object representation.

Template Parameters
SerializerByte array conversion protocol.
Parameters
[in,out]serializerByte array conversion object.

The documentation for this class was generated from the following files: