Base class for EventPort and AnalogPort.
In general, a port has a name, which can be used to reference it, and a mode, which specifies whether it sends or receives information.
Generally, a send port can be connected to receive port to allow different components to communicate.
In the case of an AnalogPort, we have three modes, send, recv and reduce. send ports can be connected to any number of recv ports, but each recv port can only be connected to a single send port. In order to collect analog inputs from several send ports into a single port, we use a reduce port. A reduce port also requires an additional parameter, op, which specifies how to combine the information from the ports, for example, by adding their values together, +.
For example, if we had several Hodgkin-Huxley channels on a neuron, we would want each one to have a send port, i containing the current passing through that type of channel. Then, we would have a single reduce port, I_in for example, with op='+', which would combine them together to calculate the voltage change in the neuron.
Port Constructor.
| Parameters: |
|
|---|
Note
Currently support reduce_op s are: +.
Methods
| __init__(name[, mode, reduce_op]) | Port Constructor. |
| is_incoming() | Returns True if the port’s mode is ‘recv’ or ‘reduce’ |
| is_outgoing() | Returns True if the port’s mode is ‘send’ |
Attributes
| mode | The mode of the port. |
| name | The name of the port, local to the current component |
| reduce_op | The reduce operation of the port, if it is a ‘reduce’ port |
Returns True if the port’s mode is ‘recv’ or ‘reduce’
Returns True if the port’s mode is ‘send’
The mode of the port. [‘send’,’recv’ or ‘reduce’]
The name of the port, local to the current component
The reduce operation of the port, if it is a ‘reduce’ port