IniFileParser.h 2.39 KB
Newer Older
GrgrLmml's avatar
GrgrLmml committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
/**
 * \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/>.
 **/
//
// Created by laemmel on 24.03.16.
//

#ifndef JPSCORE_INIFILEPARSER_H
#define JPSCORE_INIFILEPARSER_H

#include <string>
26
#include <filesystem>
GrgrLmml's avatar
GrgrLmml committed
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
#include "../general/Configuration.h"
#include "../routing/DirectionStrategy.h"

class OutputHandler;

class TiXmlElement;

class TiXmlNode;

extern OutputHandler* Log;

class IniFileParser {

public:
     IniFileParser(Configuration* config);
f.mack's avatar
f.mack committed
42
     ~IniFileParser(){};
GrgrLmml's avatar
GrgrLmml committed
43 44 45 46

     bool Parse(std::string iniFile);

private:
47 48
     bool ParseHeader(TiXmlNode* xHeader);

49
     bool ParseGCFMModel(TiXmlElement* xGCFM, TiXmlElement* xMain);
GrgrLmml's avatar
GrgrLmml committed
50

51 52
     bool ParseKrauszModel(TiXmlElement* xKrausz, TiXmlElement* xMain);

53
     bool ParseGompertzModel(TiXmlElement* xGompertz, TiXmlElement* xMain);
GrgrLmml's avatar
GrgrLmml committed
54

55
     bool ParseGradientModel(TiXmlElement* xGradient, TiXmlElement* xMain);
GrgrLmml's avatar
GrgrLmml committed
56

57
     bool ParseVelocityModel(TiXmlElement* xVelocity, TiXmlElement* xMain);
GrgrLmml's avatar
GrgrLmml committed
58

59
     void ParseAgentParameters(TiXmlElement* operativModel, TiXmlNode* agentDistri);
GrgrLmml's avatar
GrgrLmml committed
60

61 62
     bool ParseRoutingStrategies(TiXmlNode* routingNode, TiXmlNode* agentDistri);

f.mack's avatar
f.mack committed
63
     bool ParseFfRouterOps(TiXmlNode* routingNode, RoutingStrategy s);
GrgrLmml's avatar
GrgrLmml committed
64 65

     bool ParseCogMapOpts(TiXmlNode* routingNode);
66
#ifdef AIROUTER
67
     bool ParseAIOpts(TiXmlNode* routingNode);
68
#endif
GrgrLmml's avatar
GrgrLmml committed
69 70 71 72 73 74 75 76 77 78
     bool ParseLinkedCells(const TiXmlNode& linkedCellNode);

     bool ParseStepSize(TiXmlNode& stepNode);

     bool ParsePeriodic(TiXmlNode& Node);

     bool ParseNodeToSolver(const TiXmlNode& solverNode);

     bool ParseStrategyNodeToObject(const TiXmlNode& strategyNode);

Arne Graf's avatar
Arne Graf committed
79 80
     bool ParseFfOpts(const TiXmlNode& strategyNode);

GrgrLmml's avatar
GrgrLmml committed
81 82 83
     Configuration* _config;
     int _model;
     std::shared_ptr<DirectionStrategy> _exit_strategy;
84
     int _exit_strat_number;
GrgrLmml's avatar
GrgrLmml committed
85 86 87 88

};

#endif //JPSCORE_INIFILEPARSER_H