Solver statistics.
| 1039 | |
| 1040 | |
| 1041 | class Statistics: |
| 1042 | """Solver statistics.""" |
| 1043 | |
| 1044 | def __init__(self, data: dict | None = None) -> None: |
| 1045 | self._data = data or {} |
| 1046 | |
| 1047 | def __len__(self) -> int: |
| 1048 | return len(self._data) |
| 1049 | |
| 1050 | def __getitem__(self, key: str) -> Any: |
| 1051 | return self._data.get(key, 0) |
| 1052 | |
| 1053 | def __contains__(self, key: str) -> bool: |
| 1054 | return key in self._data |
| 1055 | |
| 1056 | def keys(self) -> list[str]: |
| 1057 | return list(self._data.keys()) |
| 1058 | |
| 1059 | def get_key_value(self, key: str) -> Any: |
| 1060 | return self._data.get(key, 0) |
| 1061 | |
| 1062 | def __repr__(self) -> str: |
| 1063 | return repr(self._data) |
| 1064 | |
| 1065 | |
| 1066 | # --------------------------------------------------------------------------- |
no outgoing calls