pygrenade_vx.network.abstract.frontend.ExperimentElement

class pygrenade_vx.network.abstract.frontend.ExperimentElement(experiment: pygrenade_vx.network.abstract.frontend.Experiment)

Bases: object

Element of experiment description, e.g. Population, Projection, Recorder.

Variables
  • changed_topology – Whether changes occured since last adding the element to the experiment’s topology, which require calling add_to_topology to update the topology representation.

  • changed_input_data – Whether changes occured since last adding the element to the experiment’s input data, which require calling add_to_input_data to update the input data representation.

__init__(experiment: pygrenade_vx.network.abstract.frontend.Experiment)

Construct element and add it to the experiment.

Parameters

experiment – Experiment to add element to

Methods

__init__(experiment)

Construct element and add it to the experiment.

add_to_input_data(experiment, …)

Add element to experiment snippet’s input data.

add_to_topology(experiment)

Add element to experiment snippet’s topology.

extract_output_data(experiment)

Extract output data of element from experiment snippet.

add_to_input_data(experiment: pygrenade_vx.network.abstract.frontend.ExperimentSnippet, snippet_begin_time, snippet_end_time)

Add element to experiment snippet’s input data.

If the snippet doesn’t contain the element yet, it is added. If it is already contained it is updated, if changed_input_data is True. The method is called after mapping is available.

Parameters
  • experiment – Experiment snippet for which to add this element into the snippet’s input data

  • snippet_begin_time – Time at which the snippet begins

  • snippet_end_time – Time at which the snippet ends

add_to_topology(experiment: pygrenade_vx.network.abstract.frontend.ExperimentSnippet)bool

Add element to experiment snippet’s topology.

If the snippet doesn’t contain the element yet, it is added. If it is already contained it is updated, if changed_topology is True. This method is called before the potential mapping operation.

Parameters

experiment – Experiment snippet for which to add this element into the snippet’s topology

Returns

Whether the element was added to the topology. The experiment doesn’t track interdependencies defining the order in which the elements can be added to the topology. Therefore this method is expected to perform the check whether the element can be added or updated, in which case the return value is expected to be True.

extract_output_data(experiment: List[pygrenade_vx.network.abstract.frontend.ExperimentSnippet])None

Extract output data of element from experiment snippet. This method is called after execution of the experiment. Storage in the front end format is to be performed by the front end.

Parameters

experiment – Experiment snippet from which to extract this element’s output data