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

org.cloudbus.cloudsim.network.topologies.TopologicalNode Maven / Gradle / Ivy

Go to download

CloudSim Plus: A modern, highly extensible and easier-to-use Java 8 Framework for Modeling and Simulation of Cloud Computing Infrastructures and Services

There is a newer version: 8.0.0
Show newest version
/*
 * Title:        CloudSim Toolkit
 * Description:  CloudSim (Cloud Simulation) Toolkit for Modeling and Simulation of Clouds
 * Licence:      GPL - http://www.gnu.org/copyleft/gpl.html
 *
 * Copyright (c) 2009-2012, The University of Melbourne, Australia
 */

package org.cloudbus.cloudsim.network.topologies;

import java.util.Objects;

/**
 * Represents an topological network node that retrieves its information from a
 * topological-generated file (eg. topology-generator)
 *
 * @author Thomas Hohnstein
 * @since CloudSim Toolkit 1.0
 */
public class TopologicalNode {

    private int nodeId;

    private String nodeName;

    private Point2D worldCoordinates;

    /**
     * Creates a network topology node with ID equals to zero.
     */
    public TopologicalNode(){
        this(0);
    }

    /**
     * Creates a network topology node with a specific ID.
     *
     * @param nodeId The BRITE id of the node inside the network
     */
    public TopologicalNode(int nodeId) {
        this(nodeId, new Point2D());
    }

    /**
     * Creates a network topology node including world-coordinates.
     *
     * @param nodeId The BRITE id of the node inside the network
     * @param worldCoordinates  the x,y world-coordinates of the Node
     */
    public TopologicalNode(int nodeId, Point2D worldCoordinates) {
        this(nodeId, String.valueOf(nodeId), worldCoordinates);
    }

    /**
     * Creates a network topology node including world-coordinates and the nodeName.
     *
     * @param nodeId   The BRITE id of the node inside the network
     * @param nodeName The name of the node inside the network
     * @param worldCoordinates    the x,y world-coordinates of the Node
     */
    public TopologicalNode(int nodeId, String nodeName, Point2D worldCoordinates) {
        Objects.requireNonNull(worldCoordinates);
        this.nodeId = nodeId;
        this.nodeName = nodeName;
        this.worldCoordinates = worldCoordinates;
    }

    /**
     * Gets the BRITE id of the node inside the network.
     *
     * @return the nodeId
     */
    public int getNodeId() {
        return nodeId;
    }

    public void setNodeId(int nodeId) {
        this.nodeId = nodeId;
    }

    /**
     * Gets the name of the node
     *
     * @return name of the node
     */
    public String getNodeName() {
        return nodeName;
    }

    public void setNodeName(String nodeName) {
        this.nodeName = nodeName;
    }
    /**
     * Gets the x,y world coordinates of this network-node.
     *
     * @return the x,y world coordinates
     */
    public Point2D getWorldCoordinates() {
        return worldCoordinates;
    }

    public void setWorldCoordinates(Point2D worldCoordinates) {
        this.worldCoordinates = worldCoordinates;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy