Loading...
Searching...
No Matches
PyDynamicNetworkSolverStrategy Class Referencefinal

`#include <py_solver.h>`

Inheritance diagram for PyDynamicNetworkSolverStrategy:
[legend]
Collaboration diagram for PyDynamicNetworkSolverStrategy:
[legend]

## Private Member Functions

| PyDynamicNetworkSolverStrategy (gridfire::engine::DynamicEngine &engine)
gridfire::NetOut | evaluate (const gridfire::NetIn &netIn) override
| Evaluates the network for a given timestep.
void | set_callback (const std::any &callback) override
| set the callback function to be called at the end of each timestep.
std::vector< std::tuple< std::string, std::string > > | describe_callback_context () const override
| Describe the context that will be passed to the callback function.

## Additional Inherited Members

Public Member Functions inherited from gridfire::solver::NetworkSolverStrategy< engine::DynamicEngine >
| NetworkSolverStrategy (engine::DynamicEngine &engine)
| Constructor for the NetworkSolverStrategy.
virtual | ~NetworkSolverStrategy ()=default
| Virtual destructor.
| NetworkSolverStrategy (engine::DynamicEngine &engine)
| Constructor for the NetworkSolverStrategy.
virtual | ~NetworkSolverStrategy ()=default
| Virtual destructor.
Protected Attributes inherited from gridfire::solver::NetworkSolverStrategy< engine::DynamicEngine >
engine::DynamicEngine & | m_engine
| The engine used by this solver strategy.
engine::DynamicEngine & | m_engine
| The engine used by this solver strategy.

## Constructor & Destructor Documentation

## PyDynamicNetworkSolverStrategy()

PyDynamicNetworkSolverStrategy::PyDynamicNetworkSolverStrategy | ( | gridfire::engine::DynamicEngine & | engine | ) |

inlineexplicitprivate

## Member Function Documentation

## describe_callback_context()

std::vector< std::tuple< std::string, std::string > > PyDynamicNetworkSolverStrategy::describe_callback_context | ( |  | ) | const

nodiscardoverrideprivatevirtual

Describe the context that will be passed to the callback function.

Returns
  A vector of tuples, each containing a string for the parameter's name and a string for its type.

This method should be overridden by derived classes to provide a description of the context that will be passed to the callback function. The intent of this method is that an end user can investigate the context that will be passed to the callback function, and use this information to craft their own callback function.

Implements gridfire::solver::NetworkSolverStrategy< engine::DynamicEngine >.

## evaluate()

gridfire::NetOut PyDynamicNetworkSolverStrategy::evaluate | ( | const gridfire::NetIn & | netIn | ) |

overrideprivatevirtual

Evaluates the network for a given timestep.

Parameters

  netIn | The input conditions for the network.

Returns
  The output conditions after the timestep.

Implements gridfire::solver::NetworkSolverStrategy< engine::DynamicEngine >.

## set_callback()

void PyDynamicNetworkSolverStrategy::set_callback | ( | const std::any & | callback | ) |

overrideprivatevirtual

set the callback function to be called at the end of each timestep.

This function allows the user to set a callback function that will be called at the end of each timestep. The callback function will receive a gridfire::solver::<SOMESOLVER>::TimestepContext object. Note that depending on the solver, this context may contain different information. Further, the exact signature of the callback function is left up to each solver. Every solver should provide a type or type alias TimestepCallback that defines the signature of the callback function so that the user can easily get that type information.

Parameters

  callback | The callback function to be called at the end of each timestep.

Implements gridfire::solver::NetworkSolverStrategy< engine::DynamicEngine >.

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

- src/python/solver/trampoline/py_solver.h
- src/python/solver/trampoline/py_solver.cpp