com.github.rinde.rinsim.geom.Graph.containsNode()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(83)

本文整理了Java中com.github.rinde.rinsim.geom.Graph.containsNode()方法的一些代码示例,展示了Graph.containsNode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.containsNode()方法的具体详情如下:
包路径:com.github.rinde.rinsim.geom.Graph
类名称:Graph
方法名:containsNode

Graph.containsNode介绍

[英]Checks whether the specified point is a node in this graph.
[中]检查指定的点是否是此图中的节点。

代码示例

代码示例来源:origin: com.github.rinde/rinsim-geom

@Override
public boolean containsNode(Point node) {
 return delegate.containsNode(node);
}

代码示例来源:origin: rinde/RinSim

@Override
public boolean containsNode(Point node) {
 return delegate.containsNode(node);
}

代码示例来源:origin: rinde/RinSim

@Override
public void addObjectAt(RoadUser newObj, Point pos) {
 checkArgument(graph.containsNode(pos),
  "Object must be initiated on a crossroad.");
 super.addObjectAt(newObj, pos);
}

代码示例来源:origin: rinde/RinSim

/**
 * Returns all {@link RoadUser}s that are on the specified node.
 * @param node A node in the graph.
 * @return The set of {@link RoadUser}s that are <i>exactly</i> at the
 *         position of the node, or an empty set if there are no
 *         {@link RoadUser}s on the node.
 * @throws IllegalArgumentException if the specified point is not a node in
 *           the graph.
 */
@Override
public ImmutableSet<RoadUser> getRoadUsersOnNode(Point node) {
 checkArgument(graph.containsNode(node),
  "The specified point (%s) is not a node in the graph.", node);
 return ImmutableSet.copyOf(registry().getObjectsOn(node));
}

代码示例来源:origin: rinde/RinSim

/**
 * Checks whether the specified location is valid.
 * @param p The location to check.
 * @return The location if it is valid.
 * @throws VerifyException if the location is not valid.
 */
protected Point verifyLocation(Point p) {
 verify(registry().isOnConnection(p) || graph.containsNode(p),
  "Location points to non-existing node: %s.", p);
 return p;
}

代码示例来源:origin: com.github.rinde/rinsim-geom

if (!graph.containsNode(from)) {
 throw new IllegalArgumentException("from should be valid node. " + from);

代码示例来源:origin: rinde/RinSim

if (!graph.containsNode(from)) {
 throw new IllegalArgumentException("from should be valid node. " + from);

代码示例来源:origin: rinde/RinSim

ge.getGraph().containsNode(conn.from()), UNMODIFIABLE_MSG,
conn.from(), conn.from(), conn.to(), ge.getEventType());
ge.getGraph().containsNode(conn.to()), UNMODIFIABLE_MSG,
conn.to(), conn.from(), conn.to(), ge.getEventType());

代码示例来源:origin: rinde/RinSim

private void checkAssertions(Point A, Point B, Point C, Point D) {
 // contain nodes
 assertTrue("contains A", graph.containsNode(A));
 assertTrue("contains B", graph.containsNode(B));
 assertTrue("contains C", graph.containsNode(C));
 assertTrue("contains D", graph.containsNode(D));
 assertTrue("connection A->B", graph.hasConnection(A, B));
 assertTrue("connection B->C", graph.hasConnection(B, C));
 assertTrue("connection B->D", graph.hasConnection(B, D));
 assertFalse("!connection B->A", graph.hasConnection(B, A));
 assertFalse("!connection C->B", graph.hasConnection(A, C));
 assertFalse("!connection D->B", graph.hasConnection(A, D));
 assertFalse("!connection A->C", graph.hasConnection(A, C));
 assertFalse("!connection A->D", graph.hasConnection(A, D));
}

代码示例来源:origin: rinde/RinSim

assertTrue(graph.containsNode(n0));
assertTrue(graph.containsNode(n1));
assertTrue(graph.containsNode(n2));
assertTrue(graph.containsNode(n3));
assertTrue(graph.containsNode(n19663));
assertTrue(graph.containsNode(n16767));

相关文章