org.matsim.api.core.v01.population.Population.getAttributes()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(147)

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

Population.getAttributes介绍

暂无

代码示例

代码示例来源:origin: matsim-org/matsim

@Override
  public Attributes getAttributes() {
    return delegate.getAttributes();
  }
}

代码示例来源:origin: matsim-org/matsim

@Override
public void startPlans(final Population plans, final BufferedWriter out) throws IOException {
  out.write("<population");
  if (plans.getName() != null) {
    out.write(" desc=\"" + plans.getName() + "\"");
  }
  out.write(">\n\n");
  this.attributesWriter.writeAttributes( "\t" , out , plans.getAttributes() );
  out.write("\n\n");
}

代码示例来源:origin: matsim-org/matsim

@Test
  public void testPopulationAttributesIO() {
    final Population population = PopulationUtils.createPopulation(ConfigUtils.createConfig() );

    population.getAttributes().putAttribute( "type" , "candidates" );
    population.getAttributes().putAttribute( "number" , 2 );

    final String file = utils.getOutputDirectory()+"/population.xml";
    new PopulationWriter( population ).writeV6( file );

    final Scenario readScenario = ScenarioUtils.createScenario( ConfigUtils.createConfig() );
    new PopulationReader( readScenario ).readFile( file );

    Assert.assertEquals( "Unexpected numeric attribute in " + readScenario.getPopulation().getAttributes(),
        population.getAttributes().getAttribute( "number" ) ,
        readScenario.getPopulation().getAttributes().getAttribute( "number" ) );

    Assert.assertEquals( "Unexpected String attribute in " + readScenario.getPopulation().getAttributes(),
        population.getAttributes().getAttribute( "type" ) ,
        readScenario.getPopulation().getAttributes().getAttribute( "type" ) );
  }
}

代码示例来源:origin: matsim-org/matsim

switch( context.peek() ) {
  case POPULATION:
    currAttributes = scenario.getPopulation().getAttributes();
    break;
  case PERSON:

相关文章