本文整理了Java中com.github.rinde.rinsim.geom.Graph.addConnection()
方法的一些代码示例,展示了Graph.addConnection()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.addConnection()
方法的具体详情如下:
包路径:com.github.rinde.rinsim.geom.Graph
类名称:Graph
方法名:addConnection
[英]Add connection to the graph.
[中]将连接添加到图形。
代码示例来源:origin: com.github.rinde/rinsim-geom
@Override
public void addConnection(Connection<E> connection) {
delegate.addConnection(connection);
}
代码示例来源:origin: com.github.rinde/rinsim-geom
@Override
public void addConnection(Point from, Point to) {
delegate.addConnection(from, to);
}
代码示例来源:origin: rinde/RinSim
@Override
public void addConnection(Point from, Point to) {
delegate.addConnection(from, to);
}
代码示例来源:origin: com.github.rinde/rinsim-geom
@Override
public void addConnection(Point from, Point to, E connData) {
delegate.addConnection(from, to, connData);
}
代码示例来源:origin: rinde/RinSim
Graph<?> createGraph() {
final Graph<?> g = new MultimapGraph<>();
g.addConnection(SW, SE);
g.addConnection(SE, NE);
g.addConnection(NE, NW);
return g;
}
代码示例来源:origin: com.github.rinde/rinsim-geom
@Override
public void addConnection(Connection<E> connection) {
delegate.addConnection(connection);
eventDispatcher.dispatchEvent(new GraphEvent(EventTypes.ADD_CONNECTION,
this, connection));
}
代码示例来源:origin: rinde/RinSim
@Override
public void addConnection(Connection<E> connection) {
delegate.addConnection(connection);
eventDispatcher.dispatchEvent(new GraphEvent(EventTypes.ADD_CONNECTION,
this, connection));
}
代码示例来源:origin: com.github.rinde/rinsim-geom
@Override
public void addConnection(Point from, Point to) {
delegate.addConnection(from, to);
eventDispatcher.dispatchEvent(new GraphEvent(EventTypes.ADD_CONNECTION,
this, getConnection(from, to)));
}
代码示例来源:origin: rinde/RinSim
@Override
public void addConnection(Point from, Point to) {
delegate.addConnection(from, to);
eventDispatcher.dispatchEvent(new GraphEvent(EventTypes.ADD_CONNECTION,
this, getConnection(from, to)));
}
代码示例来源:origin: rinde/RinSim
@Override
public void addConnection(Point from, Point to, E connData) {
delegate.addConnection(from, to, connData);
eventDispatcher.dispatchEvent(new GraphEvent(EventTypes.ADD_CONNECTION,
this, getConnection(from, to)));
}
代码示例来源:origin: com.github.rinde/rinsim-geom
@Override
public void addConnection(Point from, Point to, E connData) {
delegate.addConnection(from, to, connData);
eventDispatcher.dispatchEvent(new GraphEvent(EventTypes.ADD_CONNECTION,
this, getConnection(from, to)));
}
代码示例来源:origin: rinde/RinSim
@Test(expected = UnsupportedOperationException.class)
public void unmodAddConnection2() {
Graphs.unmodifiableGraph(graph).addConnection(null);
}
代码示例来源:origin: rinde/RinSim
@Test(expected = UnsupportedOperationException.class)
public void unmodAddConnection() {
Graphs.unmodifiableGraph(graph).addConnection(null, null, null);
}
代码示例来源:origin: rinde/RinSim
@Test(expected = RuntimeException.class)
public void impossiblePath() throws InstantiationException,
IllegalAccessException {
final Graph<?> gg = rmType.newInstance();
final GraphRoadModel roads = RoadModelBuilders.staticGraph(gg).build(
mock(DependencyProvider.class));
gg.addConnection(a, b);
gg.addConnection(b, c);
Graphs.shortestPathEuclideanDistance(roads.getGraph(), b, a);
}
代码示例来源:origin: rinde/RinSim
@Test(expected = IllegalArgumentException.class)
public void addConnection2() {
graph.addConnection(new Point(0, 0), new Point(0, 0));
}
代码示例来源:origin: rinde/RinSim
@Test
public void getGraphTest() {
final Graph<ConnectionData> g = new MultimapGraph<ConnectionData>();
g.addConnection(NE, SW);
g.addConnection(SW, NW);
final GraphRoadModel rm = RoadModelBuilders.staticGraph(g)
.withDistanceUnit(SI.METER)
.withSpeedUnit(SI.METERS_PER_SECOND)
.build(mock(DependencyProvider.class));
assertEquals(g, rm.getGraph());
g.addConnection(NE, NW);
assertEquals(g, rm.getGraph());
}
代码示例来源:origin: rinde/RinSim
@Test(expected = UnsupportedOperationException.class)
public void unmodAddConn() {
Graphs.unmodifiableGraph(graph).addConnection(new Point(1, 2),
new Point(2, 3));
}
代码示例来源:origin: rinde/RinSim
@Test
public void unmodifiable2() {
final Point N = new Point(0, 5);
final Point E = new Point(5, 0);
final Point S = new Point(0, -5);
final Point W = new Point(-5, 0);
Graphs.addBiPath(graph, N, E, S, W, N);
final Graph<LengthData> unmod = Graphs.unmodifiableGraph(graph);
graph.addConnection(N, S);
assertEquals(graph.getConnection(N, S), unmod.getConnection(N, S));
}
代码示例来源:origin: rinde/RinSim
@Test
public void isEmtpy() {
assertTrue(graph.isEmpty());
graph.addConnection(new Point(0, 0), new Point(1, 0));
assertFalse(graph.isEmpty());
graph.removeConnection(new Point(0, 0), new Point(1, 0));
assertTrue(graph.isEmpty());
}
代码示例来源:origin: rinde/RinSim
@Test(expected = IllegalArgumentException.class)
public void followPathFailIllegalPath2() {
final TestRoadUser testRoadUser1 = new TestRoadUser();
model.addObjectAt(testRoadUser1, SW);
graph.addConnection(SE, SW);
model.followPath(testRoadUser1, asPath(SW, SE, SW), hour(11));
final TestRoadUser testRoadUser2 = new TestRoadUser();
model.addObjectAt(testRoadUser2, SW);
model.followPath(testRoadUser2, asPath(SW, SE), hour(2));
model.followPath(testRoadUser2, asPath(model.getPosition(testRoadUser1)),
hour(2));
}
内容来源于网络,如有侵权,请联系作者删除!