
de.uni.freiburg.iig.telematik.jagal.graph.weighted.WeightedGraph Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JAGAL Show documentation
Show all versions of JAGAL Show documentation
JAGAL provides implementations for directed graphs (weighted and unweighted) and various types of transition systems as well as utils for graph traversal and modification.
The newest version!
package de.uni.freiburg.iig.telematik.jagal.graph.weighted;
import java.util.Collection;
import de.invation.code.toval.validate.ParameterException;
import de.uni.freiburg.iig.telematik.jagal.graph.Vertex;
public class WeightedGraph extends AbstractWeightedGraph, T>{
public WeightedGraph(){
super();
}
public WeightedGraph(String name) throws ParameterException{
super(name);
}
public WeightedGraph(Collection vertexNames) throws ParameterException{
super(vertexNames);
}
public WeightedGraph(Collection vertexNames, String name) throws ParameterException{
super(name, vertexNames);
}
@Override
protected Vertex createNewVertex(String name, T element) {
return new Vertex<>(name, element);
}
@Override
protected WeightedEdge> createNewEdge(Vertex sourceVertex, Vertex targetVertex) {
return new WeightedEdge<>(sourceVertex, targetVertex);
}
public static void main(String[] args) throws Exception{
WeightedGraph g = new WeightedGraph<>();
g.addVertex("A");
g.addVertex("B");
g.addEdge("A", "B", 0.5);
System.out.println(g);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy