Package mgui.models.dynamic.functions
Class Function
java.lang.Object
mgui.interfaces.AbstractInterfaceObject
mgui.models.dynamic.functions.Function
- All Implemented Interfaces:
AttributeObject,InterfaceObject,NamedObject,TreeObject,CleanableObject
- Direct Known Subclasses:
DecayFunction,HardLimitFunction,ODEFunction,SigmoidFunction
public abstract class Function extends AbstractInterfaceObject implements AttributeObject
Abstract class for all model functions.
- Author:
- Andrew Reid
-
Field Summary
Fields Modifier and Type Field Description AttributeListattributesbooleanisDestroyedFields inherited from class mgui.interfaces.AbstractInterfaceObject
tree_nodes -
Constructor Summary
Constructors Constructor Description Function() -
Method Summary
Modifier and Type Method Description java.lang.Objectclone()voiddestroy()Destroy this object (prepare it to be removed from memory)abstract doubleevaluate(double d)Evaluate function with a single parameter dabstract double[]evaluate(double[] d)Evaluate function with multiple parameters dAttribute<?>getAttribute(java.lang.String attrName)Returns a specific attribute for this object.AttributeListgetAttributes()Returns the list of current attributes for this object.java.lang.ObjectgetAttributeValue(java.lang.String name)Gets the value of attributename, ornullif it does not exist.InterfaceTreeNodegetTreeNodeCopy()protected voidinit()booleanisDestroyed()Test whether this object has been destroyedvoidsetAttribute(java.lang.String attrName, java.lang.Object newValue)Sets a value for a specific attribute.voidsetAttributes(AttributeList thisList)Sets the list of attributes for this object.voidsetTreeNode(InterfaceTreeNode treeNode)Sets the children for this node'sInterfaceTreeNode.java.lang.StringtoString()Methods inherited from class mgui.interfaces.AbstractInterfaceObject
clean, getName, getTreeLabel, issueTreeNode, setName, updateTreeNodesMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface mgui.interfaces.NamedObject
getName, setName
-
Field Details
-
attributes
-
isDestroyed
public boolean isDestroyed
-
-
Constructor Details
-
Function
public Function()
-
-
Method Details
-
init
protected void init() -
evaluate
public abstract double evaluate(double d)Evaluate function with a single parameter d- Parameters:
d-- Returns:
- result of the evaluation
-
evaluate
public abstract double[] evaluate(double[] d)Evaluate function with multiple parameters d- Parameters:
d-- Returns:
- result of the evaluation
-
getAttribute
Description copied from interface:AttributeObjectReturns a specific attribute for this object.- Specified by:
getAttributein interfaceAttributeObject- Returns:
-
getAttributes
Description copied from interface:AttributeObjectReturns the list of current attributes for this object.- Specified by:
getAttributesin interfaceAttributeObject- Returns:
-
setAttribute
public void setAttribute(java.lang.String attrName, java.lang.Object newValue)Description copied from interface:AttributeObjectSets a value for a specific attribute.- Specified by:
setAttributein interfaceAttributeObject
-
setAttributes
Description copied from interface:AttributeObjectSets the list of attributes for this object.- Specified by:
setAttributesin interfaceAttributeObject
-
getAttributeValue
public java.lang.Object getAttributeValue(java.lang.String name)Description copied from interface:AttributeObjectGets the value of attributename, ornullif it does not exist.- Specified by:
getAttributeValuein interfaceAttributeObject- Parameters:
name- Name of the attribute- Returns:
- the value of attribute
name, ornullif it does not exist
-
getTreeNodeCopy
-
setTreeNode
Description copied from interface:TreeObjectSets the children for this node'sInterfaceTreeNode.- Specified by:
setTreeNodein interfaceTreeObject- Overrides:
setTreeNodein classAbstractInterfaceObject
-
clone
public java.lang.Object clone()- Overrides:
clonein classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
destroy
public void destroy()Description copied from interface:InterfaceObjectDestroy this object (prepare it to be removed from memory)- Specified by:
destroyin interfaceInterfaceObject- Overrides:
destroyin classAbstractInterfaceObject
-
isDestroyed
public boolean isDestroyed()Description copied from interface:InterfaceObjectTest whether this object has been destroyed- Specified by:
isDestroyedin interfaceInterfaceObject- Overrides:
isDestroyedin classAbstractInterfaceObject- Returns:
-