本文整理了Java中org.matsim.api.core.v01.network.Node.getAttributes()
方法的一些代码示例,展示了Node.getAttributes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getAttributes()
方法的具体详情如下:
包路径:org.matsim.api.core.v01.network.Node
类名称:Node
方法名:getAttributes
暂无
代码示例来源:origin: matsim-org/matsim
@Override
public Attributes getAttributes() {
return node.getAttributes();
}
}
代码示例来源:origin: matsim-org/matsim
private void startNode(final Attributes atts) {
final Node node =
this.network.getFactory().createNode(
Id.create(atts.getValue("id"), Node.class),
parseCoord(atts));
this.network.addNode(node);
NetworkUtils.setType(node,atts.getValue("type"));
// (did not have a null check when I found it. kai, jul'16)
if (atts.getValue(NetworkUtils.ORIGID) != null) {
NetworkUtils.setOrigId( node, atts.getValue(NetworkUtils.ORIGID) ) ;
}
currentAttributes = node.getAttributes();
}
代码示例来源:origin: matsim-org/matsim
@Override
public void startNode(final Node node, final BufferedWriter out) throws IOException {
out.write("\t\t<node");
out.write(" id=\"" + node.getId() + "\"");
final Coord coord = transformation.transform( node.getCoord() );
out.write(" x=\"" + coord.getX() + "\"");
out.write(" y=\"" + coord.getY() + "\"");
if ( coord.hasZ() ) out.write(" z=\"" + coord.getZ() + "\"");
if (NetworkUtils.getType( node ) != null) {
out.write(" type=\"" + NetworkUtils.getType( node ) + "\"");
}
if (NetworkUtils.getOrigId( node ) != null) {
out.write(" origid=\"" + NetworkUtils.getOrigId( node ) + "\"");
}
out.write(" >\n");
attributesWriter.writeAttributes( "\t\t\t" , out , node.getAttributes() );
}
代码示例来源:origin: matsim-org/matsim
@Test
public void testNodesAttributes() {
final Scenario sc = createTestNetwork( false );
new NetworkWriter( sc.getNetwork() ).writeV2( utils.getOutputDirectory()+"network.xml" );
final Scenario read = ScenarioUtils.createScenario( ConfigUtils.createConfig() );
new MatsimNetworkReader( read.getNetwork() ).readFile( utils.getOutputDirectory()+"network.xml" );
final Id<Node> id = Id.createNodeId( "Zurich" );
Assert.assertEquals( "unexpected internet attribute in node metadata",
"good",
read.getNetwork().getNodes().get( id ).getAttributes().getAttribute( "Internet" ) );
Assert.assertEquals( "unexpected meeting attribute in node metadata",
false,
read.getNetwork().getNodes().get( id ).getAttributes().getAttribute( "Developper Meeting" ) );
}
代码示例来源:origin: matsim-org/matsim
.getNodes()
.get( Id.createNodeId( 1 ) )
.getAttributes()
.getAttribute( "nodeAttribute" );
代码示例来源:origin: matsim-org/matsim
new Coord( 1 , 1 ) );
zurichNode.getAttributes().putAttribute( "Internet" , "good" );
zurichNode.getAttributes().putAttribute( "Developper Meeting" , false );
teltowNode.getAttributes().putAttribute( "Internet" , "not so good" );
teltowNode.getAttributes().putAttribute( "Developper Meeting" , true );
代码示例来源:origin: matsim-org/matsim
final Node node2 = factory.createNode( Id.createNodeId( 2 ) , new Coord( 1 , 1) );
node1.getAttributes().putAttribute( "nodeAttribute" , new StupidClass() );
node2.getAttributes().putAttribute( "nodeAttribute" , new StupidClass() );
内容来源于网络,如有侵权,请联系作者删除!