public Route previous; //De voorafgaande Route. Is null voor de eerste

        #endregion Fields

        #region Constructors

        public Route(Node newlocal, Route newPrevious, double newLength)
        {
            this.local = newlocal;
            this.previous = newPrevious;
            this.length = newLength;
            if (previous != null)
                this.length += previous.length;
        }
        public Route findRoute(Node startNode, Node endNode, Airplane airplane, Airport.Airport airport)
        {
            /*
             * Deze methode maakt een stapel aan met routes. Het pakt de bovenste route van deze stapel. Route heeft Node, vorige Route en lengte.
             * Zolang routes op stapel, blijf draaien. Voor iedere route check Node. Is Node endNode? Ja + lengte < kortste Route dan nieuwe kortste Route.
             * Anders kijk Ways bij Node. Als Node = Endnote of lengte Route > lengte beste Route niet opnieuw pushen.
             * Anders nieuwe Route maken met Node andere kant van Way. Resultaat is kortste Route van beginNode naar endNode.
            */

            foreach (Way w in airport.ways)
                w.weightedLength = w.length;

            Stack<Route> routes = new Stack<Route>();
            Route bestRoute = null;
            routes.Push(new Route(startNode, null, 0));
            while (routes.Count > 0)
            {
                Route route = routes.Pop();
                if (route.hasNode(endNode))
                {
                    if (bestRoute == null || route.length < bestRoute.length)
                    {
                        bestRoute = route;
                    }
                }
                IList<Way> connections = route.local.connections;
                foreach (Way connection in connections)
                {
                    if (!route.hasNode(endNode))
                    {
                        if (route.local.isDirectionAllowed(connection))
                        {
                            if (bestRoute == null || route.length <= bestRoute.length)
                            {
                                Node connectedNode = route.local.getConnectedNode(connection);

                                if (!route.hasNode(connectedNode))
                                {
                                    Route newRoute = new Route(connectedNode, route, connection.weightedLength);
                                    routes.Push(newRoute);      //Zet nieuwe Route op stack met Node andere kant connection
                                }
                            }
                            connection.weightedLength = connection.length;
                        }
                    }
                }
            }

            return bestRoute;
        }