예제 #1
0
  public static void main(String[] args) {
    Matrix parkingTimesEC =
        GeneralLib.readStringMatrix(
            "A:/for marina/26. april 2012/parkingTimesAndEnergyConsumptionCH.txt");
    Network network =
        GeneralLib.readNetwork(
            "H:/data/cvs/ivt/studies/switzerland/networks/teleatlas-ivtcheu/network.xml.gz");

    HashMap<String, Id> agentIds = new HashMap();

    BasicPointVisualizer basicPointVisualizer = new BasicPointVisualizer();

    for (int i = 0; i < parkingTimesEC.getNumberOfRows(); i++) {
      String actType = parkingTimesEC.getString(i, 4);
      Id<Link> linkId = Id.create(parkingTimesEC.getString(i, 3), Link.class);
      Link link = network.getLinks().get(linkId);
      if (actType.equalsIgnoreCase("tta")) {
        agentIds.put(parkingTimesEC.getString(i, 0), null);
        // System.out.println("x");
        basicPointVisualizer.addPointCoordinate(
            new Coord(link.getCoord().getX(), link.getCoord().getY()), "", Color.GREEN);
      }
    }

    // for (String agentId:agentIds.keySet()){
    // System.out.println(agentId);
    // }

    basicPointVisualizer.write("c:/temp/abdd.kml");
  }
  public static void main(String[] args) {
    String inputNetworkPath =
        "H:/data/experiments/ARTEMIS/zh/dumb charging/output/run2/output_network.xml.gz";
    String outputFilePath =
        "H:/data/experiments/ARTEMIS/zh/dumb charging/output/run2/analysis/linksWithEnergyConsumpHigherThanThreshholdValue.kml";

    LinkedList<Id<Link>> selectedLinks = new LinkedList<Id<Link>>();

    selectedLinks.add(Id.create("17560000662724TF", Link.class));
    selectedLinks.add(Id.create("17560002226916TF", Link.class));
    selectedLinks.add(Id.create("17560000114875TF", Link.class));
    selectedLinks.add(Id.create("17560000082333TF", Link.class));
    selectedLinks.add(Id.create("17560002149918FT", Link.class));
    selectedLinks.add(Id.create("17560000368213FT", Link.class));
    selectedLinks.add(Id.create("17560002188272FT", Link.class));
    selectedLinks.add(Id.create("17560001856956FT", Link.class));
    selectedLinks.add(Id.create("17560001229496TF", Link.class));
    selectedLinks.add(Id.create("17560001363425TF", Link.class));
    selectedLinks.add(Id.create("17560001607380FT-1", Link.class));
    selectedLinks.add(Id.create("17560000045386TF", Link.class));
    selectedLinks.add(Id.create("17560000109095TF", Link.class));
    selectedLinks.add(Id.create("17560001227588FT", Link.class));
    selectedLinks.add(Id.create("17560000043382FT", Link.class));
    selectedLinks.add(Id.create("17560000105015FT", Link.class));
    selectedLinks.add(Id.create("17560000109323TF", Link.class));
    selectedLinks.add(Id.create("17560001594646FT", Link.class));
    selectedLinks.add(Id.create("17560001380278TF", Link.class));

    BasicPointVisualizer basicPointVisualizer = new BasicPointVisualizer();

    Network network = GeneralLib.readNetwork(inputNetworkPath);

    for (Link link : network.getLinks().values()) {
      if (selectedLinks.contains(link.getId())) {
        basicPointVisualizer.addPointCoordinate(
            link.getCoord(), link.getId().toString(), Color.GREEN);
      }
    }

    basicPointVisualizer.write(outputFilePath);
  }