Skip to content
Snippets Groups Projects
Select Git revision
  • 13509c03a5b078e79f8460f0eb8ff4ab2e5e2c2f
  • develop default
  • Blockage
  • GuidoBasten
  • Anticipation_Model
  • tgf19ts
  • 313-waiting-behaviour
  • tgf19mc
  • wa_testing
  • trajectories
  • 287-waitingarea
  • 320-one-sided-closed-doors
  • kapakrit-anna
  • 311-improve-ff
  • 306-schedule-for-was
  • 294-events
  • 307-temp-close
  • 302-external-files
  • split_files
  • 298-sources
  • 293-statistics-crossings
  • v0.8.4
  • v0.8.3
  • v0.8.2
  • v0.8.1
  • v0.8
  • v0.7
  • v0.6
  • v0.5-alpha
  • v0.5-alpha1
  • v0.4
31 results

ffRouter.cpp

Blame
  • ffRouter.cpp 28.16 KiB
    /**
     * \file        ffRouter.h
     * \date        Feb 19, 2016
     * \version     v0.8
     * \copyright   <2016-2022> Forschungszentrum Jülich GmbH. All rights reserved.
     *
     * \section License
     * This file is part of JuPedSim.
     *
     * JuPedSim is free software: you can redistribute it and/or modify
     * it under the terms of the GNU Lesser General Public License as published by
     * the Free Software Foundation, either version 3 of the License, or
     * any later version.
     *
     * JuPedSim is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU Lesser General Public License
     * along with JuPedSim. If not, see <http://www.gnu.org/licenses/>.
     *
     * \section Description
     * This router is an update of the former Router.{cpp, h} - Global-, Quickest
     * Router System. In the __former__ version, a graph was created with doors and
     * hlines as nodes and the distances of (doors, hlines), connected with a line-
     * of-sight, was used as edge-costs. If there was no line-of-sight, there was no
     * connecting edge. On the resulting graph, the Floyd-Warshall algorithm was
     * used to find any paths. In the "quickest-___" variants, the edge cost was not
     * determined by the distance, but by the distance multiplied by a speed-
     * estimate, to find the path with minimum travel times. This whole construct
     * worked pretty well, but dependend on hlines to create paths with line-of-
     * sights to the next target (hline/door).
     *
     * In the ffRouter, we want to overcome hlines by using floor fields to
     * determine the distances. A line of sight is not required any more. We hope to
     * reduce the graph complexity and the preparation-needs for new geometries.
     *
     * To find a counterpart for the "quickest-____" router, we can either use
     * __special__ floor fields, that respect the travel time in the input-speed map,
     * or take the distance-floor field and multiply it by a speed-estimate (analog
     * to the former construct.
     *
     * We will derive from the <Router> class to fit the interface.
     *
     **/
    
    #include <cfloat>
    #include <algorithm>
    #include "ffRouter.h"
    //#include "FloorfieldViaFM.h"
    //#include "../../geometry/Building.h"
    
    int FFRouter::_cnt = 0;
    
    FFRouter::FFRouter()
    {
    
    }
    
    FFRouter::FFRouter(int id, RoutingStrategy s, bool hasSpecificGoals, Configuration* config):Router(id,s) {
         _config = config;
         _building = nullptr;
         _hasSpecificGoals = hasSpecificGoals;
         _globalFF = nullptr;
         _targetWithinSubroom = true; //depending on exit_strat 8 => false, depending on exit_strat 9 => true;
         _targetWithinSubroom = (_config->get_exit_strat() == 9);
         if (s == ROUTING_FF_QUICKEST) {
              _mode = quickest;
              _recalc_interval = _config->get_recalc_interval();