Commit f68a5a85 authored by Mohcine Chraibi's avatar Mohcine Chraibi

fix inifile demo sources

group_id of source should be the same as group_id of agents
parent 7c4f1061
......@@ -51,7 +51,7 @@ bool GeoFileParser::LoadGeometry(Building* building)
{
std::string geoFilenameWithPath = _configuration->GetProjectRootDir()+_configuration->GetGeometryFile();
std::cout << "LodGeometry: file: " << geoFilenameWithPath << "\n";
std::cout << "\nLoadGeometry: file: " << geoFilenameWithPath << "\n";
TiXmlDocument docGeo(geoFilenameWithPath);
if (!docGeo.LoadFile()) {
......
......@@ -222,7 +222,7 @@ bool Simulation::InitArgs()
_agentSrcManager.SetBuilding(_building.get());
_agentSrcManager.SetMaxSimTime(GetMaxSimTime());
_gotSources = (bool) distributor->GetAgentsSources().size(); // did we have any sources? false if no sources
std::cout << " Got sources: " << _gotSources;
std::cout << "\nGot " << _gotSources << " sources"<< std::endl ;
for (const auto& src: distributor->GetAgentsSources()) {
_agentSrcManager.AddSource(src);
......
......@@ -73,10 +73,12 @@
</agents_distribution>
<agents_sources><!-- frequency in persons/seconds -->
<source id="1" frequency="2" agents_max="5" group_id="6" caption="source 1" />
<source id="2" agent_id="3" time="5" group_id="5" caption="source 2" />
<source id="3" agent_id="2" time="3" group_id="5" caption="source 3" />
<source id="4" agent_id="8" time="7" group_id="5" caption="source 4" />
<source id="1" frequency="2" agents_max="5" group_id="0" caption="source 1" />
<source id="2" agent_id="3" time="5" group_id="0" caption="source 2" />
<source id="3" agent_id="2" time="3" group_id="0" caption="source 3" />
<source id="4" agent_id="8" time="7" group_id="0" caption="source 4" />
<source id="5" agent_id="9" time="7" group_id="0" caption="source 5" startX="8" startY="5.4" />
<source id="6" agent_id="10" time="7" group_id="0" caption="source 6" startX="13" startY="5" />
</agents_sources>
</agents>
......
......@@ -89,7 +89,7 @@ int main(int argc, char** argv)
std::thread t1(&AgentsSourcesManager::Run, &sim.GetAgentSrcManager());
while(!sim.GetAgentSrcManager().IsRunning())
{
// std::cout << "waiting...\n";
//std::cout << "waiting...\n";
}
//main thread for the simulation
evacTime = sim.RunStandardSimulation(simMaxTime);
......
......@@ -57,13 +57,13 @@ void AgentsSourcesManager::Run()
{
SetRunning(true);
Log->Write("INFO:\tStarting agent manager thread");
/* std::cout<< KGRN << "\n Starting agent manager thread\n" << "\n>> time: " << Pedestrian::GetGlobalTime() << RESET << "\n"; */
std::cout<< KRED << "\n Starting agent manager thread\n" << ">> time: " << Pedestrian::GetGlobalTime() << RESET << "\n";
//Generate all agents required for the complete simulation
//It might be more efficient to generate at each frequency step
//TODO this loop is exactly GenerateAgents( --> REFACTOR)
for (const auto& src : _sources)
{
/* std::cout << "Generate AgentsAndAddToPool src: " << src->GetId() << "\n" ; */
std::cout << "Generate src: " << src->GetId() << "\n" ;
src->GenerateAgentsAndAddToPool(src->GetMaxAgents(), _building);
}
......
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