@Override protected void readNetwork(final Scenario scenario, final String filename) { NetworkReaderMatsimV1 reader = new NetworkReaderMatsimV1(scenario.getNetwork()); reader.readFile(filename); }
@Override public void startTag(final String name, final Attributes atts, final Stack<String> context) { if (NODE.equals(name)) { startNode(atts); } else if (LINK.equals(name)) { startLink(atts); } else if (NETWORK.equals(name)) { startNetwork(atts); } else if (LINKS.equals(name)) { startLinks(atts); } }
network.addNode(network.getFactory().createNode(Id.create("2", Node.class), new Coord((double) 1000, (double) 0))); NetworkReaderMatsimV1 reader = new NetworkReaderMatsimV1(scenario.getNetwork()); Stack<String> context = new Stack<String>(); Attributes atts = new AttributesBuilder(). get(); reader.startTag("link", atts, context);
@Override protected void setDoctype(final String doctype) { super.setDoctype(doctype); switch ( doctype ) { case NETWORK_V1: this.delegate = new NetworkReaderMatsimV1( inputCRS != null ? TransformationFactory.getCoordinateTransformation(inputCRS, targetCRS) : new IdentityTransformation(), this.network); log.info("using network_v1-reader."); break; case NETWORK_V2: this.delegate = new NetworkReaderMatsimV2(inputCRS, targetCRS, this.network); ((NetworkReaderMatsimV2) delegate).putAttributeConverters( converters ); log.info("using network_v2-reader."); break; default: throw new IllegalArgumentException("Doctype \"" + doctype + "\" not known."); } }
@Override protected void readNetwork(final Scenario scenario, final String filename) { NetworkReaderMatsimV1 reader = new NetworkReaderMatsimV1(scenario.getNetwork()); reader.readFile(filename); }