Adapters

Adapters are an important part of AnimatLab. They are a general mechanism that allows different modules to communicate with each other. One of the most obvious uses is to let the neural system interact with the physics engine. This allows you to do things like letting a neuron interface with a joint motor to make it rotate, or converting joint rotation into a current in a neuron. However, Adapters are not limited to being used to connect the physics and neural components of the program. They are also a general way to connect nodes in different neural plug-ins. Lets say you have written a neural simulation model specific to your interests. You can add this model to AnimatLab so it can be used by anyone else, and by using adapters you can connect a neuron in your model to a neuron or node in a model written by someone else.

Adapters allow you to do this because all nodes in Animatlab use a standard interface. This includes things like body parts, joints, and neurons. Part of the definition of the node is that it has certain pre-defined input and output variables. So when you have connect something like a joint as an input to a neuron it knows to interpret the signal in radians from the joint as a current into the neuron. Of course, you can not simply take the value in radians for the joint directly as the current signal though. Radians range from -3.14 to 3.14. So if you did that you would be trying to inject a current of 3.14 amps into the neuron! This would probably make a real neuron explode by super-heating the liquid inside. To be able to convert between rotation and current you need a gain function. This function takes radians as its input and outputs current. There are a variety of different types of gains that can be used, but the important thing to remember is that its the two objects, and how they are connected, that determines the input and output values used in the gain function. The gain function simply provides a way to map the values of the input variable to values in the output variable.

Using Adapters

You never directly add an adapter. In fact, adapters do not appear in the toolbox. It is the applications responsibility to know when an adapter is needed. Any time you attempt to draw a connection between two items that do not know how to communicate natively then an adapter will be added between those two items to allow them to communicate. However, it will be up to you to know how to configure the adapter to provide meaningful input/output values. You have to understand enough about how the source and target nodes work to know what values are reasonable. In our running example of converting joint angles to current we saw that if we just translated the radians directly to current it would produce very unrealistic currents in the neuron. We needed to know that neural currents are typically in the nano-amp range. Once we know this it is easy to modify the gain function so that radians are turned into nano-amps to provide realistic input values to the neuron. When using adapters you need to keep this fact in mind and realize that it is up to you to configure the gain settings of the adapter to provide useful values.

Adapter Properties

Figure 1. Adapter Properties

The adapter shares all of the common properties of nodes in the neural network editor. This includes things that let you change the graphics and text of the node. For more details on these properties please click here. Adapters only have three properties are specific to itself.

Enabled
Determines whether this adapter functions or not. This provides you with a convenient way to temporarily block input or output connections without having to delete them. If this is false then no data will be able to flow through it. Take the example described above where we are trying to convert rotation angle into firing rate of a neuron, if we disable the adapter then regardless of the joints angle no current will be injected into the neuron. It is as if you cut the nerves so the sensory information is never received. The good thing though is that unlike real cut nerves you just have to set the value back to true to allow the communications again.
Default value: True
Acceptable range: True/False

Gain Type
This determines the gain function that will map input values into output values. There will be sub-properties under this item, but they will be different depending on the type of gain you have chosen. Please see the gain description for more details.

Source Data Type ID
Every node in AnimatLab has a list of variables that it can provide data for that is specific to that item. This drop-down lists those variables for the source, or input, node so you can choose the variable you want to use as your input. The target node defines the output variable for the gain function. How that value is treated in the target node is determined by the Target Data Type set in the adapter. For example, if your target is a neuron then its default target variable is current. This means that any input from the gain function into this target will be interpreted as a current input. However, some neurons have other target types you can set. Each object knows what type is defined for it and that type will be displayed on the Y-Axis of the gain function.

Target Data Type ID
Every node in AnimatLab has a list of variables that it can accept as an input from an adapter. This drop-down lists those variables for the target, or output node, so you can choose the variable you want to use as your input into the output node.