Example usage for java.lang.reflect UndeclaredThrowableException printStackTrace

List of usage examples for java.lang.reflect UndeclaredThrowableException printStackTrace

Introduction

In this page you can find the example usage for java.lang.reflect UndeclaredThrowableException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:syncleus.gremlann.SomBrainTest.java

@Test
public void testEmptySOM() throws Throwable {
    try {/*  w  w w  .  ja  va2s  .c  o m*/
        SOM som = new SOM(graph.addVertex(), new SomExponentialDecay(10, 0.1), 3, 4);

        assertNotNull(som);

        assertEquals(4, Iterables.size(som.getInputs()));

        assertEquals(1 /* the SOM "brain" itself */ + 4 /* inputs */, Iterators.size(graph.V()));

        som.addOutput(0, 0, 0);
        som.addOutput(1, 1, 1);

        assertEquals(1 /* the SOM "brain" itself */ + 4 /* inputs */ + 2 /* outputs */,
                Iterators.size(graph.V()));

        assertEquals(2, Iterables.size(som.getOutputs()));

        Table w = som.getOutputWeights();
        assertEquals(8, w.size());

        som.input(0.75, 0.25, 0.33, 0.10);

        assertEquals(3, som.getBestMatchingUnit(true).getDimension());

        som.addOutput(0.25, 0.25, 0.25);
        assertEquals(3, Iterables.size(som.getOutputs()));
        assertEquals(12, som.getOutputWeights().size());

        som.getBestMatchingUnit(true);

        assertEquals(2, som.getIterationsTrained());
    } catch (UndeclaredThrowableException t) {
        t.printStackTrace();
        throw t.getCause();
    }

}