# PoissonInput class

(Shortest import: `from brian2 import PoissonInput)`

class brian2.input.poissoninput.PoissonInput(target, target_var, N, rate, weight, when='synapses', order=0)

  Bases: `CodeRunner`

  Adds independent Poisson input to a target variable of a `Group`. For large numbers of inputs, this is much more efficient than creating a `PoissonGroup`. The synaptic events are generated randomly during the simulation and are not preloaded and stored in memory. All the inputs must target the same variable, have the same frequency and same synaptic weight. All neurons in the target `Group` receive independent realizations of Poisson spike trains.

  Parameters:

    target : `Group`

    > The group that is targeted by this input.

    target_var : str

    > The variable of `target` that is targeted by this input.

    N : int

    > The number of inputs

    rate : `Quantity`

    > The rate of each of the inputs

    weight : str or `Quantity`

    > Either a string expression (that can be interpreted in the context of `target`) or a `Quantity` that will be added for every event to the `target_var` of `target`. The unit has to match the unit of `target_var`

    when : str, optional

    > When to update the target variable during a time step. Defaults to the `synapses` scheduling slot. See Scheduling for possible values.

    order : int, optional

    > The priority of of the update compared to other operations occurring at the same time step and in the same scheduling slot. Defaults to 0.

  Attributes

  `N` | The number of inputs
  `rate` | The rate of each input
  `target_var` | The targetted variable
  `weight` | The synaptic weight

  Methods

  `before_run`(run_namespace) | Optional method to prepare the object before a run.

  Details

  N

    The number of inputs

  rate

    The rate of each input

  target_var

    The targetted variable

  weight

    The synaptic weight

  before_run(run_namespace)

    Optional method to prepare the object before a run.

    Called by `Network.after_run` before the main simulation loop starts.

## Tutorials and examples using this

- Example frompapers/Brunel_2000

- Example frompapers/Brunel_Wang_2001

- Example frompapers/Rossant_et_al_2011bis

- Example frompapers/Wang_2002