pyCBD.lib.endpoints module¶
- class pyCBD.lib.endpoints.CollectorBlock(block_name, input_ports, data=None)[source]¶
Bases:
pyCBD.Core.BaseBlockAbstract class, representing a basic collection unit. In the data attribute, a set of values is stored for external access (possibly during the simulation). This should allow for live plots w.r.t. an independent plotting framework.
- Parameters
block_name (str) – The name of the block.
input_ports (list) – The inputs for the collector.
data (Any) – The data that is being tracked.
- compute(curIteration)[source]¶
Computes this block’s operation, based on its inputs and store it as an output signal.
- Parameters
curIteration (int) – The iteration at which we must compute this value.
- clear()[source]¶
Clears the contents of the block. Must be called in-between simulations if the obtainable statistics do not need to interfere/retain information about previous simulations.
- property data¶
Property to obtain the internal data.
- class pyCBD.lib.endpoints.SignalCollectorBlock(block_name, buffer_size=- 1)[source]¶
Bases:
pyCBD.lib.endpoints.CollectorBlockCollects a single signal to store w.r.t. the arrival time.
- Parameters
block_name (str) – The name of the block.
buffer_size (int) – The maximal amount of values to keep track of. When negative, no buffering will happen. Defaults to
-1.
- compute(curIteration)[source]¶
Computes this block’s operation, based on its inputs and store it as an output signal.
- Parameters
curIteration (int) – The iteration at which we must compute this value.
- clear()[source]¶
Clears the contents of the block. Must be called in-between simulations if the obtainable statistics do not need to interfere/retain information about previous simulations.
- property data_xy¶
The collected data, as a pair of lists; i.e. the unzipped form of
xs, ys.
- class pyCBD.lib.endpoints.PositionCollectorBlock(block_name, buffer_size=- 1)[source]¶
Bases:
pyCBD.lib.endpoints.CollectorBlockCollects a X/Y position, to be used for a parametric plot.
- Parameters
block_name (str) – The name of the block.
buffer_size (int) – The maximal amount of values to keep track of. When negative, no buffering will happen. Defaults to
-1.
- compute(curIteration)[source]¶
Computes this block’s operation, based on its inputs and store it as an output signal.
- Parameters
curIteration (int) – The iteration at which we must compute this value.
- clear()[source]¶
Clears the contents of the block. Must be called in-between simulations if the obtainable statistics do not need to interfere/retain information about previous simulations.
- distance_from_last(x1, y1)[source]¶
Computes the distance between the last point and the given point.
- Parameters
x1 (numeric) – The x position of the given point.
y1 (numeric) – The y position of the given point.
- property data_xy¶
The collected data, as a pair of lists; i.e. the unzipped form of
xs, ys.
- class pyCBD.lib.endpoints.StatisticsCollectorBlock(name)[source]¶
Bases:
pyCBD.lib.endpoints.CollectorBlockCollects all inputs and allows for statistical data summaries.
While this can be done on the
SignalCollectorBlock, this class uses a less memory-intensive algorithm to do so. When only statistical info is required and a lot of data needs to be analyzed, this algorithm should be used!Note
This block only works for NUMERICAL data.
- compute(curIteration)[source]¶
Computes this block’s operation, based on its inputs and store it as an output signal.
- Parameters
curIteration (int) – The iteration at which we must compute this value.