Examples of Network


Examples of javaflow.network.api.Network

import javaflow.network.impl.SimpleNetworkBuilder;

public class SpeedTest {
    public static void main(String[] args) {
        final int messageCount = 10000000;
        Network network = new SimpleNetworkBuilder().build(new NetworkDefiner() {{
            from(c("generator", Generator.class)).to(c("expectPackets", ExpectPackets.class));

            from("generator", "STARTNOTIFY").to("START", c("timer", Timer.class));
            from("expectPackets", "ENDNOTIFY").to("END", "timer");

            from("timer").to("TIME",c("results", Results.class));

            message(messageCount).to("COUNT", "generator");
            message(messageCount).to("COUNT", "results");
            message(messageCount).to("COUNT", "expectPackets");

        }});
        network.runInCurrentThread();
    }
View Full Code Here

Examples of jodd.json.mock.Network

    return colors;
  }

  public Network createNetwork(String name, Person... people) {
    return new Network(name, people);
  }
View Full Code Here

Examples of net.yacy.peers.Network

                this.log,
                this.queuesRoot);

        // start yacy core
        this.log.logConfig("Starting YaCy Protocol Core");
        this.yc = new Network(this);
        InstantBusyThread.oneTimeJob(this, "loadSeedLists", Network.log, 0);
        //final long startedSeedListAquisition = System.currentTimeMillis();

        // init a DHT transmission dispatcher
        this.dhtDispatcher = (this.peers.sizeConnected() == 0) ? null : new Dispatcher(
View Full Code Here

Examples of org.apache.commons.math3.ml.neuralnet.Network

        }

        this.wrap = wrap;

        final int fLen = featuresList[0].length;
        network = new Network(0, fLen);
        identifiers = new long[size];

        // Add neurons.
        for (int i = 0; i < size; i++) {
            identifiers[i] = network.createNeuron(featuresList[i]);
View Full Code Here

Examples of org.apache.commons.math3.ml.neuralnet.Network

        size = num;
        this.wrap = wrap;
        identifiers = new long[num];

        final int fLen = featureInit.length;
        network = new Network(0, fLen);

        // Add neurons.
        for (int i = 0; i < num; i++) {
            final double[] features = new double[fLen];
            for (int fIndex = 0; fIndex < fLen; fIndex++) {
View Full Code Here

Examples of org.apache.commons.math3.ml.neuralnet.Network

        wrapRows = wrapRowDim;
        wrapColumns = wrapColDim;
        neighbourhood = neighbourhoodType;

        final int fLen = featuresList[0][0].length;
        network = new Network(0, fLen);
        identifiers = new long[numberOfRows][numberOfColumns];

        // Add neurons.
        for (int i = 0; i < numberOfRows; i++) {
            for (int j = 0; j < numberOfColumns; j++) {
View Full Code Here

Examples of org.apache.commons.math3.ml.neuralnet.Network

        wrapColumns = wrapColDim;
        neighbourhood = neighbourhoodType;
        identifiers = new long[numberOfRows][numberOfColumns];

        final int fLen = featureInit.length;
        network = new Network(0, fLen);

        // Add neurons.
        for (int i = 0; i < numRows; i++) {
            for (int j = 0; j < numCols; j++) {
                final double[] features = new double[fLen];
View Full Code Here

Examples of org.apache.commons.math3.ml.neuralnet.Network

     20----21----22----23---24
     */
    @Test
    public void testConcentricNeighbourhood() {
        final FeatureInitializer[] initArray = { init };
        final Network net = new NeuronSquareMesh2D(5, true,
                                             5, true,
                                             SquareNeighbourhood.VON_NEUMANN,
                                             initArray).getNetwork();

        Collection<Neuron> neighbours;
        Collection<Neuron> exclude = new HashSet<Neuron>();

        // Level-1 neighbourhood.
        neighbours = net.getNeighbours(net.getNeuron(12));
        for (long nId : new long[] { 7, 11, 13, 17 }) {
            Assert.assertTrue(neighbours.contains(net.getNeuron(nId)));
        }
        // Ensures that no other neurons is in the neihbourhood set.
        Assert.assertEquals(4, neighbours.size());

        // 1. Add the neuron to the "exclude" list.
        exclude.add(net.getNeuron(12));
        // 2. Add all neurons from level-1 neighbourhood.
        exclude.addAll(neighbours);
        // 3. Retrieve level-2 neighbourhood.
        neighbours = net.getNeighbours(neighbours, exclude);
        for (long nId : new long[] { 6, 8, 16, 18, 2, 10, 14, 22 }) {
            Assert.assertTrue(neighbours.contains(net.getNeuron(nId)));
        }
        // Ensures that no other neurons is in the neihbourhood set.
        Assert.assertEquals(8, neighbours.size());
    }
View Full Code Here

Examples of org.apache.commons.math3.ml.neuralnet.Network

     20----21----22----23---24
     */
    @Test
    public void testConcentricNeighbourhood2() {
        final FeatureInitializer[] initArray = { init };
        final Network net = new NeuronSquareMesh2D(5, true,
                                                   5, true,
                                                   SquareNeighbourhood.MOORE,
                                                   initArray).getNetwork();

        Collection<Neuron> neighbours;
        Collection<Neuron> exclude = new HashSet<Neuron>();

        // Level-1 neighbourhood.
        neighbours = net.getNeighbours(net.getNeuron(8));
        for (long nId : new long[] { 2, 3, 4, 7, 9, 12, 13, 14 }) {
            Assert.assertTrue(neighbours.contains(net.getNeuron(nId)));
        }
        // Ensures that no other neurons is in the neihbourhood set.
        Assert.assertEquals(8, neighbours.size());

        // 1. Add the neuron to the "exclude" list.
        exclude.add(net.getNeuron(8));
        // 2. Add all neurons from level-1 neighbourhood.
        exclude.addAll(neighbours);
        // 3. Retrieve level-2 neighbourhood.
        neighbours = net.getNeighbours(neighbours, exclude);
        for (long nId : new long[] { 1, 6, 11, 16, 17, 18, 19, 15, 10, 5, 0, 20, 24, 23, 22, 21 }) {
            Assert.assertTrue(neighbours.contains(net.getNeuron(nId)));
        }
        // Ensures that no other neurons is in the neihbourhood set.
        Assert.assertEquals(16, neighbours.size());
    }
View Full Code Here

Examples of org.apache.commons.math3.ml.neuralnet.Network

    @Test
    public void testGetFeaturesSize() {
        final FeatureInitializer[] initArray = { init, init, init };

        final Network net = new NeuronSquareMesh2D(2, false,
                                                   2, false,
                                                   SquareNeighbourhood.VON_NEUMANN,
                                                   initArray).getNetwork();
        Assert.assertEquals(3, net.getFeaturesSize());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.