org.encog.neural.networks.structure
Class SynapseComparator

java.lang.Object
  extended by org.encog.neural.networks.structure.SynapseComparator
All Implemented Interfaces:
Comparator<Synapse>

public class SynapseComparator
extends Object
implements Comparator<Synapse>

Used to compare the order of synapses. Allows synapses to be sorted the same way each time. They are sorted from output back to input.


Constructor Summary
SynapseComparator(NeuralStructure structure)
          Construct a layer comparator.
 
Method Summary
 int compare(Synapse synapse1, Synapse synapse2)
          Compare two layers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

SynapseComparator

public SynapseComparator(NeuralStructure structure)
Construct a layer comparator.

Parameters:
structure - The structure of the network to use.
Method Detail

compare

public int compare(Synapse synapse1,
                   Synapse synapse2)
Compare two layers.

Specified by:
compare in interface Comparator<Synapse>
Parameters:
synapse1 - The first layer to compare.
synapse2 - The second layer to compare.
Returns:
The value 0 if the argument layer is equal to this synapse; a value less than 0 if this synapse is less than the argument; and a value greater than 0 if this synapse is greater than the synapse argument.


Copyright © 2011. All Rights Reserved.