Commit 5714528d authored by Fabien Grzeskowiak's avatar Fabien Grzeskowiak

52 add percentage bar

parent d2b1b97c
......@@ -39,11 +39,11 @@ int main( int argc, char * argv[] )
CrowdSimulator cs;
cs.setOutputDir("./output/");
cs.runMasterConfigFile("MainConfig.xml");
cs.runMasterConfigFile("./MainConfig.xml");
//cs.runWorld(1000, 0.0333);
std::cout << "---------------" << std::endl;
std::cout << "Simulation done"<< std::endl;
std::cout << "---------------" << std::endl;
......
<?xml version="1.0" encoding="utf-8"?>
<configPath path="../examples/SocialForceAvoidanceDirGoalReaching/config.xml"/>
<!-- <configPath path="./examples/SocialForceAvoidance/config.xml"/> -->
<configPath path="../test/SocialForcesExample.xml"/>
No preview for this file type
......@@ -96,7 +96,7 @@ void CrowdSimulator::stepWorld()
poss[agent->getID()] = agent->getPosition();
writer.appendPedPositions(poss, t);
//writer->flush(); //! @todo: should be removed after test
writer.flush(); //! @todo: should be removed after test
}
/**
......@@ -105,8 +105,13 @@ void CrowdSimulator::stepWorld()
*/
void CrowdSimulator::runWorld(int steps)
{
for (int i = 0; i < steps; ++i)
int p = steps/50;
std::cout << "|--------------------------------------------------|100%" << std::endl << "[";
for (int i = 0; i < steps; ++i){
stepWorld();
if(i%p == 0) std::cout << "#" << std::flush;
}
std::cout << "]" << std::endl;
writer.flush();
}
......
......@@ -67,7 +67,7 @@ void XMLParser::loadMasterConfig(const std::string &filename, World * world){
// Check if the main config file lies in a subfolder.
auto endOfPath = filename.find_last_of('/');
std::string mainPath = (endOfPath < 0 ? "" : filename.substr(0, endOfPath));
load(mainPath + simConfigPathElt->Attribute("path"), world);
load(mainPath + "/" + simConfigPathElt->Attribute("path"), world);
}
else
std::cerr << "Warning: No paths for configuration in the XML file" << std::endl;
......
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