nrel.hive.state.simulation_state.update.cancel_requests

Module Contents

Classes

CancelRequests

Helper class that provides a standard way to create an ABC using

Functions

_gen_report(→ nrel.hive.reporting.reporter.Report)

Report of a cancellation

Attributes

log

nrel.hive.state.simulation_state.update.cancel_requests.log[source]
class nrel.hive.state.simulation_state.update.cancel_requests.CancelRequests[source]

Bases: nrel.hive.state.simulation_state.update.simulation_update.SimulationUpdateFunction

Helper class that provides a standard way to create an ABC using inheritance.

update(simulation_state: nrel.hive.state.simulation_state.simulation_state.SimulationState, env: nrel.hive.runner.environment.Environment) Tuple[nrel.hive.state.simulation_state.simulation_state.SimulationState, CancelRequests | None][source]

cancels requests whose cancel time has been exceeded

Parameters:
  • simulation_state – state to modify

  • env – the scenario environment

Returns:

state without cancelled requests, along with this update function

nrel.hive.state.simulation_state.update.cancel_requests._gen_report(r_id: nrel.hive.util.typealiases.RequestId, sim: nrel.hive.state.simulation_state.simulation_state.SimulationState) nrel.hive.reporting.reporter.Report[source]

Report of a cancellation

Parameters:
  • r_id – request cancelled

  • sim – the state of the sim before cancellation occurs

Returns:

a report