java.lang.Object
org.unifi.mecvirtualresourceallocation.graph.Vertex

public final class Vertex extends Object
This class represents a vertex in a hypergraph or in a conflict graph. Each vertex is characterized by a unique identifier and a weight. The identifier is used to distinguish between different vertices, while the weight represents the energy consumption.
  • Constructor Details

    • Vertex

      public Vertex(String id, double weight)
      Constructs a new vertex with the specified identifier and weight.
      Parameters:
      id - the unique identifier of the vertex
      weight - the weight associated with the vertex
    • Vertex

      public Vertex(String id, BigDecimal weight)
      Constructs a new vertex with the specified identifier and weight.
      Parameters:
      id - the unique identifier of the vertex
      weight - the weight associated with the vertex
  • Method Details

    • getId

      public String getId()
      Returns the identifier of this vertex.
      Returns:
      the identifier of the vertex
    • setId

      public void setId(String id)
      Sets the identifier of this vertex.
      Parameters:
      id - the new identifier of the vertex
    • getWeight

      public BigDecimal getWeight()
      Returns the weight of this vertex.
      Returns:
      the weight of the vertex
    • getNegativeWeight

      public BigDecimal getNegativeWeight()
      Returns the negative weight of this vertex.
      Returns:
      the negative weight of the vertex
    • toString

      public String toString()
      Returns a string representation of the vertex. The string representation consists of the vertex's identifier and weight, enclosed in curly braces.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the vertex
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object