simbad.piconode.visual
Class NNNode

java.lang.Object
  extended by simbad.piconode.visual.NNShape
      extended by simbad.piconode.visual.NNNode

public class NNNode
extends NNShape

This class provides neuron representation, graphics and attributes


Field Summary
static int _HIDDEN
           
static int _INPUT
           
static int _OUTPUT
           
static int _RAYON
           
static int _UNKNOWN
           
private  java.lang.String function
           
static java.lang.String[] functions
           
(package private)  java.util.Vector inputArcs
           
private  int myId
           
private static int nbHiddenNode
           
private static int nbInputNode
           
private static int nbNode
           
private static int nbOutputNode
           
(package private)  java.util.Vector outputArcs
           
private  int positionX
           
private  int positionY
           
private  java.lang.String type
           
static java.lang.String[] types
           
private  boolean undernode
           
(package private)  java.lang.String underNodeDescription
           
private  double valeur
           
 
Fields inherited from class simbad.piconode.visual.NNShape
color, id, inverseTempSelection, name, selected
 
Constructor Summary
NNNode()
           
NNNode(int x, int y, boolean gridActivated)
          Constructor from scratch
NNNode(NNNode node_arg)
          Constructor, copy the node passed in argument and modify its position.
NNNode(java.lang.String idnumber_arg, java.lang.String name_arg, java.lang.String type_arg, java.lang.String function_arg, java.lang.String x_arg, java.lang.String y_arg, java.lang.String red_arg, java.lang.String green_arg, java.lang.String blue_arg)
          Constructor: used to convert an xml string into a Node
 
Method Summary
(package private)  boolean contains(int x_arg, int y_arg)
          return true if the point is included in the circle.
 void delete(NNList list)
          delete a node
(package private)  void generateId()
          Generate an Id if necessary
 java.lang.String getFunction()
           
protected  java.util.Vector getInputArcs()
           
 int getMyId()
           
protected  java.util.Vector getOutputArcs()
           
 int getPositionX()
           
 int getPositionY()
           
 java.lang.String getType()
           
 java.lang.String getUnderNode()
           
 double getValeur()
           
 boolean hasUnderNode()
           
(package private)  boolean isInRect(java.awt.Rectangle rect)
          return true if the center of the node is placed in the rect
(package private)  void paint(java.awt.Graphics2D g2)
           
protected  void replace(int number)
          replace a node considering his type and number.
 void replaceForGrid()
          Recalculate x and y in function of the grid
(package private) static void resetNbNode()
          Reset the number of nodes in the program
 void setFunction(int function)
           
 void setFunction(java.lang.String function)
           
protected  void setInputArcs(java.util.Vector inputArcs)
           
 void setMyId(int myId)
           
protected  void setOutputArcs(java.util.Vector outputArcs)
           
 void setPositionX(int positionX)
           
 void setPositionY(int positionY)
           
 void setType(int type)
           
 void setType(java.lang.String type)
           
 void setValeur(double valeur)
           
 java.lang.String toXML()
          Convert the node in an XML string
 void translate(int dx, int dy)
          translate the neuron of dx in x and dy in y
 
Methods inherited from class simbad.piconode.visual.NNShape
getColor, getName, inverseSelectionState, isInverseTempSelection, isSelected, setColor, setInverseTempSelection, setName, setSelected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_RAYON

public static final int _RAYON
See Also:
Constant Field Values

_UNKNOWN

public static final int _UNKNOWN
See Also:
Constant Field Values

_INPUT

public static final int _INPUT
See Also:
Constant Field Values

_OUTPUT

public static final int _OUTPUT
See Also:
Constant Field Values

_HIDDEN

public static final int _HIDDEN
See Also:
Constant Field Values

types

public static final java.lang.String[] types

functions

public static final java.lang.String[] functions

nbNode

private static int nbNode

nbInputNode

private static int nbInputNode

nbOutputNode

private static int nbOutputNode

nbHiddenNode

private static int nbHiddenNode

positionX

private int positionX

positionY

private int positionY

type

private java.lang.String type

function

private java.lang.String function

valeur

private double valeur

myId

private int myId

underNodeDescription

java.lang.String underNodeDescription

undernode

private boolean undernode

inputArcs

java.util.Vector inputArcs

outputArcs

java.util.Vector outputArcs
Constructor Detail

NNNode

NNNode(int x,
       int y,
       boolean gridActivated)
Constructor from scratch

Parameters:
x - the x coordinate of the graphic representation
y - the y coordinate
gridActivated - indicates wether grid is set in NNCanvas.

NNNode

NNNode(NNNode node_arg)
Constructor, copy the node passed in argument and modify its position.

Parameters:
node_arg - the node to copy

NNNode

NNNode(java.lang.String idnumber_arg,
       java.lang.String name_arg,
       java.lang.String type_arg,
       java.lang.String function_arg,
       java.lang.String x_arg,
       java.lang.String y_arg,
       java.lang.String red_arg,
       java.lang.String green_arg,
       java.lang.String blue_arg)
Constructor: used to convert an xml string into a Node

Parameters:
idnumber_arg -
name_arg -
type_arg -
function_arg -
x_arg -
y_arg -
red_arg -
green_arg -
blue_arg -

NNNode

NNNode()
Method Detail

generateId

void generateId()
Generate an Id if necessary


resetNbNode

static void resetNbNode()
Reset the number of nodes in the program


delete

public void delete(NNList list)
delete a node

Parameters:
list - the list from wich the node has to be deleted

replace

protected void replace(int number)
replace a node considering his type and number.

Parameters:
number - : number zero will be placed in bottom case,number two in the third case etc...

isInRect

boolean isInRect(java.awt.Rectangle rect)
return true if the center of the node is placed in the rect

Parameters:
rect -
Returns:

contains

boolean contains(int x_arg,
                 int y_arg)
return true if the point is included in the circle.

Parameters:
x_arg -
y_arg -
Returns:

getPositionX

public int getPositionX()

setPositionX

public void setPositionX(int positionX)

getPositionY

public int getPositionY()

setPositionY

public void setPositionY(int positionY)

paint

void paint(java.awt.Graphics2D g2)
Specified by:
paint in class NNShape

translate

public void translate(int dx,
                      int dy)
translate the neuron of dx in x and dy in y

Parameters:
dx -
dy -

getFunction

public java.lang.String getFunction()

setFunction

public void setFunction(java.lang.String function)

setFunction

public void setFunction(int function)

getType

public java.lang.String getType()

setType

public void setType(java.lang.String type)

setType

public void setType(int type)

getValeur

public double getValeur()

setValeur

public void setValeur(double valeur)

toXML

public java.lang.String toXML()
Convert the node in an XML string

Specified by:
toXML in class NNShape

getMyId

public int getMyId()

setMyId

public void setMyId(int myId)

replaceForGrid

public void replaceForGrid()
Recalculate x and y in function of the grid


getInputArcs

protected java.util.Vector getInputArcs()

setInputArcs

protected void setInputArcs(java.util.Vector inputArcs)

getOutputArcs

protected java.util.Vector getOutputArcs()

setOutputArcs

protected void setOutputArcs(java.util.Vector outputArcs)

hasUnderNode

public boolean hasUnderNode()

getUnderNode

public java.lang.String getUnderNode()