Source code for nqs_sdk.interfaces.observable
from abc import ABC, abstractmethod
from decimal import Decimal
from typing import List, Optional
from nqs_sdk.nqs_sdk import (
MetricName,
ObservableDescription,
Parameters,
RefSharedState,
SealedParameters,
SimulationClock,
)
[docs]
class Observable(ABC):
[docs]
@abstractmethod
def register(self, parameter: Parameters) -> None: ...
[docs]
@abstractmethod
def describe(self, parameter: SealedParameters) -> ObservableDescription: ...
[docs]
@abstractmethod
def observe(
self, metrics: Optional[List[MetricName]], clock: SimulationClock, state: RefSharedState
) -> dict[MetricName, Decimal]: ...