From d99be48972e265c5da396a6e829debf5fd74e695 Mon Sep 17 00:00:00 2001 From: hofmannol Date: Tue, 26 Mar 2024 16:30:21 +0100 Subject: [PATCH] Reset --- SoSe24/algodat/foundation.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/SoSe24/algodat/foundation.py b/SoSe24/algodat/foundation.py index 323ed27..80e35ed 100644 --- a/SoSe24/algodat/foundation.py +++ b/SoSe24/algodat/foundation.py @@ -23,6 +23,18 @@ class AlgoDatValue: print(f"Div: {AlgoDatValue.div_operation}") print(f"Bit: {AlgoDatValue.bit_operation}") + @staticmethod + def reset(): + AlgoDatValue.memory = 0 + AlgoDatValue.read = 0 + AlgoDatValue.write = 0 + AlgoDatValue.compare = 0 + AlgoDatValue.add_operation = 0 + AlgoDatValue.sub_operation = 0 + AlgoDatValue.mul_operation = 0 + AlgoDatValue.div_operation = 0 + AlgoDatValue.bit_operation = 0 + def __init__(self, value): AlgoDatValue.memory += 1 AlgoDatValue.write += 1