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 MatchSet * | result (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] | action | Action object.
  [in] | sim_time | Time at which action object ran.
  [in] | result | Result 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] | action | PyAction object.
  [in] | result | Result 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_config | Run's ActionX and PyAction objects.
  [in] | rst_state | Run state (time and count) for the run's ActionX objects.

## operator==()

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

Equality predicate.

Parameters

  [in] | other | Object against which will be tested for equality.

Returns
  Whether or not
  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] | action | Action 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] | action | Action 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] | action | Action 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

.

Parameters

  [in] | action | Action 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

  Serializer | Byte array conversion protocol.

Parameters

  [in,out] | serializer | Byte array conversion object.

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

- opm/input/eclipse/Schedule/Action/State.hpp
- opm/input/eclipse/Schedule/Action/State.cpp