Commit fd45a870 authored by Mohcine Chraibi's avatar Mohcine Chraibi

Merge branch 'gradnav' of cst.version.fz-juelich.de:Arne/jpscore into gradnav

Conflicts:
	routing/FloorfieldViaFM.cpp
parents 923ecc45 de18ad7a
......@@ -97,14 +97,14 @@
<solver>euler</solver>
<stepsize>0.01</stepsize>
<exit_crossing_strategy>6</exit_crossing_strategy>
<floorfield delta_h="0.0625" wall_avoid_distance="linspace(0.5,1.0,2)" use_wall_avoidance="true" />
<floorfield delta_h="0.0625" wall_avoid_distance="linspace(0.4,1.6,4)" use_wall_avoidance="true" />
<linkedcells enabled="true" cell_size="4.2" />
<force_ped nu="3" b="1.0" c="3.0" />
<force_wall nu="1" b="0.70" c="3.0" />
<anti_clipping slow_down_distance=".5" />
</model_parameters>
<agent_parameters agent_parameter_id="0">
<v0 mu="1.34" sigma="0.0" />
<v0 mu="1.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" />
......
......@@ -131,10 +131,10 @@ if __name__ == "__main__":
floatflowsWidth = [float(el) for el in floatflowsWidth]
floatflowsWidth = np.array(floatflowsWidth)
M = np.array([np.mean(i) for i in flows.values()]) # std pro CPU
color = ['blue', 'red', 'green', 'cyan', 'magenta']
color = ['blue', 'red', 'green', 'cyan', 'magenta', 'black']
cnt = 0
clf()
for wad in WADs:
for wad in sorted(WADs):
flow_file = "flowWAD%s.txt"%wad
ff = open(flow_file, "w")
#flow_file = "flow.txt"
......@@ -159,38 +159,55 @@ if __name__ == "__main__":
ms = 8
#plot(widths, flows, "o-b", lw = 2, ms = ms, label = "simulation")
condition = floatflowsWAD == float(wad)
subpart = floatflowsWidth[condition]
subpart = floatflowsWidth[condition]
indexsort = np.argsort( subpart )
logging.debug(indexsort)
F = np.array(subpart)[indexsort]
plot(F, (np.array(M)[condition])[indexsort], "o-", lw=2, label='Mean WAD: %s'%wad, color=color[cnt])
plot(F, (np.array(M)[condition])[indexsort], "o-", lw=2, label='WAD: %s'%wad, color=color[cnt])
cnt = cnt + 1
if cnt == len(color):
cnt = 0
err += np.sqrt( sum(((M[condition])[indexsort]-lid_f)**2) )
#err += np.sqrt( sum(((M[condition])[indexsort]-lid_f)**2) )
#errorbar(F , np.array(M)[indexsort] , yerr=np.array(S)[indexsort], fmt='-o')
plot(lid_w , lid_f, "D-k", lw=2, ms = ms, label = "experiment")
#plot(lid_w , lid_f, "D-k", lw=2, ms = ms, label = "experiment")
edfiles = glob.glob("/home/arne/Desktop/experiments/*.txt")
for edfile in sorted(edfiles):
d = np.loadtxt(edfile)
mx = d[:,0]
my = d[:,1]
plot(mx, my, "o", lw=1, label=edfile.split(".")[0].split("/")[5], color=color[cnt])
cnt = cnt + 1
if cnt == len(color):
cnt = 0
#execfile ("/home/arne/master/bin/anaconda/bin/plotExperiment.py")
axes().set_aspect(1./axes().get_data_ratio())
legend(loc='best', numpoints=1)
grid()
xlabel(r'$w\; [\, \rm{m}\, ]$',fontsize=18)
ylabel(r'$J\; [\, \frac{1}{\rm{s}}\, ]$',fontsize=18)
#xticks([0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.3, 2.5])
xticks(widths)
xlim([1.1, 2.6])
#xticks([1.2, 1.4, 1.6, 2.0, 2.2, 2.5])
#xticks(widths)
xticks(range(4))
xlim([0, 4])
ylim([0, 6])
title(r"$\sqrt{{\sum_w {(\mu(w)-E(w)})^2 }}=%.2f\; (tol=%.2f)$"%(err, tolerance), y=1.02)
#title(r"$\sqrt{{\sum_w {(\mu(w)-E(w)})^2 }}=%.2f\; (tol=%.2f)$"%(err, tolerance), y=1.02)
savefig("flow.png")
savefig("sim_flow_vs_experimental_data.png")
show()
#########################################################################
time2 = time.clock()
logging.info("time elapsed %.2f [s]."%(time2-time1))
logging.info("err = %.2f, tol=%.2f"%(err, tolerance))
#logging.info("err = %.2f, tol=%.2f"%(err, tolerance))
if err > tolerance:
exit(FAILURE)
......
......@@ -45,9 +45,9 @@ xsi:noNamespaceSchemaLocation="http://134.94.2.137/jps_ini_core.xsd">
</routing>
<!--persons information and distribution -->
<agents operational_model_id="1">
<agents operational_model_id="3">
<agents_distribution>
<group group_id="2" agent_parameter_id="1" room_id="1" subroom_id="0" number="60" goal_id="0" router_id="1"/>
<group group_id="2" agent_parameter_id="0" room_id="1" subroom_id="0" number="60" goal_id="0" router_id="1"/>
<!-- <group group_id="0" room_id="0" subroom_id="2" number="4" goal_id="0" router_id="1" route_id="" /> -->
<!-- <group group_id="1" room_id="1" number="10" goal_id="0" router_id="1" route_id="" /> -->
</agents_distribution>
......@@ -77,6 +77,27 @@ xsi:noNamespaceSchemaLocation="http://134.94.2.137/jps_ini_core.xsd">
</agent_parameters>
</model>
<model operational_model_id="3" description="gradnav">
<model_parameters>
<solver>euler</solver>
<stepsize>0.01</stepsize>
<exit_crossing_strategy>6</exit_crossing_strategy>
<floorfield delta_h="0.0625" wall_avoid_distance="0.4" use_wall_avoidance="true" />
<linkedcells enabled="true" cell_size="4.2" />
<force_ped nu="3" b="1.0" c="3.0" />
<force_wall nu="1" b="0.70" c="3.0" />
<anti_clipping slow_down_distance=".5" />
</model_parameters>
<agent_parameters agent_parameter_id="0">
<v0 mu="1.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.23" sigma="0.001" />
</agent_parameters>
</model>
</operational_models>
<route_choice_models>
......
......@@ -55,7 +55,6 @@ FloorfieldViaFM::~FloorfieldViaFM()
FloorfieldViaFM::FloorfieldViaFM(const Building* const buildingArg, const double hxArg, const double hyArg,
const double slowdownDistance, const bool useDistancefield, const std::string& filename) {
//ctor
threshold = -1; //negative value means: ignore threshold
threshold = slowdownDistance;
......@@ -203,6 +202,7 @@ FloorfieldViaFM::FloorfieldViaFM(const std::string& filename) {
inputline >> dirToWall[i]._x >> dirToWall[i]._y >> fdummy; //0.989337 7.88255 0.0
inputline.clear();
}
file.close();
}
FloorfieldViaFM::FloorfieldViaFM(const FloorfieldViaFM& other)
......
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