@Override
	public void process(SimEvent event) {
		NodeReachedEvent _event = (NodeReachedEvent) event; 
		this.setPosition(_event.getNode()); // Sets the actual position to the reached node.
		System.out.println(getName() + "@" + getEngine().getCurrentTime() + ": reached node " + getPosition());
		getLog().addNode(getPosition(), getEngine().getCurrentTime()); // Save the reached Node to the log.
		
		if(getLabyrinth().isEndpoint(getPosition())){
			System.out.println(getName() + ": finished");
			getEngine().stop(); 
		} else{
			
			// The meta object for the actual position is fetched. If none exists a new one is created.
			ShannonMouseNodeMeta _nodeMeta = null;
			Object _nodeMetaObj = getLabyrinth().getNodeMeta(getPosition(), getName());
			if(_nodeMetaObj == null){
				_nodeMeta = new ShannonMouseNodeMeta();
			}
			else{
				_nodeMeta = (ShannonMouseNodeMeta) _nodeMetaObj;
			}
			
			LinkedList<Integer> _edges = getLabyrinth().getEdges(getPosition()); // Fetches the edges of the current node.
			
			// Select the new edge.
			int _edgeListIndex = _nodeMeta.getDirection();
			if ((_edgeListIndex + 1) >= _edges.size()){
				_edgeListIndex = 0;
			}
			else{
				_edgeListIndex++;
			}
			
			int _newEdge = _edges.get(_edgeListIndex);
			
			setDirection(_newEdge);
			
			_nodeMeta.setDirection(_edgeListIndex); // Save the new marker.
			getLabyrinth().setNodeMeta(getPosition(), getName(), _nodeMeta);
			
			// Fetch the node behind the new edge.
			int _newNode = getLabyrinth().getNodeBehind(getPosition(), _newEdge);
			
			NodeReachedEvent _newEvent = new NodeReachedEvent(_newNode, _event.getOccurringTime() + getTicksPerLength() * getLabyrinth().getEdgeLength(_newEdge), 1, this);
			getEngine().insertEvent(_newEvent);
		}
	}