Commit bb5abfca authored by Pierre Kraemer's avatar Pierre Kraemer
Browse files

update

parent 4333cf13
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 2.8)
project(SocialAgents)
# a decommenter si on veut voir ce qui se passe a la compilation
#set( CMAKE_VERBOSE_MAKEFILE 1 )
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/../../CGoGN)
SET(CMAKE_MODULE_PATH " ${CMAKE_MODULE_PATH} ${CGoGN_ROOT_DIR}/cmake_modules/")
find_package(OpenGL)
find_package(GLUT)
# FOR Qt4
FIND_PACKAGE(Qt4 REQUIRED)
SET(QT_USE_QTOPENGL TRUE)
INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})
# qq definition specifiques pour mac
IF(APPLE)
# attention a changer pour chercher la bonne version automatiquement
SET(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.6.sdk")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined -Wl,dynamic_lookup")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMAC_OSX")
SET(CMAKE_OSX_ARCHITECTURES x86_64)
ENDIF(APPLE)
IF(WIN32)
SET(GLEW_LIBRARY glew32)
SET(DEVIL_LIBRARIES DevIL ILU ILUT)
SET(ZLIB_LIBRARIES zlib)
SET(LIBXML2_LIBRARIES xml2)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/dependencies/include/)
LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/dependencies/lib/)
ELSE(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
find_package(DevIL)
find_package(ZLIB)
find_package(LibXml2)
SET(GLEW_LIBRARY GLEW)
IF (IL_LIBRARIES)
SET(DEVIL_LIBRARIES ${IL_LIBRARIES} ${ILU_LIBRARIES} ${ILUT_LIBRARIES})
ELSE(IL_LIBRARIES)
SET(DEVIL_LIBRARIES ${IL_LIBRARY} ${ILU_LIBRARY} ${ILUT_LIBRARY})
ENDIF(IL_LIBRARIES)
ENDIF(WIN32)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
SET(COMMON_LIBS ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ${GLEW_LIBRARY} ${DEVIL_LIBRARIES} ${ZLIB_LIBRARIES} ${LIBXML2_LIBRARIES} gzstream openctm assimp)
SET(CGoGN_LIBS_D topologyD algoD containerD utilsD)
SET(CGoGN_LIBS_R topology algo container utils)
SET(NUMERICAL_LIBS numerical lapack blas f2c)
include(${CGoGN_ROOT_DIR}/build/apps_cmake.txt)
add_subdirectory(Release)
add_subdirectory(Debug)
#set terminal svg size 600,400 dynamic enhanced fname 'arial' fsize 11 butt
#set output 'graphBenchMemoryCircles1000.svg'
set terminal svg size 600,400 enhanced font 'arial,11' butt
set output 'graphBenchMemoryCircles1000.svg'
set auto x
set grid
set xlabel 'Time'
......@@ -7,9 +7,9 @@ set ylabel 'Memory'
set yrange [0.1:*]
#set xrange [0:2580]
#set logscale y
plot 'Circle_Memory_NotreMethodeSubdivMax.data' using 1:2 title 'Fine grid' with lines, \
'Circle_Memory_NotreMethodeSansSimplif.data' using 1:2 title 'Adaptive method w/o coarsening' with lines, \
'Circle_Memory_NotreMethode.data' using 1:2 title 'Adaptive method' with lines, \
'Circle_Memory_NotreMethodeStatic.data' using 1:2 title 'Coarse grid' with lines
plot 'Circle_Memory_NotreMethodeSubdivMax.data' using 1:2 title 'Fine grid' with lines lt 5, \
'Circle_Memory_NotreMethodeSansSimplif.data' using 1:2 title 'Adaptive method w/o simplification' with lines lt 4, \
'Circle_Memory_NotreMethode.data' using 1:2 title 'Adaptive method' with lines lt 2, \
'Circle_Memory_NotreMethodeStatic.data' using 1:2 title 'Coarse grid' with lines lt 3
pause -1
This diff is collapsed.
......@@ -5,8 +5,7 @@
#include <algorithm>
#include "Topology/generic/parameters.h"
#include "Topology/map/map2.h"
#include "Topology/generic/embeddedMap2.h"
#include "Topology/map/embeddedMap2.h"
#include "Algo/ImplicitHierarchicalMesh/ihm.h"
#include "Algo/ImplicitHierarchicalMesh/subdivision.h"
......@@ -32,7 +31,7 @@ class Obstacle;
struct PFP: public PFP_STANDARD
{
// definition de la carte
// typedef EmbeddedMap2<Map2> MAP;
// typedef EmbeddedMap2 MAP;
typedef Algo::IHM::ImplicitHierarchicalMap MAP;
// definition des listes d'agent
......
......@@ -127,11 +127,11 @@ void Agent::computePrefVelocity()
/*
* Perturb a little to avoid deadlocks due to perfect symmetry.
*/
float angle = std::rand() * 2.0f * M_PI / RAND_MAX;
float dist = std::rand() * 0.0001f / RAND_MAX;
prefVelocity_ = goalVector + VEC3(dist * cos(angle), dist * sin(angle), 0.0f);
// float angle = std::rand() * 2.0f * M_PI / RAND_MAX;
// float dist = std::rand() * 0.0001f / RAND_MAX;
// prefVelocity_ = goalVector + VEC3(dist * cos(angle), dist * sin(angle), 0.0f);
// prefVelocity_ = goalVector;
prefVelocity_ = goalVector;
}
void Agent::computeNewVelocity2()
......
......@@ -172,11 +172,11 @@ Dart EnvMap::getBelongingCell(const PFP::VEC3& pos)
void EnvMap::init()
{
float sideSize = 70.0f;
unsigned int nbSquares = 12;
unsigned int nbSquares = 24;
// CityGenerator::generateGrid<PFP>(map, position, nbSquares, nbSquares, sideSize, obstacleMark, buildingMark);
CityGenerator::generateGrid<PFP>(map, position, nbSquares, nbSquares, sideSize, obstacleMark, buildingMark);
// CityGenerator::generateCorridor<PFP>(map, position, obstacleMark, buildingMark, 50, nbSquares);
CityGenerator::generateCity<PFP>(map, position, obstacleMark, buildingMark, sideSize, nbSquares);
// CityGenerator::generateCity<PFP>(map, position, obstacleMark, buildingMark, sideSize, nbSquares);
// CityGenerator::generateMall<PFP>(map, position, obstacleMark, buildingMark, sideSize);
// CityGenerator::simplifyFreeSpace<PFP>(map, position, obstacleMark, buildingMark);
// CityGenerator::convexifyFreeSpace<PFP>(map, position, obstacleMark, buildingMark);
......
......@@ -10,13 +10,13 @@ Simulator::Simulator() : timeStep_(0.2f), globalTime_(0.0f), nbSteps_(0)
std::cout << "setup scenario" << std::endl;
// importAgents("myAgents.pos");
// setupScenario(700);
// setupCircleScenario(500);
setupCityScenario(
-1.0f * (12 * (70.0f / 2.0f) - 10),
-1.0f * (12 * (70.0f / 2.0f) - 10),
20,
20
);
setupCircleScenario(1000);
// setupCityScenario(
// -1.0f * (12 * (70.0f / 2.0f) - 10),
// -1.0f * (12 * (70.0f / 2.0f) - 10),
// 20,
// 20
// );
// addPathsToAgents();
unsigned nbAgents = agents_.size();
......@@ -117,7 +117,7 @@ void Simulator::setupCircleScenario(unsigned int nbMaxAgent)
{
float pi = 3.14159265358979323846f;
float r = 400.0f;
float r = 800.0f;
for (unsigned int i = 0; i < nbMaxAgent; ++i)
{
VEC3 posagent(std::cos(i * 2.0f * pi / float(nbMaxAgent))*r,std::sin(i * 2.0f * pi / float(nbMaxAgent))*r,0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment