org.fraid.function
Class RungeKuttaFunction

java.lang.Object
  extended by org.fraid.function.ComplexFunction
      extended by org.fraid.function.DefinedFunction
          extended by org.fraid.function.RungeKuttaFunction
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.event.ChangeListener

public class RungeKuttaFunction
extends DefinedFunction
implements javax.swing.event.ChangeListener

This is a hack to make the differential equation plot listen to the variable changes. It has features of SampledFunction (mSamples) and DefinedFunction (mListeners) see org.fraid.utils.functions.rk and org.fraid.utils.functions.rk1

See Also:
Serialized Form

Field Summary
 Samples mSamples
           
 
Fields inherited from class org.fraid.function.DefinedFunction
mCore, mGenerator, mListeners
 
Fields inherited from class org.fraid.function.ComplexFunction
mName, mNumberOfArguments
 
Constructor Summary
RungeKuttaFunction(java.lang.String aFunctionName)
           
 
Method Summary
 java.lang.Object clone()
          Used when a panel is cloned to be saved in a file.
 java.lang.String getDependancies()
          On what other definitions this function depends.
 int getNumberOfArguments()
          How many arguments this function takes.
 void init()
           
 Complex invoke(Complex[] args)
          The actual call to the function.
 void setFunctions(java.util.Vector aFunctions)
           
 void setInitialValues(DefinedFunction[] aInitialValues)
           
 void setLength(DefinedFunction aLength)
           
 void setPeers(RungeKuttaFunction[] aPeers)
           
 void setTimeBegin(DefinedFunction aTimeBegin)
           
 void setTimeEnd(DefinedFunction aTimeEnd)
           
 void stateChanged(javax.swing.event.ChangeEvent aEvent)
           
 java.lang.String toString()
          The String representataion (DefinedFunction gives you back the complete definition).
 
Methods inherited from class org.fraid.function.DefinedFunction
addChangeListener, clearGenerator, copyFunctionality, createDummyArgumentList, duplicateListenersToNode, getArgumentsDescription, getBaseSampledFunction, getBaseSamples, getDefinedFunction, getDependancies, getEvaluatedSamples, getGenerator, getRoot, getSamples, getSignature, isBasedOnSampled, isSampled, isTreeBasedGenerated, notifyListeners, regenerate, removeChangeListener, rename, setArgumentsDescription, setGenerator, setRegenerationFlag, setRoot, setSamples, toStringGenerated, toStringSamples
 
Methods inherited from class org.fraid.function.ComplexFunction
exec, getName, setName, setNumberOfArguments
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mSamples

public Samples mSamples
Constructor Detail

RungeKuttaFunction

public RungeKuttaFunction(java.lang.String aFunctionName)
                   throws SymbTableException
Throws:
SymbTableException
Method Detail

invoke

public Complex invoke(Complex[] args)
               throws java.lang.Exception
Description copied from class: ComplexFunction
The actual call to the function.

Overrides:
invoke in class DefinedFunction
Parameters:
args - the arguments, can be (and usualy are) SimpleNode's
Returns:
a Complex value
Throws:
java.lang.Exception - if an error occurs
See Also:
SimpleNode

getNumberOfArguments

public int getNumberOfArguments()
Description copied from class: ComplexFunction
How many arguments this function takes. Used for identification only, the function can actually process diff. number.

Overrides:
getNumberOfArguments in class DefinedFunction
Returns:
an int value

clone

public java.lang.Object clone()
Description copied from class: ComplexFunction
Used when a panel is cloned to be saved in a file. The clone is transient (not included in the symbtable). This ensures the function won't change while we are generating large files.

Overrides:
clone in class DefinedFunction
Returns:
an Object value

toString

public java.lang.String toString()
Description copied from class: ComplexFunction
The String representataion (DefinedFunction gives you back the complete definition).

Overrides:
toString in class DefinedFunction
Returns:
a String value
See Also:
DefinedFunction

getDependancies

public java.lang.String getDependancies()
Description copied from class: ComplexFunction
On what other definitions this function depends. Example: a=5; b='a; //now b depends on a, if I want to use it tomorrow need to save the whole thing.

Overrides:
getDependancies in class DefinedFunction
Returns:
a String value
See Also:
DefinedFunction

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent aEvent)
Specified by:
stateChanged in interface javax.swing.event.ChangeListener

setFunctions

public void setFunctions(java.util.Vector aFunctions)

setInitialValues

public void setInitialValues(DefinedFunction[] aInitialValues)

setTimeBegin

public void setTimeBegin(DefinedFunction aTimeBegin)

setTimeEnd

public void setTimeEnd(DefinedFunction aTimeEnd)

setLength

public void setLength(DefinedFunction aLength)

setPeers

public void setPeers(RungeKuttaFunction[] aPeers)

init

public void init()
          throws java.lang.Exception
Throws:
java.lang.Exception


Fraid (system and language). (C) 2003-2007 Ivaylo Iliev
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.