Neuroph

org.neuroph.core
Class Weight

java.lang.Object
  extended by org.neuroph.core.Weight
All Implemented Interfaces:
java.io.Serializable

public class Weight
extends java.lang.Object
implements java.io.Serializable

The Weight class represents neuron connection weight.

See Also:
Connection, Serialized Form

Field Summary
private static long serialVersionUID
          The class fingerprint that is set to indicate serialization compatibility with a previous version of the class
private  double value
          Weight value
 
Constructor Summary
Weight()
          Creates an instance of connection weight with random weight value in range [0..1]
Weight(double value)
          Creates an instance of connection weight with the specified weight value
 
Method Summary
 void dec(double amount)
          Decreases the weight for specified amount
 double getValue()
          Returns weight value
 void inc(double amount)
          Increases the weight for the specified amount
 void randomize()
          Sets random weight value
 void setValue(double value)
          Sets the weight value
 java.lang.String toString()
          Returns weight value as String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
The class fingerprint that is set to indicate serialization compatibility with a previous version of the class

See Also:
Constant Field Values

value

private double value
Weight value

Constructor Detail

Weight

public Weight()
Creates an instance of connection weight with random weight value in range [0..1]


Weight

public Weight(double value)
Creates an instance of connection weight with the specified weight value

Parameters:
value - weight value
Method Detail

inc

public void inc(double amount)
Increases the weight for the specified amount

Parameters:
amount - amount to add to current weight value

dec

public void dec(double amount)
Decreases the weight for specified amount

Parameters:
dec_val - amount to subtract from the current weight value

setValue

public void setValue(double value)
Sets the weight value

Parameters:
value - weight value to set

getValue

public double getValue()
Returns weight value

Returns:
value of this weight

toString

public java.lang.String toString()
Returns weight value as String

Overrides:
toString in class java.lang.Object

randomize

public void randomize()
Sets random weight value


Neuroph