master > master: code - fügte algorithmen und config datei hinzu

This commit is contained in:
RD
2021-10-23 13:20:37 +02:00
parent c0e1bdc3c4
commit a83c5a91fc
15 changed files with 380 additions and 68 deletions

0
code/display/__init__.py Normal file
View File

42
code/display/display.py Normal file
View File

@@ -0,0 +1,42 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# IMPORTS
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
from code.local.typing import *;
from code.core.log import *;
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# METHODS display case
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def DisplayCase(name: Any):
logPlain('');
logInfo('\033[92;1mCASE {}\033[0m'.format(name))
return;
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# METHODS display algorithm start/end
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def DisplayStartOfAlgorithm(name: str, **inputs: Any):
logInfo('Ausführung vom Algorithmus: \033[92;1m{}\033[0m'.format(name))
logInfo('INPUTS');
for varname, value in inputs.items():
logPlain(' - {} = {}'.format(varname, value))
return;
def DisplayEndOfAlgorithm(**outputs: Any):
logInfo('OUTPUTS:')
for varname, value in outputs.items():
logPlain(' - {} = {}'.format(varname, value))
DisplayMetrics()
return;
def DisplayMetrics():
logInfo('Dauer der Ausführung: t = \033[2m{}\033[0m'.format(TimeElapsed()))
logInfo('Anzahl der Schritte: T(n) = \033[1m{}\033[0m'.format(NumberOfSteps()))
return;