source: framspy/evolalg/base/step.py @ 1126

Last change on this file since 1126 was 1113, checked in by Maciej Komosinski, 4 years ago

Added a framework for evolutionary algorithms cooperating with FramsticksLib?.py

File size: 463 bytes
Line 
1from abc import abstractmethod
2
3
4class Step:
5    """
6    Base abstract class for experiment's steps. It has three stages: pre, call and post.
7
8    """
9    def pre(self):
10        pass
11
12    @abstractmethod
13    def call(self, *args, **kwargs):
14        pass
15
16    def post(self):
17        pass
18
19    def init(self):
20        pass
21
22    def __call__(self, *args, **kwargs):
23        self.pre()
24        res = self.call(*args, **kwargs)
25        self.post()
26        return res
Note: See TracBrowser for help on using the repository browser.