コード例 #1
0
  @Test
  public void testHighLevelAccess() {
    Link link = nw.getLinkById(3L);

    Double val = 1.23;

    dp.setVehiclesPerMeterOnLink(link, val);

    assertEquals((Double) 1.23, dp.getVehiclesPerMeterOnLink(link));
  }
コード例 #2
0
  @Before
  public void setup() {
    nw = new Network();
    nw.setName("test network");

    dp = new DensityMap();

    nw.setNodes(new ArrayList<edu.berkeley.path.model_elements_base.Node>());
    nw.setLinks(new ArrayList<edu.berkeley.path.model_elements_base.Link>());

    Node nd1;
    Node nd2;
    Link ln;

    nd1 = new Node();
    nd1.setId(1L);
    nd1.setName("one");
    nd1.setType("Highway");
    nw.getNodes().add(nd1);

    nd2 = new Node();
    nd2.setId(2L);
    nd2.setName("two");
    nd2.setType("Highway");
    nw.getNodes().add(nd2);

    ln = new Link();
    ln.setId(3L);
    ln.setName("three");
    ln.setType("Highway");
    ln.setLaneCount(4.0);
    ln.setLength(1000.0);

    ln.setBegin(nd1);
    ln.setEnd(nd2);

    nw.getLinks().add(ln);
  }