eckity.statistics.statistics
1from abc import abstractmethod, ABC 2 3 4class Statistics(ABC): 5 """ 6 Abstract Statistics class. 7 Provides statistics about the current evolution state. 8 9 Parameters 10 ---------- 11 format_string: str 12 String format of the data to output. 13 Value depends on the information the statistics provides. 14 For more information, check out the concrete classes who extend this class. 15 16 """ 17 18 def __init__(self, format_string): 19 self.format_string = format_string 20 21 @abstractmethod 22 def write_statistics(self, sender, data_dict): 23 """ 24 Write the statistics information using the format string field. 25 26 Parameters 27 ---------- 28 sender: object 29 The object that this statistics provides information about. 30 This class registers to a certain event that the sender object publishes. 31 The statistics are shown as a callback to the event publication. 32 For example, we can register a concrete Statistics sub-class to provide statistics after every generation 33 of a concrete Algorithm sub-class. 34 35 data_dict: dict(str, object) 36 Relevant data to the statistics. Used to gain and provide information from the sender. 37 38 Returns 39 ------- 40 None. 41 """ 42 pass
class
Statistics(abc.ABC):
5class Statistics(ABC): 6 """ 7 Abstract Statistics class. 8 Provides statistics about the current evolution state. 9 10 Parameters 11 ---------- 12 format_string: str 13 String format of the data to output. 14 Value depends on the information the statistics provides. 15 For more information, check out the concrete classes who extend this class. 16 17 """ 18 19 def __init__(self, format_string): 20 self.format_string = format_string 21 22 @abstractmethod 23 def write_statistics(self, sender, data_dict): 24 """ 25 Write the statistics information using the format string field. 26 27 Parameters 28 ---------- 29 sender: object 30 The object that this statistics provides information about. 31 This class registers to a certain event that the sender object publishes. 32 The statistics are shown as a callback to the event publication. 33 For example, we can register a concrete Statistics sub-class to provide statistics after every generation 34 of a concrete Algorithm sub-class. 35 36 data_dict: dict(str, object) 37 Relevant data to the statistics. Used to gain and provide information from the sender. 38 39 Returns 40 ------- 41 None. 42 """ 43 pass
Abstract Statistics class. Provides statistics about the current evolution state.
Parameters
- format_string (str): String format of the data to output. Value depends on the information the statistics provides. For more information, check out the concrete classes who extend this class.
@abstractmethod
def
write_statistics(self, sender, data_dict):
22 @abstractmethod 23 def write_statistics(self, sender, data_dict): 24 """ 25 Write the statistics information using the format string field. 26 27 Parameters 28 ---------- 29 sender: object 30 The object that this statistics provides information about. 31 This class registers to a certain event that the sender object publishes. 32 The statistics are shown as a callback to the event publication. 33 For example, we can register a concrete Statistics sub-class to provide statistics after every generation 34 of a concrete Algorithm sub-class. 35 36 data_dict: dict(str, object) 37 Relevant data to the statistics. Used to gain and provide information from the sender. 38 39 Returns 40 ------- 41 None. 42 """ 43 pass
Write the statistics information using the format string field.
Parameters
- sender (object): The object that this statistics provides information about. This class registers to a certain event that the sender object publishes. The statistics are shown as a callback to the event publication. For example, we can register a concrete Statistics sub-class to provide statistics after every generation of a concrete Algorithm sub-class.
- data_dict (dict(str, object)): Relevant data to the statistics. Used to gain and provide information from the sender.
Returns
- None.