All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.kit.ifv.mobitopp.routing.DefaultNode Maven / Gradle / Ivy

Go to download

mobiTopp (http://mobitopp.ifv.kit.edu/) is an agent-based travel demand model developed at the Institute for transport studies at the Karlsruhe Institute of Technology (http://www.ifv.kit.edu/english/index.php). Publications about mobiTopp can be found on the project site (http://mobitopp.ifv.kit.edu/28.php).

The newest version!
package edu.kit.ifv.mobitopp.routing;

import java.util.Collection;

class DefaultNode
	implements Node, Comparable
{

	private final String id;

	private Edge[] inEdges = new Edge[0];
	private Edge[] outEdges = new Edge[0];


	public DefaultNode(String id) {
		this.id = id;
	}

	public String id() {
		return id;
	}

	public Edge[] incomingEdges() {

		return this.inEdges;
	}

	public Edge[] outgoingEdges() {

		return this.outEdges;
	}

	public boolean isSink() {
		return false;
	}


	public void setIncomingLinks(Collection incoming) {
		assert incoming != null;

		this.inEdges = incoming.toArray(new Edge[0]);
	}

	public void setOutgoingLinks(Collection outgoing) {
		assert outgoing != null;

		this.outEdges = outgoing.toArray(new Edge[0]);
	}

	public String toString() {
		return "(" + id + ")";
	}

	public int compareTo(Node o) {

		return id.compareTo(o.id());
	}

	public boolean isTarget() {
		return false;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy