|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--lnsc.AbstractFunctionalUnit
Abstract class containing the basic implementation for the
FunctionalUnit
interface.
In order to implement the FunctionalUnit
interface,
subclasses need the following 3 things:
m_InputCount
,
m_OutputCount
, m_IsDifferentiable
, and
m_IsStateless
must be filled appropriately. processDataSet(DataSet, String[])
or
processPattern(double[], boolean)
must be implemented and should prefrerably begin by calling
preProcessDataSet(DataSet, String[])
or
preProcessPattern(double[], boolean)
respectively.
For non stateless function, reset()
must be added.FunctionalUnit
are Serializable
and
Cloneable
, any required extra code to make these
interfaces work properly should be added. It is necessary to at
least set the private static serialVersionUID
variable
appropriately for the Seriablizable
interface. For
complex objects, the Cloneable
interface can rely on
Tools.copyObject(Serializable)
.
Tools.copyObject(Serializable)
,
Serialized FormNested Class Summary |
Nested classes inherited from class lnsc.FunctionalUnit |
FunctionalUnit.ProcessPatternResult |
Field Summary |
Fields inherited from interface lnsc.FunctionalUnit |
EMPTY_PATTERN |
Constructor Summary | |
AbstractFunctionalUnit()
|
Method Summary | |
java.lang.Object |
clone()
|
int |
getInputCount()
Indicates the number of variables of the function. |
int |
getOutputCount()
Indicates the number of values returned by the function. |
boolean |
isDifferentiable()
Indicates whether or not the function is differentiable. |
boolean |
isStateless()
Indicates whether or not the function output depends solely of the current input (and not of the previous pattern it has processed). |
boolean |
isTwiceDifferentiable()
Indicates whether or not the function is twice differentiable. |
DataSet |
processDataSet(DataSet dataSet,
java.lang.String[] recordList)
Processes a set of input patterns and record the requested information. |
FunctionalUnit.ProcessPatternResult |
processPattern(double[] inputPattern,
boolean computeDerivative,
boolean computeSecondDerivative)
Processes an input pattern and returns its output pattern and derivative (if requested). |
void |
reset()
Reset internal transient state for non stateless functions. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AbstractFunctionalUnit()
Method Detail |
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface FunctionalUnit
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public final int getInputCount()
FunctionalUnit
getInputCount
in interface FunctionalUnit
public final int getOutputCount()
FunctionalUnit
getOutputCount
in interface FunctionalUnit
public final boolean isDifferentiable()
FunctionalUnit
isDifferentiable
in interface FunctionalUnit
true
if it differentiable, false
otherwise.public final boolean isStateless()
FunctionalUnit
isStateless
in interface FunctionalUnit
true
if output depends solely on current input
false
otherwise.public final boolean isTwiceDifferentiable()
FunctionalUnit
isTwiceDifferentiable
in interface FunctionalUnit
true
if it twice differentiable,
false
otherwise.public DataSet processDataSet(DataSet dataSet, java.lang.String[] recordList)
FunctionalUnit
DataNames.DERIVATIVES
, for the second derivatives use
DataNames.SECOND_DERIVATIVES
and for the error patterns, use
DataNames.ERROR_PATTERNS
. Derivatives are available only when
the function is differentiable. Error patterns required
DataNames.TARGET_PATTERNS
to be in the provided data set.
processDataSet
in interface FunctionalUnit
DataNames.OUTPUT_PATTERNS
and any other keywords
supported requested. Each FunctionalUnit
may provide extra keywords of its own.DataNames
public FunctionalUnit.ProcessPatternResult processPattern(double[] inputPattern, boolean computeDerivative, boolean computeSecondDerivative)
FunctionalUnit
processPattern
in interface FunctionalUnit
public void reset()
FunctionalUnit
reset
in interface FunctionalUnit
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |