From 7b456d177eb7d88ba57a6eee8d0823110576734c Mon Sep 17 00:00:00 2001 From: raj_mathe Date: Thu, 30 Jun 2022 05:43:10 +0200 Subject: [PATCH] =?UTF-8?q?woche12=20>=20master:=20code=20py=20-=20logging?= =?UTF-8?q?=20f=C3=BCr=20random=20walk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../python/src/models/random_walk/__init__.py | 2 ++ code/python/src/models/random_walk/logging.py | 32 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 code/python/src/models/random_walk/logging.py diff --git a/code/python/src/models/random_walk/__init__.py b/code/python/src/models/random_walk/__init__.py index a5bdd2f..250313e 100644 --- a/code/python/src/models/random_walk/__init__.py +++ b/code/python/src/models/random_walk/__init__.py @@ -6,6 +6,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ from src.models.random_walk.landscape import *; +from src.models.random_walk.logging import *; # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # EXPORTS @@ -13,4 +14,5 @@ from src.models.random_walk.landscape import *; __all__ = [ 'Landscape', + 'Step', ]; diff --git a/code/python/src/models/random_walk/logging.py b/code/python/src/models/random_walk/logging.py new file mode 100644 index 0000000..3bf8953 --- /dev/null +++ b/code/python/src/models/random_walk/logging.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# IMPORTS +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +from src.thirdparty.types import *; + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# EXPORTS +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +__all__ = [ + 'Step', +]; + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# CLASS Step +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +@dataclass +class Step(): + coords: tuple = field(); + label: str = field(); + + improved: bool = field(default=False); + chance: bool = field(default=False); + probability: float = field(default=0.); + + changed: bool = field(default=False); + stopped: bool = field(default=False);