|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wGmdh.jGmdh.oldskul.TwoInputModel.VisitedHt
public class TwoInputModel.VisitedHt
Uses a Hashtable to store pairs of Nodes and inputs for which they have calculated the output, to avoid multiple calculations of the same thing. Hashtable enables calculation if the outputs in paralell, on different Nodes, and for different inputs. (In contrast, take a single boolean flag per Node. This would allow us to mark visited subnodes in a single traversal, for a single input point, making computation in paralell impossible.)
Constructor Summary | |
---|---|
TwoInputModel.VisitedHt()
|
Method Summary | |
---|---|
boolean |
isReset()
|
boolean |
isVisited()
|
void |
onVisit()
Store the pair obtained in feed() to our Hashtable |
void |
resetVisited()
Makes us forget everything we calculated. |
double |
returnOutput()
In case we already have been visited, return the output given this.inputs. |
void |
setInputs(double[] inputs)
Call it before checking with isVisited() or calling onVisit() or returnOutput() to get to know the inputs we're delaing with |
void |
setOutput(double output)
Call it before checking with calling onVisit() to get to know the outputs we're delaing with |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TwoInputModel.VisitedHt()
Method Detail |
---|
public boolean isVisited()
public void onVisit()
public void resetVisited()
public boolean isReset()
public void setInputs(double[] inputs)
inputs
- the inputs to setpublic void setOutput(double output)
output
- the output to setpublic double returnOutput()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |