Commit 00cac57b authored by Ulrich Kemloh's avatar Ulrich Kemloh

fixed events: Routers are only created when the event manager is active

parent bf7cf239
......@@ -90,8 +90,8 @@ EventManager::EventManager(Building *_b)
//save the first graph
CreateRoutingEngine(_b, true);
//create and
CreateSomeEngine();
//create some events
//CreateSomeEngine();
}
EventManager::~EventManager()
......@@ -163,6 +163,9 @@ bool EventManager::ReadEventsXml()
_events.push_back(Event(id,zeit,type,state));
}
Log->Write("INFO: \tEvents were initialized");
//create some events
CreateSomeEngine();
return true;
}
......@@ -507,8 +510,6 @@ void EventManager::ProcessEvent()
ReadEventsTxt(current_time);
}
//close the door if it was open and relaunch the routing procedure
void EventManager::CloseDoor(int id)
{
......
......@@ -2,8 +2,16 @@
<JPScore project="JPS-Project" version="0.6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://xsd.jupedsim.org/0.6/jps_events.xsd">
<events update_frequency="2" update_radius="1" agents_color_by_knowledge="true">
<events update_frequency="1" update_radius="201.5" agents_color_by_knowledge="true">
<event time="10" type="door" state="close" id="2" caption="exit" />
<event time="30" type="door" state="close" id="3" caption="exit" />
</events>
</JPScore>
<!--
0.25=1/4
0.50=2/4
0.75=1.5/2
1=1/1
2=2/1
3=3/1
-->
\ No newline at end of file
......@@ -7,24 +7,24 @@ xsi:noNamespaceSchemaLocation="http://xsd.jupedsim.org/0.6/jps_geometry.xsd">
<room id="0" caption="hall">
<subroom id="0" closed="0" class="subroom">
<polygon caption="wall">
<vertex px="0.0" py="18.0" />
<vertex px="0.0" py="17.0" />
<vertex px="0.0" py="30.0" />
<vertex px="12.0" py="30.0" />
<vertex px="13.0" py="30.0" />
</polygon>
<polygon caption="wall">
<vertex px="18.0" py="30.0" />
<vertex px="17.0" py="30.0" />
<vertex px="30.0" py="30.0" />
<vertex px="30.0" py="18.0" />
<vertex px="30.0" py="17.0" />
</polygon>
<polygon caption="wall">
<vertex px="30.0" py="12.0" />
<vertex px="30.0" py="13.0" />
<vertex px="30.0" py="0.0" />
<vertex px="18.0" py="0.0" />
<vertex px="17.0" py="0.0" />
</polygon>
<polygon caption="wall">
<vertex px="12.0" py="0.0" />
<vertex px="13.0" py="0.0" />
<vertex px="0.0" py="0.0" />
<vertex px="0.0" py="12.0" />
<vertex px="0.0" py="13.0" />
</polygon>
</subroom>
</room>
......@@ -33,23 +33,23 @@ xsi:noNamespaceSchemaLocation="http://xsd.jupedsim.org/0.6/jps_geometry.xsd">
<transitions>
<transition id="2" caption="exit" type="emergency"
room1_id="0" subroom1_id="0" room2_id="-1" subroom2_id="-1">
<vertex px="0.0" py="12.0" />
<vertex px="0.0" py="18.0" />
<vertex px="0.0" py="13.0" />
<vertex px="0.0" py="17.0" />
</transition>
<transition id="3" caption="exit" type="emergency"
room1_id="0" subroom1_id="0" room2_id="-1" subroom2_id="-1">
<vertex px="12.0" py="30.0" />
<vertex px="18.0" py="30.0" />
<vertex px="13.0" py="30.0" />
<vertex px="17.0" py="30.0" />
</transition>
<transition id="4" caption="exit" type="emergency"
room1_id="0" subroom1_id="0" room2_id="-1" subroom2_id="-1">
<vertex px="30.0" py="12.0" />
<vertex px="30.0" py="18.0" />
<vertex px="30.0" py="13.0" />
<vertex px="30.0" py="17.0" />
</transition>
<transition id="5" caption="exit" type="emergency"
room1_id="0" subroom1_id="0" room2_id="-1" subroom2_id="-1">
<vertex px="12.0" py="0.0" />
<vertex px="18.0" py="0.0" />
<vertex px="13.0" py="0.0" />
<vertex px="17.0" py="0.0" />
</transition>
</transitions>
</geometry>
\ No newline at end of file
......@@ -6,11 +6,11 @@
<seed>12542</seed>
<!-- geometry file -->
<geometry>big_room_geo.xml</geometry>
<events_files>big_room_events.xml</events_files>
<max_sim_time>300</max_sim_time>
<events_file>big_room_events.xml</events_file>
<max_sim_time>1500</max_sim_time>
<!-- trajectories file and format -->
<trajectories format="xml-plain" fps="8">
<trajectories format="xml-plain" fps="8" color_mode="knowledge">
<file location="big_room_trajectories.xml" />
<socket hostname="127.0.0.1" port="8989" />
</trajectories>
......@@ -29,7 +29,7 @@
</traffic_constraints>
<routing>
<goals>
<goals_>
<goal id="0" final="true" caption="goal1">
<polygon>
<vertex px="0.0" py="12.0" />
......@@ -66,22 +66,22 @@
<vertex px="12.0" py="0.0" />
</polygon>
</goal>
</goals>
</goals_>
</routing>
<!--persons information and distribution -->
<agents operational_model_id="2">
<agents_distribution>
<group group_id="0" room_id="0" subroom_id="0" number="0" router_id="1" agent_parameter_id="1" risk_tolerance_mean="0.8"
risk_tolerance_sigma="0.01" x_min="14" x_max="16" y_min="14" y_max="16" />
<group group_id="0" agent_parameter_id="1" room_id="0" subroom_id="0" number="000" router_id="1" risk_tolerance_mean="0.9"
risk_tolerance_sigma="0.01" />
<group group_id="1" room_id="0" subroom_id="0" number="0" router_id="1" agent_parameter_id="1" />
<group group_id="1" agent_parameter_id="1" room_id="0" subroom_id="0" number="600" router_id="1" />
</agents_distribution>
<agents_sources><!-- frequency in persons/seconds -->
<source id="0" frequency="1" agents_max="5" group_id="0" caption="source 1" />
<source id="1" frequency="1" agents_max="5" group_id="1" caption="source 1" />
</agents_sources>
<!-- <agents_sources>frequency in persons/seconds -->
<!-- <source id="0" frequency="1" agents_max="5" group_id="0" caption="source 1" /> -->
<!-- <source id="1" frequency="1" agents_max="5" group_id="1" caption="source 1" /> -->
<!-- </agents_sources> -->
</agents>
......@@ -117,13 +117,17 @@
<model_parameters>
<solver>euler</solver>
<stepsize>0.01</stepsize>
<exit_crossing_strategy>4</exit_crossing_strategy>
<exit_crossing_strategy>3</exit_crossing_strategy>
<linkedcells enabled="true" cell_size="3.4" />
<force_ped nu="3" b="0.25" c="3.0" />
<force_wall nu="10" b="0.70" c="3.0" />
<force_ped nu="0.6" b="0.034229" c="2.450932" />
<force_wall nu="2.0" b="0.034229" c="2.450932" />
<!-- <force_ped nu="0.5" b="0.034229" c="2.450932" /> -->
<!-- <force_wall nu="1.5" b="0.034229" c="2.450932" /> -->
<!-- <force_ped nu="3" b="0.25" c="3.0" /> -->
<!-- <force_wall nu="2" b="0.70" c="3.0" /> -->
</model_parameters>
<agent_parameters agent_parameter_id="1">
<v0 mu="1.0" sigma="0.0" />
<v0 mu="1.0" sigma="0.1" />
<bmax mu="0.25" sigma="0.001" />
<bmin mu="0.20" sigma="0.001" />
<amin mu="0.18" sigma="0.001" />
......
......@@ -224,7 +224,7 @@ void GompertzModel::ComputeNextTimeStep(double current, double deltaT, Building*
}
//only update the position if the velocity is above a threshold
if (1 || v_neu.Norm() >= J_EPS_V*0.7)
//if (v_neu.Norm() >= J_EPS_V*0.7)
{
ped->SetPos(pos_neu);
ped->SetPhiPed();
......@@ -360,7 +360,7 @@ Point GompertzModel::ForceRepPed(Pedestrian* ped1, Pedestrian* ped2) const
Point GompertzModel::ForceRepRoom(Pedestrian* ped, SubRoom* subroom) const
{
Point f(0., 0.);
Point centroid = subroom->GetCentroid();
const Point& centroid = subroom->GetCentroid();
bool inside = subroom->IsInSubRoom(centroid);
//first the walls
for(const auto & wall: subroom->GetAllWalls())
......@@ -384,7 +384,7 @@ Point GompertzModel::ForceRepRoom(Pedestrian* ped, SubRoom* subroom) const
}
// and finally the closed doors
for(auto & goal: subroom->GetAllTransitions())
for(const auto & goal: subroom->GetAllTransitions())
{
if(! goal->IsOpen())
{
......
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