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 AttributeList
attributes
boolean
isDestroyed
Fields inherited from class mgui.interfaces.AbstractInterfaceObject
tree_nodes
-
Constructor Summary
Constructors Constructor Description Function()
-
Method Summary
Modifier and Type Method Description java.lang.Object
clone()
void
destroy()
Destroy this object (prepare it to be removed from memory)abstract double
evaluate(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.AttributeList
getAttributes()
Returns the list of current attributes for this object.java.lang.Object
getAttributeValue(java.lang.String name)
Gets the value of attributename
, ornull
if it does not exist.InterfaceTreeNode
getTreeNodeCopy()
protected void
init()
boolean
isDestroyed()
Test whether this object has been destroyedvoid
setAttribute(java.lang.String attrName, java.lang.Object newValue)
Sets a value for a specific attribute.void
setAttributes(AttributeList thisList)
Sets the list of attributes for this object.void
setTreeNode(InterfaceTreeNode treeNode)
Sets the children for this node'sInterfaceTreeNode
.java.lang.String
toString()
Methods inherited from class mgui.interfaces.AbstractInterfaceObject
clean, getName, getTreeLabel, issueTreeNode, setName, updateTreeNodes
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:AttributeObject
Returns a specific attribute for this object.- Specified by:
getAttribute
in interfaceAttributeObject
- Returns:
-
getAttributes
Description copied from interface:AttributeObject
Returns the list of current attributes for this object.- Specified by:
getAttributes
in interfaceAttributeObject
- 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.- Specified by:
setAttribute
in interfaceAttributeObject
-
setAttributes
Description copied from interface:AttributeObject
Sets the list of attributes for this object.- Specified by:
setAttributes
in interfaceAttributeObject
-
getAttributeValue
public java.lang.Object getAttributeValue(java.lang.String name)Description copied from interface:AttributeObject
Gets the value of attributename
, ornull
if it does not exist.- Specified by:
getAttributeValue
in interfaceAttributeObject
- Parameters:
name
- Name of the attribute- Returns:
- the value of attribute
name
, ornull
if it does not exist
-
getTreeNodeCopy
-
setTreeNode
Description copied from interface:TreeObject
Sets the children for this node'sInterfaceTreeNode
.- Specified by:
setTreeNode
in interfaceTreeObject
- Overrides:
setTreeNode
in classAbstractInterfaceObject
-
clone
public java.lang.Object clone()- Overrides:
clone
in classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
destroy
public void destroy()Description copied from interface:InterfaceObject
Destroy this object (prepare it to be removed from memory)- Specified by:
destroy
in interfaceInterfaceObject
- Overrides:
destroy
in classAbstractInterfaceObject
-
isDestroyed
public boolean isDestroyed()Description copied from interface:InterfaceObject
Test whether this object has been destroyed- Specified by:
isDestroyed
in interfaceInterfaceObject
- Overrides:
isDestroyed
in classAbstractInterfaceObject
- Returns:
-