|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--mosaic.sim.kernel.AbstractModelComponent | +--mosaic.sim.kernel.BasicModel | +--mosaic.sim.neuron.netinputs.TemporalCodedInput
This class implements a spike source using temporal coding. It is a converter between analog values at its input and spike events at its output. The coding is done as follows: The number of inputs (i.e. the length of the input vector) is equal to the number of outputs (inner NeuronOutput classes). The analog vector submitted to the class via the method enterVector() is converted to exactly one spike per output. The higher the analog input number, the earlier the spike on the associated output will be fired. Therefore the output associated to the analog input with the highest value will fire immediately, the other outputs will fire later, determined by "d * (maxValue - vector[i])". This class can optionally use a reference output that fires at the latest time, thus representing the analog input value "0" and marking the end of the spike series emitted by this class.
Inner Class Summary | |
protected class |
TemporalCodedInput.Output
This inner class implements the spike outputs of the TemporalCodedInput class. |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent, javax.swing.JComponent.ActionStandin, javax.swing.JComponent.IntVector, javax.swing.JComponent.KeyboardState |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock |
Field Summary | |
protected double |
lastStartTime
In this variable, the last (absolute) time of starting an input event is stored (the simulation time when enterVector was called). |
protected double[] |
lastVector
In this variable, the last input vector that was entered using this object is stored. |
protected double |
lastZeroTime
In this variable, the end of the last input cycle (the absolute simulation time marking the input value 0) is stored. |
protected double |
multiplicator
This value is uses for computing the delay between the first spike event and following spikes depending on the difference in the input values. |
protected java.util.ArrayList |
outputs
The list of outputs that used for emitting spike events. |
protected TemporalCodedInput.Output |
reference
The reference output, used optionally. |
Fields inherited from class mosaic.sim.kernel.BasicModel |
listenerVariables, priority, simEventComponents |
Fields inherited from class mosaic.sim.kernel.AbstractModelComponent |
application, components, enabled, label, parentModelComponent, sCESupport |
Fields inherited from class javax.swing.JComponent |
_bounds, accessibleContext, actionMap, ACTIONMAP_CREATED, alignmentX, alignmentY, ANCESTOR_INPUTMAP_CREATED, ANCESTOR_USING_BUFFER, ancestorInputMap, ancestorNotifier, autoscroller, border, changeSupport, clientProperties, CREATED_DOUBLE_BUFFER, flags, FOCUS_INPUTMAP_CREATED, focusInputMap, HAS_FOCUS, htmlKey, htmlView, inputVerifier, IS_DOUBLE_BUFFERED, IS_OPAQUE, IS_PAINTING_TILE, IS_PRINTING, IS_PRINTING_ALL, KEY_EVENTS_ENABLED, KEYBOARD_BINDINGS_KEY, listenerList, maximumSize, minimumSize, NEXT_FOCUS, paintImmediatelyClip, paintingChild, preferredSize, readObjectCallbacks, REQUEST_FOCUS_DISABLED, tmpRect, TOOL_TIP_TEXT_KEY, ui, uiClassID, UNDEFINED_CONDITION, verifyInputWhenFocusTarget, vetoableChangeSupport, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW, WHEN_IN_FOCUSED_WINDOW_BINDINGS, WIF_INPUTMAP_CREATED, windowInputMap |
Fields inherited from class java.awt.Container |
component, containerListener, containerSerializedDataVersion, dbg, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads, serialVersionUID |
Fields inherited from class java.awt.Component |
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y |
Fields inherited from interface mosaic.sim.kernel.ModelComponent |
INF, INFINITY, NEGATIVE_INFINITY, NEGINF, NEGINFINITY, POSITIVE_INFINITY |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
TemporalCodedInput(int num,
double multiplicator,
boolean useReferenceOutput)
Creates a new TemporalCodedInput object and initializes the outputs. |
Method Summary | |
void |
enterVector(double[] vector)
Enters a new analog input vector into the simulation. |
double |
getLastStartTime()
Returns the time when the last event was started. |
double[] |
getLastVector()
Returns the last input vector. |
double |
getLastZeroTime()
Return the time when the last event should end (or has ended). |
double |
getMultiplicator()
Returns the multiplicator. |
NeuronOutput |
getOutput(int index)
Implementation of VectorInput.getOutput. |
NeuronOutput |
getReferenceOutput()
Returns the reference output. |
Methods inherited from class mosaic.sim.kernel.BasicModel |
addListenerVariable, addSimEventComponent, addTimeEventComponent, getListenerVariables, getNthListenerVariable, getPriority, processSimEvent, propertyChange, removeListenerVariable, removeSimEventComponent, removeTimeEventComponent, setPriority, variableChange |
Methods inherited from class mosaic.sim.kernel.AbstractModelComponent |
addModelComponent, addModelComponentEventListener, addModelComponentEventListener, addNotify, containsModelComponent, disable, enable, findParentModelComponent, fireModelComponentAdded, fireModelComponentChanged, fireModelComponentChanged, fireModelComponentDisabled, fireModelComponentEnabled, fireModelComponentGotContinuous, fireModelComponentGotDiscrete, fireModelComponentRemoved, getInfo, getLabel, getMinimumSize, getModelComponents, getParentModelComponent, getPreferredSize, getSimApplication, getTime, initialize, isDisabled, isEnabled, paintComponent, printDebugOutput, printDebugOutput, printDebugOutput, printDebugOutput, printErrorOutput, printErrorOutput, printLogOutput, printLogOutput, removeModelComponent, removeModelComponentEventListener, removeModelComponentEventListener, removeNotify, reset, setEnabled, setLabel, setParentModelComponent, setSimApplication |
Methods inherited from class javax.swing.JComponent |
_paintImmediately, |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, adjustListeningChildren, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getLayout, getMouseEventTarget, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, nextFocus, numListening, paintComponents, paintHeavyweightComponents, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFocusOwner, setLayout, transferFocus, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, constructComponentName, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getToolkit, getToolkitImpl, getTreeLock, getWindowForObject, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabledImpl, isLightweight, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resetGC, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
Field Detail |
protected java.util.ArrayList outputs
protected TemporalCodedInput.Output reference
protected double multiplicator
protected double[] lastVector
enterVector(double[])
protected double lastStartTime
enterVector(double[])
protected double lastZeroTime
enterVector(double[])
Constructor Detail |
public TemporalCodedInput(int num, double multiplicator, boolean useReferenceOutput)
num
- The number of outputs, it must be equal to the length of the
analog input vectors that will be given to enterVector().multiplicator
- Sets the proportionality factor d.useReferenceOutput
- When set to true, the class uses a reference
output representing the analog input value
"0".Method Detail |
public void enterVector(double[] vector) throws CodingException
enterVector
in interface VectorInputCoder
vector
- The input vector to be used, the length must be equal to
"num" given to the constructor.public NeuronOutput getOutput(int index)
getOutput
in interface VectorInputCoder
mosaic.sim.neuron.netinputs.VectorInputCoder
index
- The number of the output to return.public NeuronOutput getReferenceOutput()
public double[] getLastVector()
public double getMultiplicator()
public double getLastStartTime()
public double getLastZeroTime()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |