Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

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

city example config

parent bb5abfca
......@@ -70,63 +70,63 @@ void generateBuilding(typename PFP::MAP& map, typename PFP::TVEC3& position, Dar
dd = map.phi1(dd);
} while(dd != d);
// Dart dRoof;
// dRoof = extrudeFaceAndMark<PFP>(map, position, d, buildingMark, height);
//
// switch(buildingType)
// {
// case 0 :
// {
// break;
// }
// case 1 :
// {
// dRoof = extrudeFaceAndMark<PFP>(map, position, dRoof, buildingMark, height/3);
// Dart dNext = map.phi1(dRoof);
// Dart dPrev = map.phi2(map.phi_1(dRoof));
// map.collapseEdge(dNext);
// map.collapseEdge(dPrev);
// break;
// }
// case 2 :
// {
// dRoof = extrudeFaceAndMark<PFP>(map, position, dRoof, buildingMark, height/3);
// Dart dNext = map.phi1(dRoof);
// Dart dPrev = map.phi2(map.phi_1(dRoof));
// typename PFP::VEC3 mid1 = (position[dNext] + position[map.phi1(dNext)]) / 2.0f;
// typename PFP::VEC3 mid2 = (position[dPrev] + position[map.phi1(dPrev)]) / 2.0f;
// map.collapseEdge(dNext);
// map.collapseEdge(dPrev);
// position[dRoof] = mid2;
// position[map.phi1(dRoof)] = mid1;
// break;
// }
// case 3 :
// {
// unsigned int nbStairs = rand() % 5;
// for(unsigned int i = 0; i < nbStairs; ++i)
// {
// typename PFP::VEC3 c = Algo::Geometry::faceCentroid<PFP>(map, dRoof, position);
// Dart dRoofSmall = extrudeFaceAndMark<PFP>(map, position, dRoof, buildingMark, 0.0f);
// Dart dd = dRoofSmall;
// do
// {
// position[dd] = position[dd] + (c - position[dd]) / 3.0f;
// dd = map.phi1(dd);
// } while (dd != dRoofSmall);
// dRoof = extrudeFaceAndMark<PFP>(map, position, dRoofSmall, buildingMark, height / 2.0f);
// }
// bool spike= rand() % 2;
// if(spike)
// {
// typename PFP::VEC3 c = Algo::Geometry::faceCentroid<PFP>(map, dRoof, position);
// c[2] += height / 1.5f;
// dRoof = Algo::Modelisation::trianguleFace<PFP>(map, dRoof);
// position[dRoof] = c;
// }
// break;
// }
// }
Dart dRoof;
dRoof = extrudeFaceAndMark<PFP>(map, position, d, buildingMark, height);
switch(buildingType)
{
case 0 :
{
break;
}
case 1 :
{
dRoof = extrudeFaceAndMark<PFP>(map, position, dRoof, buildingMark, height/3);
Dart dNext = map.phi1(dRoof);
Dart dPrev = map.phi2(map.phi_1(dRoof));
map.collapseEdge(dNext);
map.collapseEdge(dPrev);
break;
}
case 2 :
{
dRoof = extrudeFaceAndMark<PFP>(map, position, dRoof, buildingMark, height/3);
Dart dNext = map.phi1(dRoof);
Dart dPrev = map.phi2(map.phi_1(dRoof));
typename PFP::VEC3 mid1 = (position[dNext] + position[map.phi1(dNext)]) / 2.0f;
typename PFP::VEC3 mid2 = (position[dPrev] + position[map.phi1(dPrev)]) / 2.0f;
map.collapseEdge(dNext);
map.collapseEdge(dPrev);
position[dRoof] = mid2;
position[map.phi1(dRoof)] = mid1;
break;
}
case 3 :
{
unsigned int nbStairs = rand() % 5;
for(unsigned int i = 0; i < nbStairs; ++i)
{
typename PFP::VEC3 c = Algo::Geometry::faceCentroid<PFP>(map, dRoof, position);
Dart dRoofSmall = extrudeFaceAndMark<PFP>(map, position, dRoof, buildingMark, 0.0f);
Dart dd = dRoofSmall;
do
{
position[dd] = position[dd] + (c - position[dd]) / 3.0f;
dd = map.phi1(dd);
} while (dd != dRoofSmall);
dRoof = extrudeFaceAndMark<PFP>(map, position, dRoofSmall, buildingMark, height / 2.0f);
}
bool spike= rand() % 2;
if(spike)
{
typename PFP::VEC3 c = Algo::Geometry::faceCentroid<PFP>(map, dRoof, position);
c[2] += height / 1.5f;
dRoof = Algo::Modelisation::trianguleFace<PFP>(map, dRoof);
position[dRoof] = c;
}
break;
}
}
}
template <typename PFP>
......@@ -142,24 +142,23 @@ void generateCity(typename PFP::MAP& map, typename PFP::TVEC3& position, CellMar
{
if(!buildingMark.isMarked(d) && (rand() % 12 == 0) && notDiagonalAdjacentToAnObstacle<PFP>(map, d, buildingMark))
{
typename PFP::VEC3 p = position[d];
float sideSize = 70.0f;
unsigned int nbSquares = 12;
unsigned int nbEmpty = 3;
int emptySquareX = (nbSquares * sideSize / 2.0f) - (nbEmpty * sideSize) - 10;
int emptySquareY = (nbSquares * sideSize / 2.0f) - (nbEmpty * sideSize) - 10;
if(! ((p[0] < -emptySquareX && p[1] < -emptySquareY) || (p[0] > emptySquareX && p[1] > emptySquareY)) )
{
// typename PFP::VEC3 p = position[d];
//
// float sideSize = 70.0f;
// unsigned int nbSquares = 24;
// unsigned int nbEmpty = 3;
//
// int emptySquareX = (nbSquares * sideSize / 2.0f) - (nbEmpty * sideSize) - 10;
// int emptySquareY = (nbSquares * sideSize / 2.0f) - (nbEmpty * sideSize) - 10;
// if(! ((p[0] < -emptySquareX && p[1] < -emptySquareY) || (p[0] > emptySquareX && p[1] > emptySquareY)) )
// {
generateBuilding<PFP>(map, position, d, (1+(rand()%3)) * height / 2.0f, rand() % 4, obstacleMark, buildingMark);
--nbBuilding;
}
// }
}
}
}
template <typename PFP>
void generateMall(typename PFP::MAP& map,typename PFP::TVEC3& position, CellMarker& obstacleMark, CellMarker& buildingMark, float sideSize)
{
......
......@@ -9,11 +9,11 @@ Simulator::Simulator() : timeStep_(0.2f), globalTime_(0.0f), nbSteps_(0)
std::cout << "setup scenario" << std::endl;
// importAgents("myAgents.pos");
// setupScenario(700);
setupCircleScenario(1000);
setupScenario(5000);
// setupCircleScenario(1000);
// setupCityScenario(
// -1.0f * (12 * (70.0f / 2.0f) - 10),
// -1.0f * (12 * (70.0f / 2.0f) - 10),
// -1.0f * (24 * (70.0f / 2.0f) - 10),
// -1.0f * (24 * (70.0f / 2.0f) - 10),
// 20,
// 20
// );
......@@ -165,8 +165,8 @@ void Simulator::setupScenario(unsigned int nbMaxAgent)
Dart d = envMap_.map.begin();
CellMarker filled(envMap_.map,FACE);
unsigned int nbx = 10;
unsigned int nby = 10;
unsigned int nbx = 3;
unsigned int nby = 3;
unsigned int bMax = nbMaxAgent / (nbx*nby);
......
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