All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.deeplearning4j.ui.flow.beans.LayerInfo Maven / Gradle / Ivy

There is a newer version: 1.0.0-M2.1
Show newest version
package org.deeplearning4j.ui.flow.beans;

import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * This bean describes abstract layer and it's connections
 *
 * @author [email protected]
 */
@Data
public class LayerInfo implements Serializable {
    private final static long serialVersionUID = 119L;
    private long id;
    private String name;
    private String layerType;

    private String color;

    //   grid coordinates. row & column
    private int x = 0;
    private int y = 0;

    private Description description;

    // set of connections as grid coordinates
    private List connections = new ArrayList<>();

    public void addConnection(LayerInfo layerInfo) {
        if (!connections.contains(Coords.makeCoors(layerInfo.getX(), layerInfo.getY()))) {
            connections.add(Coords.makeCoors(layerInfo.getX(), layerInfo.getY()));
        }
    }

    public void addConnection(int x, int y) {
        if (!connections.contains(Coords.makeCoors(x, y)))
            connections.add(Coords.makeCoors(x, y));
    }

    public void dropConnection(int x, int y) {
        connections.remove(Coords.makeCoors(x, y));
    }

    public void dropConnections() {
        connections.clear();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy