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

Neuron connection weight.

Author:
Zoran Sevarac
See Also:
Connection, Serialized Form

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 getPreviousValue()
          Returns previous weight value
 double getValue()
          Returns weight value
 void inc(double amount)
          Increases the weight for the specified amount
 void randomize()
          Sets random weight value
 void setPreviousValue(double previousValue)
          Sets the previous 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
 

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:
amount - 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

setPreviousValue

public void setPreviousValue(double previousValue)
Sets the previous weight value

Parameters:
previousValue - weight value to set

getPreviousValue

public double getPreviousValue()
Returns previous 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