Scenario Result¶
The ScenarioResult is the container for all data produced by an Algorithm’s run method. It acts as a detailed snapshot of a “solution” to a specific problem, capturing both metadata (like the time of completion) and domain-specific outputs.
For a more intuitive discussion of the concepts behind scenario results, see the Scenario Result.
Scenario result containers.
BaseScenarioResult mirrors algomancy_data.datasource.BaseDataSource:
subclasses MUST implement to_json / from_json to participate in
database persistence. Subclasses whose state decomposes into one or more
DataFrames can additionally implement
algomancy_scenario.persistence.protocols.SqlResultLayout to land each
DataFrame in a real, externally queryable SQL table.
- class algomancy_scenario.result.BaseScenarioResult(data_id)[source]¶
Bases:
ABC- abstractmethod to_json()[source]¶
Serialise the full result to a JSON string.
The output must round-trip through
from_json(). Used as the JSON-blob fallback path bySqlScenarioRepositorywhen the subclass does not implementSqlResultLayout.
- class algomancy_scenario.result.ScenarioResult(data_id)[source]¶
Bases:
BaseScenarioResultBundled minimal result: carries only
data_idandcompleted_at.- to_json()[source]¶
Serialise the full result to a JSON string.
The output must round-trip through
from_json(). Used as the JSON-blob fallback path bySqlScenarioRepositorywhen the subclass does not implementSqlResultLayout.