本文整理汇总了Java中org.jgrapht.graph.Pseudograph类的典型用法代码示例。如果您正苦于以下问题:Java Pseudograph类的具体用法?Java Pseudograph怎么用?Java Pseudograph使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Pseudograph类属于org.jgrapht.graph包,在下文中一共展示了Pseudograph类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: GKAGraph
import org.jgrapht.graph.Pseudograph; //导入依赖的package包/类
private GKAGraph(GraphType type){
this.type = type;
// Choose if it will be directed or undirected
if (isDirected()){
jGraph = new ListenableDirectedGraph<>(new DirectedPseudograph<>(GKAEdge.class));
}else{
jGraph = new ListenableUndirectedGraph<>(new Pseudograph<>(GKAEdge.class));
}
// JGXAdapter for showing the Graph in Swing
mxgraph = new JGraphXAdapter<>(getjGraph());
// Changing EdgeStyle when is undirected
if (!isDirected()){
getMxgraph().getStylesheet().getDefaultEdgeStyle().put(mxConstants.STYLE_ENDARROW, "none");
}
setGraphConfig();
}
开发者ID:JanaWengenroth,项目名称:GKA1,代码行数:20,代码来源:GKAGraph.java
示例2: Graph
import org.jgrapht.graph.Pseudograph; //导入依赖的package包/类
public Graph(GeometryCollection lines) {
graph = new Pseudograph<>(LineString.class);
int nLines = lines.getNumGeometries();
for (int i = 0; i < nLines; i++) {
LineString line = (LineString) lines.getGeometryN(i);
addEdge(line);
}
fixConnectivity();
assert (testConnectivity());
}
开发者ID:OSUCartography,项目名称:PyramidShader,代码行数:12,代码来源:Graph.java
示例3: DataSet
import org.jgrapht.graph.Pseudograph; //导入依赖的package包/类
/**
* Base constructor.
*/
public DataSet() {
this.superNetwork = new Variable<SuperNetwork>(new SuperNetwork(null, new Pseudograph<HNode, DefaultEdge>(DefaultEdge.class)));
this.nodeMap = new Variable<Map<CyNode, HNode>>(new HashMap<CyNode, HNode>());
this.minScore = new Variable<Double>(0.);
this.maxScore = new Variable<Double>(1.);
this.categories = new Variable<Map<String, HCategory>>(new HashMap<String, HCategory>());
this.setMap = new Variable<Map<CyNode, HSet>>(new HashMap<CyNode, HSet>());
}
开发者ID:ls-cwi,项目名称:eXamine,代码行数:12,代码来源:DataSet.java
示例4: Model
import org.jgrapht.graph.Pseudograph; //导入依赖的package包/类
public Model() {
this.selection = new Selection(this);
this.openedCategories = new VolatileSet<HCategory>();
this.orderedCategories =
new Variable<List<HCategory>>(Collections.<HCategory>emptyList());
this.highlightedProteins = new VolatileSet<HNode>();
this.highlightedInteractions = new VolatileSet<DefaultEdge>();
this.highlightedSets = new VolatileSet<HSet>();
this.activeNetwork = new Variable<Network>(new SuperNetwork(null,
new Pseudograph<HNode, DefaultEdge>(DefaultEdge.class)));
this.selectionMode = Constants.Selection.NONE;
}
开发者ID:ls-cwi,项目名称:eXamine,代码行数:13,代码来源:Model.java
示例5: step1
import org.jgrapht.graph.Pseudograph; //导入依赖的package包/类
/**
* Construct the complete undirected distance graph G1=(V1,EI,d1) from G and S.
* @return
*/
private Pseudograph<Node, DefaultLink> step1() {
logger.debug("<enter");
Pseudograph<Node, DefaultLink> g =
new Pseudograph<Node, DefaultLink>(DefaultLink.class);
for (Node n : this.steinerNodes) {
g.addVertex(n);
}
BellmanFordShortestPath<Node, DefaultLink> path;
for (Node n1 : this.steinerNodes) {
path = new BellmanFordShortestPath<Node, DefaultLink>(this.graph, n1);
for (Node n2 : this.steinerNodes) {
if (n1.equals(n2))
continue;
if (g.containsEdge(n1, n2))
continue;
DefaultLink e = new DefaultLink();
g.addEdge(n1, n2, e);
g.setEdgeWeight(e, path.getCost(n2));
}
}
logger.debug("exit>");
return g;
}
开发者ID:therelaxist,项目名称:spring-usc,代码行数:42,代码来源:SteinerTree.java
示例6: step2
import org.jgrapht.graph.Pseudograph; //导入依赖的package包/类
/**
* Find the minimal spanning tree, T1, of G1. (If there are several minimal spanning trees, pick an arbitrary one.)
* @param g1
* @return
*/
private WeightedMultigraph<Node, DefaultLink> step2(Pseudograph<Node, DefaultLink> g1) {
logger.debug("<enter");
KruskalMinimumSpanningTree<Node, DefaultLink> mst =
new KruskalMinimumSpanningTree<Node, DefaultLink>(g1);
// logger.debug("Total MST Cost: " + mst.getSpanningTreeCost());
Set<DefaultLink> edges = mst.getEdgeSet();
WeightedMultigraph<Node, DefaultLink> g2 =
new WeightedMultigraph<Node, DefaultLink>(DefaultLink.class);
List<DefaultLink> edgesSortedById = new ArrayList<DefaultLink>();
for (DefaultLink e : edges)
edgesSortedById.add(e);
Collections.sort(edgesSortedById);
for (DefaultLink edge : edgesSortedById) {
g2.addVertex(edge.getSource());
g2.addVertex(edge.getTarget());
g2.addEdge( edge.getSource(), edge.getTarget(), edge);
}
logger.debug("exit>");
return g2;
}
开发者ID:therelaxist,项目名称:spring-usc,代码行数:37,代码来源:SteinerTree.java
注:本文中的org.jgrapht.graph.Pseudograph类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论