Commit 4dcd1bf0 authored by Ulrich Kemloh's avatar Ulrich Kemloh

Fixed: error in direction strategy 3

Updated demos files
parent f7905818
......@@ -2,7 +2,7 @@
<JuPedSim project="JPS-Project" version="0.5"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../xsd/jps_ini_core.xsd">
xsi:noNamespaceSchemaLocation="http://134.94.2.137/jps_ini_core.xsd">
<!-- seed used for initialising random generator -->
<seed>12542</seed>
......@@ -13,13 +13,13 @@ xsi:noNamespaceSchemaLocation="../../xsd/jps_ini_core.xsd">
<file location="bottleneck_traj.xml" />
</trajectories>
<!-- where to store the logs -->
<logfile>log</logfile>
<logfile>log.txt</logfile>
<!-- traffic information: e.g closed doors or smoked rooms -->
<traffic_constraints>
<!-- doors states are: close or open -->
<doors>
<door trans_id="2" caption="" state="open" />
<door trans_id="2" caption="main_exit" state="open" />
</doors>
</traffic_constraints>
......@@ -38,68 +38,68 @@ xsi:noNamespaceSchemaLocation="../../xsd/jps_ini_core.xsd">
</routing>
<!--persons information and distribution -->
<agents operational_model_id="1">
<agents operational_model_id="2">
<agents_distribution>
<group group_id="1" agent_parameter_id="1" room_id="1" subroom_id="0" number="40" goal_id="0" router_id="1" />
</agents_distribution>
</agents>
<!-- These parameters may be overwritten -->
<operational_models>
<model operational_model_id="1" description="gcfm">
<model_parameters>
<solver>euler</solver>
<stepsize>0.01</stepsize>
<exitCrossingStrategy>4</exitCrossingStrategy>
<linkedcells enabled="true" cell_size="2.2" />
<force_ped nu="0.3" dist_max="3" disteff_max="2" interpolation_width="0.1" />
<force_wall nu="0.2" dist_max="3" disteff_max="2" interpolation_width="0.1" />
</model_parameters>
<agent_parameters agent_parameter_id="1">
<v0 mu="0.5" sigma="0.0" />
<bmax mu="0.25" sigma="0.001" />
<bmin mu="0.20" sigma="0.001" />
<amin mu="0.18" sigma="0.001" />
<tau mu="0.5" sigma="0.001" />
<atau mu="0.5" sigma="0.001" />
</agent_parameters>
<agent_parameters agent_parameter_id="2">
<v0 mu="0.5" sigma="0.0" />
<bmax mu="0.25" sigma="0.001" />
<bmin mu="0.20" sigma="0.001" />
<amin mu="0.18" sigma="0.001" />
<tau mu="0.5" sigma="0.001" />
<atau mu="0.5" sigma="0.001" />
</agent_parameters>
</model>
<operational_models>
<model operational_model_id="1" description="gcfm">
<model_parameters>
<solver>euler</solver>
<stepsize>0.01</stepsize>
<exitCrossingStrategy>4</exitCrossingStrategy>
<linkedcells enabled="true" cell_size="2.2" />
<force_ped nu="0.3" dist_max="3" disteff_max="2" interpolation_width="0.1" />
<force_wall nu="0.2" dist_max="3" disteff_max="2" interpolation_width="0.1" />
</model_parameters>
<agent_parameters agent_parameter_id="1">
<v0 mu="0.5" sigma="0.0" />
<bmax mu="0.25" sigma="0.001" />
<bmin mu="0.20" sigma="0.001" />
<amin mu="0.18" sigma="0.001" />
<tau mu="0.5" sigma="0.001" />
<atau mu="0.5" sigma="0.001" />
</agent_parameters>
<agent_parameters agent_parameter_id="2">
<v0 mu="0.5" sigma="0.0" />
<bmax mu="0.25" sigma="0.001" />
<bmin mu="0.20" sigma="0.001" />
<amin mu="0.18" sigma="0.001" />
<tau mu="0.5" sigma="0.001" />
<atau mu="0.5" sigma="0.001" />
</agent_parameters>
</model>
<model operational_model_id="2" description="gompertz">
<model_parameters>
<solver>euler</solver>
<stepsize>0.01</stepsize>
<exitCrossingStrategy>3</exitCrossingStrategy>
<linkedcells enabled="true" cell_size="2.2" />
<force_ped nu="3" b="0.25" c="3.0"/>
<force_wall nu="10" b="0.70" c="3.0"/>
</model_parameters>
<agent_parameters agent_parameter_id="1">
<v0 mu="0.5" sigma="0.0" />
<bmax mu="0.25" sigma="0.001" />
<bmin mu="0.20" sigma="0.001" />
<amin mu="0.18" sigma="0.001" />
<tau mu="0.5" sigma="0.001" />
<atau mu="0.5" sigma="0.001" />
</agent_parameters>
<agent_parameters agent_parameter_id="2">
<v0 mu="0" sigma="0.0" />
<bmax mu="0.25" sigma="0.001" />
<bmin mu="0.20" sigma="0.001" />
<amin mu="0.18" sigma="0.001" />
<tau mu="0.5" sigma="0.001" />
<atau mu="0.5" sigma="0.001" />
</agent_parameters>
</model>
</operational_models>
<model operational_model_id="2" description="gompertz">
<model_parameters>
<solver>euler</solver>
<stepsize>0.01</stepsize>
<exitCrossingStrategy>3</exitCrossingStrategy>
<linkedcells enabled="true" cell_size="2.2" />
<force_ped nu="3" b="0.25" c="3.0"/>
<force_wall nu="10" b="0.70" c="3.0"/>
</model_parameters>
<agent_parameters agent_parameter_id="1">
<v0 mu="0.5" sigma="0.0" />
<bmax mu="0.25" sigma="0.001" />
<bmin mu="0.20" sigma="0.001" />
<amin mu="0.18" sigma="0.001" />
<tau mu="0.5" sigma="0.001" />
<atau mu="0.5" sigma="0.001" />
</agent_parameters>
<agent_parameters agent_parameter_id="2">
<v0 mu="0" sigma="0.0" />
<bmax mu="0.25" sigma="0.001" />
<bmin mu="0.20" sigma="0.001" />
<amin mu="0.18" sigma="0.001" />
<tau mu="0.5" sigma="0.001" />
<atau mu="0.5" sigma="0.001" />
</agent_parameters>
</model>
</operational_models>
<route_choice_models>
<router router_id="1" description="global_shortest">
......
......@@ -26,7 +26,7 @@ xsi:noNamespaceSchemaLocation="../../xsd/jps_geometry.xsd">
<vertex px="15.0" py="4.0" />
<vertex px="10.0" py="4.0" />
</polygon>
<!--
<obstacle id="0" caption="table" height="1.0" closed="1">
<polygon>
<vertex px="12.0" py="5.9" />
......@@ -45,6 +45,7 @@ xsi:noNamespaceSchemaLocation="../../xsd/jps_geometry.xsd">
<vertex px="16.4" py="-2.0" />
</polygon>
</obstacle>
-->
</subroom>
<crossings>
<!-- virtual exits between subrooms -->
......
......@@ -40,7 +40,7 @@ xsi:noNamespaceSchemaLocation="../../xsd/jps_ini_core.xsd">
<!--persons information and distribution -->
<agents operational_model_id="1">
<agents_distribution>
<group group_id="1" agent_parameter_id="1" room_id="0" subroom_id="0" number="10"
<group group_id="1" agent_parameter_id="1" room_id="0" subroom_id="0" number="30"
goal_id="-1" router_id="1" />
</agents_distribution>
......
......@@ -41,7 +41,7 @@ xsi:noNamespaceSchemaLocation="../../xsd/jps_ini_core.xsd">
<!--persons information and distribution -->
<agents operational_model_id="1">
<agents operational_model_id="2">
<agents_distribution>
<group group_id="1" agent_parameter_id="1" room_id="0" subroom_id="0" number="100" router_id="1"/>
</agents_distribution>
......
<?xml version="1.0" encoding="UTF-8" ?>
<JuPedSim project="arena-section-Project" version="0.5"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../xsd/jps_ini_core.xsd">
<JuPedSim project="arena-section-Project" version="0.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/jps_ini_core.xsd">
<!-- seed used for initialising random generator -->
<seed>12542</seed>
<!-- geometry file -->
<max_sim_time>600</max_sim_time>
<!-- geometry file -->
<geometry>arena_geometry.xml</geometry>
<!-- trajectories file and format -->
<trajectories format="xml-plain" fps="8">
<file location="arena_trajectories.xml" />
<!--<socket hostname="127.0.0.1" port="8989"/> -->
</trajectories>
<!-- where to store the logs -->
<!--<logfile>outputfiles/log.txt</logfile> -->
<!-- seed used for initialising random generator -->
<seed>12542</seed>
<!-- geometry file -->
<max_sim_time>600</max_sim_time>
<!-- geometry file -->
<geometry>arena_geometry.xml</geometry>
<!-- trajectories file and format -->
<trajectories format="xml-plain" fps="8">
<file location="arena_trajectories.xml" />
<!--<socket hostname="127.0.0.1" port="8989"/> -->
</trajectories>
<!-- where to store the logs -->
<!--<logfile>outputfiles/log.txt</logfile> -->
<!-- traffic information: e.g closed doors or smoked rooms -->
<traffic_constraints>
<!-- doors states are: close or open -->
<doors>
<door trans_id="2503" caption="AR09URO08" state="close" />
<door trans_id="2512" caption="AR09URO07" state="close" />
<door trans_id="2501" caption="TREPPE001" state="close" />
</doors>
</traffic_constraints>
<!-- traffic information: e.g closed doors or smoked rooms -->
<traffic_constraints>
<!-- doors states are: close or open -->
<doors>
<door trans_id="2503" caption="AR09URO08" state="close" />
<door trans_id="2512" caption="AR09URO07" state="close" />
<door trans_id="2501" caption="TREPPE001" state="close" />
</doors>
</traffic_constraints>
<routing>
<goals>
<goal id="0" final="false" caption="goal 1">
<polygon>
<vertex px="-115.0" py="-95.0" />
<vertex px="-100.0" py="-95.0" />
<vertex px="-100.0" py="-80.0" />
<vertex px="-115.0" py="-80.0" />
<vertex px="-115.0" py="-95.0" />
</polygon>
</goal>
<goal id="1" final="false" caption="goal 2">
<polygon>
<vertex px="-115.0" py="95.0" />
<vertex px="-100.0" py="95.0" />
<vertex px="-100.0" py="80.0" />
<vertex px="-115.0" py="80.0" />
<vertex px="-115.0" py="95.0" />
</polygon>
</goal>
</goals>
</routing>
<routing>
<goals>
<goal id="0" final="false" caption="goal 1">
<polygon>
<vertex px="-115.0" py="-95.0" />
<vertex px="-100.0" py="-95.0" />
<vertex px="-100.0" py="-80.0" />
<vertex px="-115.0" py="-80.0" />
<vertex px="-115.0" py="-95.0" />
</polygon>
</goal>
<goal id="1" final="false" caption="goal 2">
<polygon>
<vertex px="-115.0" py="95.0" />
<vertex px="-100.0" py="95.0" />
<vertex px="-100.0" py="80.0" />
<vertex px="-115.0" py="80.0" />
<vertex px="-115.0" py="95.0" />
</polygon>
</goal>
</goals>
</routing>
<!--persons information and distribution -->
<agents operational_model_id="1" >
<agents_distribution>
<group group_id="0" agent_parameter_id="1" room_id="0" subroom_id="0" number="60" router_id="1"/>
</agents_distribution>
</agents>
<!--persons information and distribution -->
<agents operational_model_id="1">
<agents_distribution>
<group group_id="0" agent_parameter_id="1" room_id="0" subroom_id="0" number="60" router_id="1" />
</agents_distribution>
</agents>
<!-- These parameters may be overwritten -->
<operational_models>
<model operational_model_id="1" description="gcfm">
<model_parameters>
<solver>euler</solver>
<stepsize>0.01</stepsize>
<exitCrossingStrategy>3</exitCrossingStrategy>
<linkedcells enabled="true" cell_size="2.2" />
<force_ped nu="0.3" dist_max="3" disteff_max="2"
interpolation_width="0.1" />
<force_wall nu="0.2" dist_max="3" disteff_max="2"
interpolation_width="0.1" />
</model_parameters>
<agent_parameters agent_parameter_id="1">
<v0 mu="0.5" sigma="0.0" />
<bmax mu="0.25" sigma="0.001" />
<bmin mu="0.20" sigma="0.001" />
<amin mu="0.18" sigma="0.001" />
<tau mu="0.5" sigma="0.001" />
<atau mu="0.5" sigma="0.001" />
</agent_parameters>
</model>
<model operational_model_id="2" description="gompertz">
<model_parameters>
<solver>euler</solver>
<stepsize>0.01</stepsize>
<exitCrossingStrategy>5</exitCrossingStrategy>
<linkedcells enabled="true" cell_size="2.2" />
<force_ped nu="0.3" />
<force_wall nu="0.2" />
</model_parameters>
<agent_parameters agent_parameter_id="1">
<v0 mu="0.5" sigma="0.0" />
<bmax mu="0.25" sigma="0.001" />
<bmin mu="0.20" sigma="0.001" />
<amin mu="0.18" sigma="0.001" />
<tau mu="0.5" sigma="0.001" />
<atau mu="0.5" sigma="0.001" />
</agent_parameters>
</model>
</operational_models>
<!-- These parameters may be overwritten -->
<operational_models>
<model operational_model_id="1" description="gcfm">
<model_parameters>
<solver>euler</solver>
<stepsize>0.01</stepsize>
<exitCrossingStrategy>3</exitCrossingStrategy>
<linkedcells enabled="true" cell_size="2.2" />
<force_ped nu="0.3" dist_max="3" disteff_max="2" interpolation_width="0.1" />
<force_wall nu="0.2" dist_max="3" disteff_max="2" interpolation_width="0.1" />
</model_parameters>
<agent_parameters agent_parameter_id="1">
<v0 mu="0.5" sigma="0.0" />
<bmax mu="0.25" sigma="0.001" />
<bmin mu="0.20" sigma="0.001" />
<amin mu="0.18" sigma="0.001" />
<tau mu="0.5" sigma="0.001" />
<atau mu="0.5" sigma="0.001" />
</agent_parameters>
</model>
<model operational_model_id="2" description="gompertz">
<model_parameters>
<solver>euler</solver>
<stepsize>0.01</stepsize>
<exitCrossingStrategy>5</exitCrossingStrategy>
<linkedcells enabled="true" cell_size="2.2" />
<force_ped nu="0.3" />
<force_wall nu="0.2" />
</model_parameters>
<agent_parameters agent_parameter_id="1">
<v0 mu="0.5" sigma="0.0" />
<bmax mu="0.25" sigma="0.001" />
<bmin mu="0.20" sigma="0.001" />
<amin mu="0.18" sigma="0.001" />
<tau mu="0.5" sigma="0.001" />
<atau mu="0.5" sigma="0.001" />
</agent_parameters>
</model>
</operational_models>
<route_choice_models>
<router router_id="1" description="global_shortest">
<parameters>
<!-- extra routing information -->
<navigation_lines file="arena_routing.xml" />
</parameters>
</router>
</route_choice_models>
<route_choice_models>
<router router_id="1" description="global_shortest">
<parameters>
<!-- extra routing information -->
<navigation_lines file="arena_routing.xml" />
</parameters>
</router>
</route_choice_models>
</JuPedSim>
......@@ -46,7 +46,7 @@ EventManager::EventManager(Building *_b)
_dynamic=false;
_file = fopen("../events/events.txt","r");
if(!_file) {
Log->Write("INFO:\tDatei events.txt nicht gefunden. Dynamisches Eventhandling nicht moeglich.");
//Log->Write("INFO:\tDatei events.txt nicht gefunden. Dynamisches Eventhandling nicht moeglich.");
} else {
Log->Write("INFO:\tDatei events.txt gefunden. Dynamisches Eventhandling moeglich.");
_dynamic=true;
......@@ -68,7 +68,6 @@ void EventManager::SetProjectRootDir(const std::string &filename)
void EventManager::readEventsXml()
{
Log->Write("INFO: \tReading events\n ");
//get the geometry filename from the project file
TiXmlDocument doc(_projectFilename);
if (!doc.LoadFile()) {
......@@ -87,11 +86,12 @@ void EventManager::readEventsXml()
TiXmlDocument docEvent(eventfile);
if(!docEvent.LoadFile()) {
Log->Write("INFO: \t%s",docEvent.ErrorDesc());
Log->Write("INFO: \t could not parse the event file. So no Events are found.");
//Log->Write("INFO: \t%s",docEvent.ErrorDesc());
//Log->Write("INFO: \t could not parse the event file. So no Events are found.");
//exit(EXIT_FAILURE);
return;
}
Log->Write("INFO: \tReading events\n ");
TiXmlElement* xRootNode = docEvent.RootElement();
if(!xRootNode) {
......
......@@ -63,7 +63,7 @@ std::string Point::toString() const
std::stringstream tmp;
tmp<<"( "<<_x<<" : " <<_y<<" )";
return tmp.str();
};
}
void Point::SetX(double x)
{
......
<?xml version="1.0" encoding="UTF-8" ?>
<JuPedSim project="arena-section-Project" version="0.5"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://134.94.2.137/jps_ini_core.xsd">
<JuPedSim project="arena-section-Project" version="0.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://134.94.2.137/jps_ini_core.xsd">
<!-- seed used for initialising random generator -->
<seed>12542</seed>
<!-- geometry file -->
<max_sim_time>60</max_sim_time>
<!-- geometry file -->
<geometry>131021_arena_section.xml</geometry>
<!-- trajectories file and format -->
<trajectories format="xml-plain" fps="8">
<file location="trajectories-arena-section.xml" />
<!--<socket hostname="127.0.0.1" port="8989"/> -->
</trajectories>
<!-- where to store the logs -->
<!--<logfile>outputfiles/log.txt</logfile> -->
<!-- seed used for initialising random generator -->
<seed>12542</seed>
<!-- geometry file -->
<max_sim_time>600</max_sim_time>
<!-- geometry file -->
<geometry>131021_arena_section.xml</geometry>
<!-- trajectories file and format -->
<trajectories format="xml-plain" fps="8">
<file location="trajectories-arena-section.xml" />
<!--<socket hostname="127.0.0.1" port="8989"/> -->
</trajectories>
<!-- where to store the logs -->
<!--<logfile>outputfiles/log.txt</logfile> -->
<!-- traffic information: e.g closed doors or smoked rooms -->
<traffic_constraints>
<!-- room states are: good or smoked -->
<!-- doors states are: close or open -->
<doors>
</doors>
</traffic_constraints>
<!-- traffic information: e.g closed doors or smoked rooms -->
<traffic_constraints>
<!-- doors states are: close or open -->
<doors>
<door trans_id="2503" caption="AR09URO08" state="close" />
<door trans_id="2512" caption="AR09URO07" state="close" />
<door trans_id="2501" caption="TREPPE001" state="close" />
</doors>
</traffic_constraints>
<routing>
<goals>
<goal id="0" final="false" caption="goal 1">
<polygon>
<vertex px="-115.0" py="-95.0" />
<vertex px="-100.0" py="-95.0" />
<vertex px="-100.0" py="-80.0" />
<vertex px="-115.0" py="-80.0" />
<vertex px="-115.0" py="-95.0" />
</polygon>
</goal>
<goal id="1" final="false" caption="goal 2">
<polygon>
<vertex px="-115.0" py="95.0" />
<vertex px="-100.0" py="95.0" />
<vertex px="-100.0" py="80.0" />
<vertex px="-115.0" py="80.0" />
<vertex px="-115.0" py="95.0" />
</polygon>
</goal>
<goal id="2" final="true" caption="goal 3">
<polygon>
<vertex px="115.0" py="95.0" />
<vertex px="100.0" py="95.0" />
<vertex px="100.0" py="80.0" />
<vertex px="115.0" py="80.0" />
<vertex px="115.0" py="95.0" />
</polygon>
</goal>
</goals>
</routing>
<routing>
<goals>
<goal id="0" final="false" caption="goal 1">
<polygon>
<vertex px="-115.0" py="-95.0" />
<vertex px="-100.0" py="-95.0" />
<vertex px="-100.0" py="-80.0" />
<vertex px="-115.0" py="-80.0" />
<vertex px="-115.0" py="-95.0" />
</polygon>
</goal>
<goal id="1" final="false" caption="goal 2">
<polygon>
<vertex px="-115.0" py="95.0" />
<vertex px="-100.0" py="95.0" />
<vertex px="-100.0" py="80.0" />
<vertex px="-115.0" py="80.0" />
<vertex px="-115.0" py="95.0" />
</polygon>
</goal>
<goal id="2" final="true" caption="goal 3">
<polygon>
<vertex px="115.0" py="95.0" />
<vertex px="100.0" py="95.0" />
<vertex px="100.0" py="80.0" />
<vertex px="115.0" py="80.0" />
<vertex px="115.0" py="95.0" />
</polygon>
</goal>
</goals>
</routing>
<!--persons information and distribution -->
<agents operational_model_id="1">
<agents_distribution>
<group group_id="0" agent_parameter_id="1" room_id="0" subroom_id="0" number="60" router_id="1"/>
</agents_distribution>
</agents>
<!--persons information and distribution -->
<agents operational_model_id="1">
<agents_distribution>
<group group_id="0" agent_parameter_id="1" room_id="0" subroom_id="0" number="60" router_id="1" />
</agents_distribution>
</agents>
<!-- These parameters may be overwritten -->
<operational_models>
<model operational_model_id="1" description="gcfm">
<model_parameters>
<solver>euler</solver>
<stepsize>0.01</stepsize>
<exitCrossingStrategy>3</exitCrossingStrategy>
<linkedcells enabled="true" cell_size="2.2" />
<force_ped nu="0.3" dist_max="3" disteff_max="2" interpolation_width="0.1" />
<force_wall nu="0.2" dist_max="3" disteff_max="2" interpolation_width="0.1" />
</model_parameters>
<agent_parameters agent_parameter_id="1">
<v0 mu="0.5" sigma="0.0" />
<bmax mu="0.25" sigma="0.001" />
<bmin mu="0.20" sigma="0.001" />
<amin mu="0.18" sigma="0.001" />
<tau mu="0.5" sigma="0.001" />
<atau mu="0.5" sigma="0.001" />
</agent_parameters>
</model>
</operational_models>
<!-- These parameters may be overwritten -->
<operational_models>
<model operational_model_id="1" description="gcfm">
<model_parameters>
<solver>euler</solver>
<stepsize>0.001</stepsize>
<exitCrossingStrategy>4</exitCrossingStrategy>
<linkedcells enabled="true" cell_size="2.2" />
<force_ped nu="0.3" dist_max="3" disteff_max="2" interpolation_width="0.1" />
<force_wall nu="0.2" dist_max="3" disteff_max="2" interpolation_width="0.1" />
</model_parameters>
<agent_parameters agent_parameter_id="1">
<v0 mu="0.5" sigma="0.0" />
<bmax mu="0.25" sigma="0.001" />
<bmin mu="0.20" sigma="0.001" />
<amin mu="0.18" sigma="0.001" />
<tau mu="0.5" sigma="0.001" />
<atau mu="0.5" sigma="0.001" />
</agent_parameters>
</model>
</operational_models>
<route_choice_models>
<router router_id="1" description="global_shortest">
<parameters>
<!-- extra routing information -->
<navigation_lines file="131021_arena_routing.xml" />
</parameters>
</router>
</route_choice_models>
<route_choice_models>
<router router_id="1" description="global_shortest">
<parameters>
<!-- extra routing information -->
<navigation_lines file="131021_arena_routing.xml" />
</parameters>
</router>
</route_choice_models>
</JuPedSim>
......@@ -39,9 +39,6 @@ DirectionStrategy::DirectionStrategy()
{
}
DirectionStrategy::DirectionStrategy(const DirectionStrategy& orig)
{
}
DirectionStrategy::~DirectionStrategy()
{
......@@ -66,7 +63,7 @@ Point DirectionMinSeperationShorterLine::GetTarget(Room* room, Pedestrian* ped)
if(p1 == p2) return p1;
double length = (p1 - p2).Norm();
if(d >= 0.5*length) return (p1 - p2)*0.5; // return the middle point, since line is anyway toot short
if(d >= 0.5*length) return (p1 + p2)*0.5; // return the middle point, since line is anyway too short
double u = d/length; // d is supposed to be smaller than length, then u is in [0, 1]
//Point diff = (p1 - p2).Normalized() * d;
Line e_neu = Line(p1 + (p2-p1)*u, p1 + (p2-p1)*(1-u));
......
......@@ -38,7 +38,6 @@ class DirectionStrategy {
public:
DirectionStrategy();
DirectionStrategy(const DirectionStrategy& orig);
virtual ~DirectionStrategy();
virtual Point GetTarget(Room* room, Pedestrian* ped) const = 0;
};
......
......@@ -49,8 +49,6 @@ GraphRouter::~GraphRouter()
int GraphRouter::FindExit(Pedestrian* p)
{
//std::cout << p->Getdt() << "\n";
set<int> closed_doors = p->GetKnownClosedDoors();
if(p->GetLastDestination() == -1) {
......@@ -147,7 +145,6 @@ void GraphRouter::Init(Building* b)
{
GlobalRouter::Init(b);
Log->Write("ERROR: GRAPHROUTER is not ready to use yet.");
_building = b;
g.init(b);
......
......@@ -654,7 +654,7 @@ void NavMesh::WriteToString(std::string& output)
//writing the nodes
// int mynodes[] = {47, 30 ,38};
// int mynodes[] = {41, 1521};
int mynodes[] = {};
int mynodes[] = {0};
//int mynodes[] = { 28, 27, 40};
vector<int> nodes_to_plot (mynodes, mynodes + sizeof(mynodes) / sizeof(int) );
......
This diff is collapsed.
......@@ -53,6 +53,7 @@ public:
virtual ~QuickestPathRouter();
virtual int FindExit(Pedestrian* ped);
virtual void Init(Building* building);
private:
......@@ -148,6 +149,10 @@ private:
int redirect(int pedindex,int actualexit=-1);
/**
* return the JAM size at a specific exit
* NOT IMPLEMENTED
*/
double GetJamSizeAtExit(int exitID);
/**
......@@ -163,18 +168,18 @@ private:
/**
* extend the graph by connecting alternative routes.