Class AbstractNeuroComponent

java.lang.Object
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable<DynamicModelComponent>, AttributeListener, AttributeObject, InterfaceObject, NamedObject, TreeObject, CleanableObject, DynamicModelComponent, TimeStepListener, Updateable
Direct Known Subclasses:
AbstractCorticalConnection, AbstractCorticalOutput, AbstractCorticalRegion, AbstractNeuron, AbstractNeuronalComponent, CompartmentalComponent, CorticalRegion

public abstract class AbstractNeuroComponent
extends AbstractNetworkComponent

Abstract generic class for neuro model components to inherit. Contains two lists, one for events and one for connections. This class forces an implementation of clone() by its subclasses; as a general policy clones of model components should ensure that components states are also preserved in a clone.

All subclasses of this class should add its parameters as Attributes. These parameters should have their own get and set methods implemented. Primitives should be wrapped by instances of arNumber (java wrappers such as Integer are fine too, but do not allow their values to be dynamically changed...)

Variables (e.g., clock) should be declared as individual class members.

Version:
1.0
Author:
Andrew Reid
  • Field Details

    • solver

      protected org.opensourcephysics.numerics.ODESolver solver
    • listeners

      public java.util.ArrayList<InterfaceNetworkComponentListener> listeners
    • events

      protected java.util.ArrayList<DynamicModelEvent> events
    • connections

      protected java.util.ArrayList<DynamicModelComponent> connections
    • clock

      protected double clock
    • attributes

      protected AttributeList attributes
    • id

      protected long id
    • hasSubComponents

      public boolean hasSubComponents
    • updated

      public boolean updated
  • Constructor Details

    • AbstractNeuroComponent

      public AbstractNeuroComponent()
  • Method Details

    • init

      protected void init()
    • setName

      public void setName​(java.lang.String name)
      Description copied from interface: NamedObject
      Sets the name for this object.
      Specified by:
      setName in interface NamedObject
      Overrides:
      setName in class AbstractInterfaceObject
    • getName

      public java.lang.String getName()
      Description copied from interface: NamedObject
      Gets the name for this object.
      Specified by:
      getName in interface NamedObject
      Overrides:
      getName in class AbstractInterfaceObject
      Returns:
    • setSolver

      public void setSolver()
    • setSolver

      public void setSolver​(java.lang.String str)
    • getSolver

      public java.lang.String getSolver()
    • setODESolver

      public void setODESolver​(org.opensourcephysics.numerics.ODESolver solver)
    • getODESolver

      public org.opensourcephysics.numerics.ODESolver getODESolver()
    • setDelay

      public void setDelay​(double delay)
    • getDelay

      public double getDelay()
    • setID

      public void setID​(long id)
    • setID

      public void setID​(long id, boolean update)
    • getConnections

      public java.util.ArrayList<DynamicModelComponent> getConnections()
    • getID

      public long getID()
    • addListener

      public void addListener​(InterfaceNetworkComponentListener l)
    • removeListener

      public void removeListener​(InterfaceNeuroComponentListener l)
    • fireListeners

      protected void fireListeners()
    • fireListeners

      protected void fireListeners​(int code)
    • addEvent

      public void addEvent​(DynamicModelEvent e)
    • addConnection

      public void addConnection​(DynamicModelComponent c)
    • removeConnection

      public void removeConnection​(DynamicModelComponent c)
    • reset

      public void reset()
    • executeEvents

      public boolean executeEvents​(double step)
      Description copied from interface: DynamicModelComponent
      Executes any events in this component's event cue and clears the cue.
      Returns:
      true if successful, false if errors encountered
    • timeElapsed

      public void timeElapsed​(double time)
    • resetClock

      public void resetClock()
    • executeEvent

      protected boolean executeEvent​(DynamicModelEvent e) throws NeuroException
      Throws:
      NeuroException
    • updateFromClock

      protected boolean updateFromClock()
    • updateComponent

      protected boolean updateComponent()
    • getRate

      public void getRate​(double[] state, double[] rate)
    • addToEngine

      public void addToEngine​(DynamicModelEngine e)
    • clone

      public abstract java.lang.Object clone()
      Specified by:
      clone in interface DynamicModelComponent
      Overrides:
      clone in class AbstractNetworkComponent
    • getAttribute

      public Attribute getAttribute​(java.lang.String attrName)
      Description copied from interface: AttributeObject
      Returns a specific attribute for this object.
      Returns:
    • getAttributes

      public AttributeList getAttributes()
      Description copied from interface: AttributeObject
      Returns the list of current attributes for this object.
      Returns:
    • setAttribute

      public void setAttribute​(java.lang.String attrName, java.lang.Object newValue)
      Description copied from interface: AttributeObject
      Sets a value for a specific attribute.
    • setAttributes

      public void setAttributes​(AttributeList thisList)
      Description copied from interface: AttributeObject
      Sets the list of attributes for this object.
    • attributeUpdated

      public void attributeUpdated​(AttributeEvent e)
      Description copied from interface: AttributeListener
      Called when an Attribute's value has been updated.
    • compareTo

      public int compareTo​(DynamicModelComponent c)
    • getSubComponents

      public java.util.ArrayList<DynamicModelComponent> getSubComponents()
      Returns a list of the complete subcomponent tree. Subclasses containing subcomponents should override this and provide an enumeration of all subcomponents, also calling this method for each subcomponent to ensure a complete tree is returned.
    • hasSubComponents

      public boolean hasSubComponents()
      Indicates whether this component has subcomponents. Subclasses containing subcomponents should set the hasSubComponents flag to true.