Skip to content
Snippets Groups Projects
Select Git revision
  • b01aa58bf949ab0ba0e3b88e26636506b74e8c3d
  • master default protected
  • tut_ring_allen
  • docs_furo
  • docs_reorder_cable_cell
  • docs_graphviz
  • docs_rtd_dev
  • ebrains_mirror
  • doc_recat
  • docs_spike_source
  • docs_sim_sample_clar
  • docs_pip_warn
  • github_template_updates
  • docs_fix_link
  • cv_default_and_doc_clarification
  • docs_add_numpy_req
  • readme_zenodo_05
  • install_python_fix
  • install_require_numpy
  • typofix_propetries
  • docs_recipe_lookup
  • v0.10.0
  • v0.10.1
  • v0.10.0-rc5
  • v0.10.0-rc4
  • v0.10.0-rc3
  • v0.10.0-rc2
  • v0.10.0-rc
  • v0.9.0
  • v0.9.0-rc
  • v0.8.1
  • v0.8
  • v0.8-rc
  • v0.7
  • v0.6
  • v0.5.2
  • v0.5.1
  • v0.5
  • v0.4
  • v0.3
  • v0.2.2
41 results

event_generator.cpp

Blame
  • user avatar
    Nora Abi Akar authored and GitHub committed
    New structs and types:
    * `cell_tag_type` (std::string): for labelling placeable items on a cell. The label refers to a number of items placed on a locset, equal to the number of locations in a locset. The number of locations in not always known to the user, so the previous way of using indices for items was no longer sufficient. 
    * `lid_selection_policy`: for allowing a user to select a single item from a group of items sharing a label. Currently only `round_robin` and `assert_univalent` are supported. 
    * `cell_local_label_type` and `cell_global_label_type`: for identifying the target and source of a connection or gap_junction connection. 
    * `cell_label_ranges`, and `cell_labels_and_gids`: for propagating information about the labelled items on the cell from the cell groups back to the simulation and communicator. 
    * `label_resolution_map` and `resolver`: for selecting an item (and retaining state) from a labelled group of items on a cell according to a user-selected policy.
    
    Changes to the model-initialization: 
    * The `communicator` now needs `label_resolution_maps` constructed from the cell group data in order to build the `connections` vectors. 
    * The `simulation_state` object handles the transfer of the information when it is constructed. 
    * Spike exchange at runtime remains unchanged, because `communicator::connections` remains unchanged. 
    
    Changes to cells, cell_groups and recipe:
    * `decor::place` expects a third label parameter, no longer returns an `lid_range`.
    * `lif`, `source`, and `benchmark` cells need source/target labels in their constructors. 
    * A `cell_group` needs to save data about the gid/labels/lid_ranges of each cell, to propagate back to the `communicator` constructor. 
    * Connections/gap junction connections are formed between {label, policy} pairs on cells instead of indices. 
    * `num_sources`, `num_targets`, `num_gap_junction_sites` deleted from `recipe`.
    
    Additional changes:
    * Add MPI wrapper for exchanging vectors of strings. 
    * Corresponding updates to unit tests, Python wrapper, C++ and Python examples, documentation.
    
    Fixes #1394
    e0e18976
    History
    event_generator.cpp 1.35 KiB
    #include <pybind11/pybind11.h>
    #include <pybind11/pytypes.h>
    #include <pybind11/stl.h>
    
    #include <arbor/common_types.hpp>
    #include <arbor/schedule.hpp>
    
    #include "event_generator.hpp"
    #include "schedule.hpp"
    
    namespace pyarb {
    
    void register_event_generators(pybind11::module& m) {
        using namespace pybind11::literals;
    
        pybind11::class_<event_generator_shim> event_generator(m, "event_generator");
    
        event_generator
            .def(pybind11::init<>(
                [](arb::cell_local_label_type target, double weight, const schedule_shim_base& sched) {
                    return event_generator_shim(std::move(target), weight, sched.schedule()); }),
                "target"_a, "weight"_a, "sched"_a,
                "Construct an event generator with arguments:\n"
                "  target: The target synapse label and selection policy.\n"
                "  weight: The weight of events to deliver.\n"
                "  sched:  A schedule of the events.")
            .def_readwrite("target", &event_generator_shim::target,
                 "The target synapse (gid, local_id).")
            .def_readwrite("weight", &event_generator_shim::weight,
                 "The weight of events to deliver.")
            .def("__str__", [](const event_generator_shim&){return "<arbor.event_generator>";})
            .def("__repr__", [](const event_generator_shim&){return "<arbor.event_generator>";});
    }
    
    } // namespace pyarb