main.cpp 2.29 KB
Newer Older
1
/* Crowd Simulator Engine
2 3
** Copyright(C) 2018 - Inria Rennes - Rainbow - Julien Pettre
**
4 5
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
6
** as published by the Free Software Foundation; either version 3
7
** of the License, or (at your option) any later version.
8
**
9 10
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
11
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
12 13
** GNU General Public License for more details.
**
14 15
** You should have received a copy of the GNU General Public License
** along with this program.If not, see < https://www.gnu.org/licenses/>.
16 17
**
** Authors: Axel Lopez Gandia, Javad Amirian, Florian Berton,
18 19 20 21
**	Julien Legros, Lucas Pelerin, Beatriz Cabrero Daniel, Fabien Grzeskowiak,
**	Alicia Nics Miquel, Alexandre Bonneau, Wouter Van toll, Benjamin Niay.
**
**	Contact : crowd_group@inria.fr
22
*/
23 24
#include <vector>
#include <iostream>
25
#include "core/crowdSimulator.h"
26 27
#include <CostFunctions/goalReaching.h>
#include <CostFunctions/socialforces.h>
28
#include <CostFunctions/directionalGoalReaching.h>
29 30
#include <iostream>
#include <fstream>
31

32
using namespace std;
33

34 35
int main( int argc, char * argv[] )
{
36
	std::cout << argc << std::endl;
37
    CrowdSimulator cs;
BONNEAU Alexandre's avatar
BONNEAU Alexandre committed
38
	char * output = "./output/";
39 40
	char * masterConfigFile = "./MainConfig.xml";
	
BONNEAU Alexandre's avatar
BONNEAU Alexandre committed
41
	if (argc ==2) {
42 43
	
		if (strcmp("-h", argv[1])==0 || strcmp("-c", argv[1]) == 0 || strcmp("-help", argv[1]) == 0) {
BONNEAU Alexandre's avatar
BONNEAU Alexandre committed
44 45 46 47 48 49
			std::cout <<  " The optional arguments are :  " << std::endl;
			std::cout << argv[0] << " outputDirectory" << std::endl;
			std::cout << argv[0] <<" outputDirectory  mainConfigDirectory/MainConfig.xml " << std::endl;
			std::cout << argv[0] << " -c  mainConfigDirectory/MainConfig.xml " << std::endl;
			return -1;
		}
50

BONNEAU Alexandre's avatar
BONNEAU Alexandre committed
51 52 53
		else {
			output = argv[1];
		}
54
		
BONNEAU Alexandre's avatar
BONNEAU Alexandre committed
55
	}
56

BONNEAU Alexandre's avatar
BONNEAU Alexandre committed
57
	if (argc == 3) {
58
		if (strcmp("-c", argv[1]) != 0) {
BONNEAU Alexandre's avatar
BONNEAU Alexandre committed
59 60 61 62 63 64 65
			output = argv[1];
		}
		masterConfigFile = argv[2];

	}
    cs.setOutputDir(output);
    cs.runMasterConfigFile(masterConfigFile);
66
	//cs.runWorld(1000, 0.0333);
67

68
  std::cout << "Simulation done"<< std::endl;
69 70 71 72 73 74 75 76 77 78 79


  std::cout << "---------------" << std::endl;



//  for(int i = 0; i < MAX_AGENTS; i++){
//    agents.push_back(new Agent());
//  }

  //agents[20]->printPosition();
80
}