Aufgrund von Umarbeiten des s3 Storage wird es in GitLab, in nächster Zeit, mögliche Performance-Einbußen geben. Näheres dazu unter: https://maintenance.itc.rwth-aachen.de/ticket/status/messages/43/show_ticket/6670

Commit fb8e1e96 authored by Armin Erraji's avatar Armin Erraji

Added RTree implementation (not working yet)

parent 2b2589e8
......@@ -26,7 +26,7 @@ namespace ITAPropagationPathSim
ITA_PROPAGATION_PATH_SIM_API bool ConstructImageEdges(shared_ptr<const ITAGeo::CEmitter> pEmitter, vector<CPropagationShapeShared>& vpPropagationTree);
ITA_PROPAGATION_PATH_SIM_API bool ConstructImageEdges(vector<CPropagationShapeShared>& vpPropagationTree);
}
}
}
......
......@@ -3,6 +3,8 @@
#include<ITAPropagationPathSim/CombinedModel/PropagationShapes.h>
#include <ITAPropagationPathSim/CombinedModel/RTree.h>
// ITA includes
#include <ITAGeo/Base.h>
#include <ITAGeo/Halfedge/MeshModel.h>
......@@ -36,8 +38,11 @@ namespace ITAPropagationPathSim
void ApplyEmitter(shared_ptr<CEmitter> pEmitter);
//Just for testing, the ApplyEmitter is divided into two parts
void ApplyEmitterForTestingOnlyTreeAndImageEdges(shared_ptr<CEmitter> pEmitter);
void ApplyEmitterForTestingOnlyImageSources();
void ApplySensor(shared_ptr<CSensor> pSensor);
void ConstructPropagationPathsWithStopWatch(CPropagationPathList& oPaths);
void ConstructPropagationPaths(CPropagationPathList& oPaths);
......@@ -47,6 +52,8 @@ namespace ITAPropagationPathSim
private:
vector<CPropagationShapeShared> m_vpPropagationShapes; //!< Vector of all propagation shapes
CShapesTree m_ShapesTree;
shared_ptr<const ITAGeo::Halfedge::CMeshModelList> m_pMeshModelList; //!< Copy of propagation model list
CShapesMap m_mvpShapeVisibilityMap; //!< Map of which shape can illuminate which ones
vector<CPropagationShapeShared> m_vpPropagationTree; //!< Vector of all propagation shapes (as well as its children) visible to the emitter
......
......@@ -39,9 +39,13 @@ namespace ITAPropagationPathSim
void Create(const vector<CPropagationShapeShared>& vpShapesIn);
//TODO
bool IsLineSegmentIntersected(const VistaVector3D& oLineStart, const VistaVector3D& oLineEnd) const;
bool CanLineSegmentIntersect(const VistaVector3D& oLineStart, const VistaVector3D& oLineEnd, const CPropagationShapeShared & oShape) const;
bool CanLineSegmentIntersect(const VistaVector3D& oLineStart, const VistaVector3D& oLineEnd) const;
bool RecursiveIntersectionTest(const VistaVector3D & oLineStart, const VistaVector3D & oLineEnd, const CShapesTree & oTree, const CPropagationShapeShared & oShape) const;
bool RecursiveIntersectionTest(const VistaVector3D & oLineStart, const VistaVector3D & oLineEnd, const CShapesTree & oTree) const;
bool ContainsShape(const CPropagationShapeShared & oShape) const;
//TODO
//void GetNonIntersectedFaces(vector<CPropagationShapeShared>& vpFacesOut, const VistaVector3D& oLineStart, const VistaVector3D& oLineStart);
......
......@@ -279,7 +279,7 @@ namespace ITAPropagationPathSim
return true;
}
bool ConstructImageEdges(shared_ptr<const ITAGeo::CEmitter> pEmitter, vector<CPropagationShapeShared>& vpPropagationTree)
bool ConstructImageEdges(vector<CPropagationShapeShared>& vpPropagationTree)
{
//First element of tree has never an image edge, so only construct them for its children
for (auto& pShape : vpPropagationTree)
......
......@@ -7,6 +7,7 @@
#include <ITAStopWatch.h> //TODO:Delete, just for testing
#include <ITAStringUtils.h>
//Typedefs
typedef OpenMesh::PolyMesh_ArrayKernelT<> CITAMesh;
struct CITAMeshPtr
......@@ -86,6 +87,8 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::InitializePathEnvironmen
//Get all propagation shapes of the mesh model list
ConstructPropagationShapes();
m_ShapesTree.Create(m_vpPropagationShapes);
//Create a visibility map
CreateVisibilityMap();
}
......@@ -102,16 +105,34 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::ApplyEmitter(shared_ptr<
ImageConstruction::ConstructImageSources(m_pEmitter, m_vpPropagationTree);
//Construct image edges
ImageConstruction::ConstructImageEdges(m_pEmitter, m_vpPropagationTree);
ImageConstruction::ConstructImageEdges(m_vpPropagationTree);
//Following not working accurately
//Calculate accumulated angle and angle culling for tree
//Calculate accumulated angle and angle culling for tree (without knowing the exactly position)
//if (*m_pAccumulatedAngleThreshold > 0)
//{
// Diffraction::AccumulatedAngleCulling(*m_pAccumulatedAngleThreshold, m_pEmitter,m_vpPropagationTree, m_vpPropagationTree);
//}
}
void ITAPropagationPathSim::CombinedModel::CPathEngine::ApplyEmitterForTestingOnlyTreeAndImageEdges(shared_ptr<ITAGeo::CEmitter> pEmitter)
{
//Set emitter
m_pEmitter = pEmitter;
//Create propagation tree
CreatePropagationTree();
//Construct image edges
ImageConstruction::ConstructImageEdges(m_vpPropagationTree);
}
void ITAPropagationPathSim::CombinedModel::CPathEngine::ApplyEmitterForTestingOnlyImageSources()
{
//Construct image sources
ImageConstruction::ConstructImageSources(m_pEmitter, m_vpPropagationTree);
}
size_t ITAPropagationPathSim::CombinedModel::CPathEngine::GetNumberPropagationPathCandidates()
{
if(m_vpPropagationCandidates.size() > 0)
......@@ -1028,6 +1049,10 @@ bool ITAPropagationPathSim::CombinedModel::CPathEngine::CanPointIlluminateEdge(c
bool ITAPropagationPathSim::CombinedModel::CPathEngine::IsPathVisible(const VistaVector3D& v3StartPoint, const VistaVector3D& v3EndPoint)
{
//Search of intersections on bounding boxes
if (!m_ShapesTree.CanLineSegmentIntersect(v3StartPoint, v3EndPoint)) return true;
//Search for intersections between two neighbored anchors and repeat it for all neighbored anchors of the path
//Iterate intersection search over all mesh models
......
......@@ -41,9 +41,9 @@ void CShapesTree::CreateBranches()
vvpBranchShapes.resize(8);
//Points, where branches are sub-divided into. Mid points between max and min.
float fSubDivideX = m_v3TreeMin[Vista::X] + m_v3TreeMax[Vista::X] / 2.0f;
float fSubDivideY = m_v3TreeMin[Vista::Y] + m_v3TreeMax[Vista::Y] / 2.0f;
float fSubDivideZ = m_v3TreeMin[Vista::Z] + m_v3TreeMax[Vista::Z] / 2.0f;
float fSubDivideX = (m_v3TreeMin[0] + m_v3TreeMax[0]) / 2.0f;
float fSubDivideY = (m_v3TreeMin[1] + m_v3TreeMax[1]) / 2.0f;
float fSubDivideZ = (m_v3TreeMin[2] + m_v3TreeMax[2]) / 2.0f;
//Add building to branchbuildings vector according to its location
for (auto &pShape : m_vpShapes)
......@@ -103,17 +103,18 @@ void CShapesTree::CreateBranches()
}
}
//For each subdivided building vector, create a branch
//For each subdivided building vector, create a branch. Create no further branch, if only one vvpBranchShapes vector exists
if(vvpBranchShapes.size() > 1)
for (auto &vpShapesCurrentBranch : vvpBranchShapes)
{
if (vpShapesCurrentBranch.size() > 0)
{
auto pBranch = make_shared< CShapesTree>();
pBranch->Create(vpShapesCurrentBranch);
m_vpBranches.push_back(pBranch);
if (vpShapesCurrentBranch.size() > 0)
{
auto pBranch = make_shared< CShapesTree>();
pBranch->Create(vpShapesCurrentBranch);
m_vpBranches.push_back(pBranch);
}
}
}
}
void CShapesTree::SetVertices()
......@@ -140,23 +141,137 @@ void CShapesTree::SetVertices()
// ---Test function----------------------------------------------------------------------------------------------
bool CShapesTree::IsLineSegmentIntersected(const VistaVector3D & oLineStart, const VistaVector3D & oLineEnd) const
bool CShapesTree::CanLineSegmentIntersect(const VistaVector3D & oLineStart, const VistaVector3D & oLineEnd, const CPropagationShapeShared & pShape) const
{
//Compute intersection test with bounding box. if if intersectes, further test lower branches for intersections
return RecursiveIntersectionTest(oLineStart, oLineEnd, *this, pShape);
}
bool CShapesTree::CanLineSegmentIntersect(const VistaVector3D & oLineStart, const VistaVector3D & oLineEnd) const
{
//Compute intersection test with bounding box. if if intersectes, further test lower branches for intersections
return RecursiveIntersectionTest(oLineStart, oLineEnd, *this);
}
//if (oLineStart.x < m_v3TreeMin.x && oLineEnd.x < m_v3TreeMin.x) return false;
//if (oLineStart.x > m_v3TreeMax.x && oLineEnd.x > m_v3TreeMax.x) return false;
//if (oLineStart.y < m_v3TreeMin.y && m_v3TreeMin.y < B1.y) return false;
//if (oLineStart.y > m_v3TreeMax.y && oLineEnd.y > m_v3TreeMax.y) return false;
//if (oLineStart.z < m_v3TreeMin.z && oLineEnd.z < m_v3TreeMin.z) return false;
//if (oLineStart.z > m_v3TreeMax.z && oLineEnd.z > m_v3TreeMax.z) return false;
bool CShapesTree::RecursiveIntersectionTest(const VistaVector3D & oLineStart, const VistaVector3D & oLineEnd, const CShapesTree& oTree, const CPropagationShapeShared & pShape) const
{
if (!oTree.ContainsShape(pShape))
return false;
VistaVector3D v3Origin = oLineStart;
VistaVector3D v3Dir = (oLineEnd - oLineStart).GetNormalized();
//Iersection test with the bounding box. Only if line intersects the box, test its branch
//https://www.scratchapixel.com/lessons/3d-basic-rendering/minimal-ray-tracer-rendering-simple-shapes/ray-box-intersection
float tmin = (oTree.m_v3TreeMin[0] - v3Origin[0]) / v3Dir[0];
float tmax = (oTree.m_v3TreeMax[0] - v3Origin[0]) / v3Dir[0];
if (tmin > tmax) swap(tmin, tmax);
float tymin = (oTree.m_v3TreeMin[1] - v3Origin[1]) / v3Dir[1];
float tymax = (oTree.m_v3TreeMax[1] - v3Origin[1]) / v3Dir[1];
if (tymin > tymax) swap(tymin, tymax);
if ((tmin > tymax) || (tymin > tmax))
return false;
if (tymin > tmin)
tmin = tymin;
if (tymax < tmax)
tmax = tymax;
float tzmin = (oTree.m_v3TreeMin[2] - v3Origin[2]) / v3Dir[2];
float tzmax = (oTree.m_v3TreeMax[2] - v3Origin[2]) / v3Dir[2];
if (tzmin > tzmax) swap(tzmin, tzmax);
if ((tmin > tzmax) || (tzmin > tmax))
return false;
if (tzmin > tmin)
tmin = tzmin;
if (tzmax < tmax)
tmax = tzmax;
//Intersection test with children
bool bIntersectsChild = false;
for (auto& pChild : oTree.m_vpBranches)
{
bIntersectsChild |= RecursiveIntersectionTest(oLineStart, oLineEnd, *pChild,pShape);
}
return bIntersectsChild;
}
bool CShapesTree::RecursiveIntersectionTest(const VistaVector3D & oLineStart, const VistaVector3D & oLineEnd, const CShapesTree& oTree) const
{
VistaVector3D v3Origin = oLineStart;
VistaVector3D v3Dir = (oLineEnd - oLineStart).GetNormalized();
//Iersection test with the bounding box. Only if line intersects the box, test its branch
//https://www.scratchapixel.com/lessons/3d-basic-rendering/minimal-ray-tracer-rendering-simple-shapes/ray-box-intersection
float tmin = (oTree.m_v3TreeMin[0] - v3Origin[0]) / v3Dir[0];
float tmax = (oTree.m_v3TreeMax[0] - v3Origin[0]) / v3Dir[0];
if (tmin > tmax) swap(tmin, tmax);
float tymin = (oTree.m_v3TreeMin[1] - v3Origin[1]) / v3Dir[1];
float tymax = (oTree.m_v3TreeMax[1] - v3Origin[1]) / v3Dir[1];
if (tymin > tymax) swap(tymin, tymax);
if ((tmin > tymax) || (tymin > tmax))
return false;
if (tymin > tmin)
tmin = tymin;
if (tymax < tmax)
tmax = tymax;
float tzmin = (oTree.m_v3TreeMin[2] - v3Origin[2]) / v3Dir[2];
float tzmax = (oTree.m_v3TreeMax[2] - v3Origin[2]) / v3Dir[2];
if (tzmin > tzmax) swap(tzmin, tzmax);
if ((tmin > tzmax) || (tzmin > tmax))
return false;
if (tzmin > tmin)
tmin = tzmin;
if (tzmax < tmax)
tmax = tzmax;
//Intersection test with children
bool bIntersectsChild = false;
for (auto& pChild : oTree.m_vpBranches)
{
bIntersectsChild |= RecursiveIntersectionTest(oLineStart, oLineEnd, *pChild);
}
return bIntersectsChild;
return false;
}
bool ITAPropagationPathSim::CombinedModel::CShapesTree::ContainsShape(const CPropagationShapeShared& pShapeIn) const
{
for (auto& pTreeShape : m_vpShapes)
{
if (pTreeShape->GetIdentifier() == pShapeIn->GetIdentifier())
return true;
}
return false;
}
......@@ -34,6 +34,10 @@ using namespace std;
using namespace ITAGeo;
using namespace ITAPropagationPathSim;
#if 1 //#ifdef WITH_JSON_SUPPORT
#include <libjson.h>
#endif
int main(int iNumInArgs, char* pcInArgs[])
{
string sSubFolder = "M:/Sciebo/2018 MA - Armin Erraji/Tests/StreetThreeBuildings/";
......@@ -71,109 +75,183 @@ int main(int iNumInArgs, char* pcInArgs[])
return 255;
}
auto pEmitter = make_shared< CEmitter >(VistaVector3D(-1.0f,20.f, 1.0f)); //S_1 Car_1
//auto pEmitter = make_shared< CEmitter >(VistaVector3D(-1.0f, 0.0f, 1.0f)); //S_2 Car_2
//auto pEmitter = make_shared< CEmitter >(VistaVector3D(-1.0f, -20.f, 1.0f)); //S_3 Car_3
//auto pSensor = make_shared< CSensor >(VistaVector3D(50.0f, 5.0f, 1.7f)); //R_1 Human_street far
auto pSensor = make_shared< CSensor >(VistaVector3D(10.0f, 5.0f, 1.7f)); //R_3 Human_street near
//auto pSensor = make_shared< CSensor >(VistaVector3D(-30.0f, 0.0f, 1.7f)); //R_2 Human_Backyard
//auto pEmitter = make_shared< CEmitter >(VistaVector3D(-30.0f, 0.0f, 1.7f)); //S_4 Human_Backyard
/*auto pEmitter = make_shared< CEmitter >(VistaVector3D(50.0f, -5.0f, 1.7f));
auto pSensor = make_shared< CSensor >( VistaVector3D( 0.0f, 0.0f, 1.7f ) );
*/
//auto pSensor = make_shared< CSensor >(VistaVector3D(3.0f, 0, 1.4f));
//auto pEmitter = make_shared< CEmitter >(VistaVector3D(-3.0f, 0, 1.4f));
cout << "Emitter: " << pEmitter->vPos << endl;
cout << "Sensor: " << pSensor->vPos << endl;
//Configuration of the engine
const bool bOnlyNeighbouredEdgeDiffraction = false;
const bool bDiffractionOnlyIntoShadowRegion = true;
const bool bDiffractionOnlyIntoShadowedEdges = false;//
const bool bFilterNotVisiblePathsBetweenEdges = false; //Intersection test between edges(expensive)
const bool bFilterNotVisiblePointToEdge = true; //Intersection test between emitter/sensor and edges
const bool bFilterNotVisiblePaths = true; //Intersection test of calculated sub paths
const float fIntersectionTestResolution = 0.001;
const int iNumIterations = 4;//!< Number of iterations for the calculation of the aperture points
const int fMaxAccumulatedDiffractionAngle = ITAConstants::PI_F;
const int fMaxAccumulatedDiffractionAngle = -ITAConstants::PI_F;
const float fLevelDropThreshhold = 90.f - 30.f - 11.f; //90 dB Power level car; 30 dB masking; 11 dB initial power level drop
const float fLevelDropThreshhold = -90.f - 30.f - 11.f; //90 dB Power level of Diesel; 30 dB masking; 11 dB initial power level drop
const float fReflectionPenalty = -10 * log10f(0.8); //Level reduction of a reflection with reflection factor rho = 0.8 from ISO9613-2
const float fDiffractionPenalty = 2.5f; // Minimum level reduction of a diffracted signal into the shadow region for a low frequency (Taken from BA Filbert Figure 16. UTD)
//Multiple simulations
#if 0
for (int iDiffraction = 0; iDiffraction <= 3; iDiffraction++)
#if 1
shared_ptr<CEmitter> pSource;
shared_ptr<CSensor> pReceiver;
JSONNode jnRoot(JSON_NODE);
for (int iSource = 1; iSource <= 1; iSource++)
{
for (int iReflection = 0; iReflection <= 2; iReflection++)
switch (iSource)
{
case 1:
pSource = make_shared< CEmitter >(VistaVector3D(-1.0f, 20.f, 1.0f)); //S_1 Car_1
break;
case 2:
pSource = make_shared< CEmitter >(VistaVector3D(-1.0f, 0.0f, 1.0f)); //S_2 Car_2
break;
case 3:
pSource = make_shared< CEmitter >(VistaVector3D(-1.0f, -20.f, 1.0f)); //S_3 Car_3
break;
case 4:
pSource = make_shared< CEmitter >(VistaVector3D(-30.0f, 0.0f, 1.7f)); //S_4 Human_Backyard
break;
}
for (int iReceiver = 2; iReceiver <= 3; iReceiver++)
{
switch (iReceiver)
{
case 1:
pReceiver = make_shared< CSensor >(VistaVector3D(50.0f, 5.0f, 1.7f)); //R_1 Human_street far
break;
case 2:
pReceiver = make_shared< CSensor >(VistaVector3D(-30.0f, 0.0f, 1.7f)); //R_2 Human_Backyard
break;
case 3:
pReceiver = make_shared< CSensor >(VistaVector3D(10.0f, 5.0f, 1.7f)); //R_3 Human_street middle
break;
case 4:
pReceiver = make_shared< CSensor >(VistaVector3D(5.0f, 5.0f, 1.7f)); //R_4 Human_street near
break;
}
for (int iOrder = 0; iOrder <= 4; iOrder++)
{
cout << endl << "Source: " << iSource << "; Receiver: " << iReceiver << "; Order: " << iOrder << endl;
//Variables for processing times
double d1, d2, d3, d4;
cout << endl << "Diffraction order: " << iDiffraction << "; Reflection order: " << iReflection << endl;
const int iMaxDiffractionOrder = iDiffraction;
const int iMaxReflectionOrder = iReflection;
const int iMaxCombinedOrder = iMaxDiffractionOrder + iMaxReflectionOrder;
const int iMaxDiffractionOrder = iOrder;
const int iMaxReflectionOrder = iOrder;
const int iMaxCombinedOrder = iOrder;
ITAStopWatch sw; sw.start();
ITAStopWatch sw; sw.start();
auto pPathEngine = make_shared<CombinedModel::CPathEngine>();
cout << "Calculation time initialization path engine: " << timeToString(sw.stop()) << endl;
auto pPathEngine = make_shared<CombinedModel::CPathEngine>();
cout << "Calculation time initialization path engine: " << timeToString(sw.stop()) << endl;
sw.start();
sw.start();
pPathEngine->Configure(bOnlyNeighbouredEdgeDiffraction, bDiffractionOnlyIntoShadowRegion, bFilterNotVisiblePathsBetweenEdges, bFilterNotVisiblePointToEdge, bFilterNotVisiblePointToEdge, bFilterNotVisiblePaths, iNumIterations, fIntersectionTestResolution);
pPathEngine->SetAbortionCriteria(iMaxDiffractionOrder, iMaxReflectionOrder, iMaxCombinedOrder, fLevelDropThreshhold, fReflectionPenalty, fDiffractionPenalty, fMaxAccumulatedDiffractionAngle);
cout << "Calculation time configuring filter: " << timeToString(sw.stop()) << endl;
pPathEngine->Configure(bOnlyNeighbouredEdgeDiffraction, bDiffractionOnlyIntoShadowedEdges, bFilterNotVisiblePathsBetweenEdges, bFilterNotVisiblePointToEdge, bFilterNotVisiblePointToEdge, bFilterNotVisiblePaths, iNumIterations, fIntersectionTestResolution);
pPathEngine->SetAbortionCriteria(iMaxDiffractionOrder, iMaxReflectionOrder, iMaxCombinedOrder, fLevelDropThreshhold, fReflectionPenalty, fDiffractionPenalty, fMaxAccumulatedDiffractionAngle);
cout << "Calculation time configuring filter: " << timeToString(sw.stop()) << endl;
sw.start();
sw.start();
pPathEngine->InitializePathEnvironment(pMeshModelList);
cout << "Calculation time initialization path environment: " << timeToString(sw.stop()) << endl;
pPathEngine->InitializePathEnvironment(pMeshModelList);
pPathEngine->ApplyEmitterForTestingOnlyTreeAndImageEdges(pSource); //Builds tree and image edges
d1 = sw.stop();
cout << "Calculation time pre-processing of path environment: " << timeToString(d1) << endl;
sw.start();
size_t numNodes = pPathEngine->GetNumberPropagationPathCandidates();
pPathEngine->ApplyEmitter(pEmitter);
cout << "Calculation time applying emitter: " << timeToString(sw.stop()) << endl;
sw.start();
sw.start();
pPathEngine->ApplyEmitterForTestingOnlyImageSources();
d2 = sw.stop();
cout << "Calculation time applying emitter: " << timeToString(d2) << endl;
pPathEngine->ApplySensor(pSensor);
cout << "Calculation time applying sensor: " << timeToString(sw.stop()) << endl;
sw.start();
CPropagationPathList oPathListAll;
pPathEngine->ApplySensor(pReceiver);
d3 = sw.stop();
cout << "Calculation time applying sensor: " << timeToString(d3) << endl;
sw.start();
CPropagationPathList oPathListAll;
pPathEngine->ConstructPropagationPaths(oPathListAll);
//pPathEngine->ConstructPropagationPathsWithStopWatch(oPathListAll);
cout << "Calculation time propagation path creation: " << timeToString(sw.stop()) << endl;
sw.start();
cout << "Visible paths: " << to_string(oPathListAll.size()) << endl;
pPathEngine->ConstructPropagationPaths(oPathListAll);
//pPathEngine->ConstructPropagationPathsWithStopWatch(oPathListAll);
d4 = sw.stop();
cout << "Calculation time propagation path creation: " << timeToString(d4) << endl;
size_t numPaths = oPathListAll.size();
cout << "Nodes: " << to_string(numNodes) << endl;
cout << "Visible paths: " << to_string(numPaths) << endl;
//Add emitter and sensor to visualization
oGeoModel.AddEmitterVisualization(*pEmitter, "Emitter A");
oGeoModel.AddSensorVisualization(*pSensor, "Sensor A");
cout << "The path with the longest length is " << oPathListAll.GetMaxLength() << " m." << endl;
//Add emitter and sensor to visualization
//oGeoModel.AddEmitterVisualization(*pSource, "Emitter A");
//oGeoModel.AddSensorVisualization(*pSensor, "Sensor A");
JSONNode jnBranch(JSON_NODE);
//Set class type node
JSONNode jnSource("source", iSource);
JSONNode jnReceiver("receiver", iReceiver);
JSONNode jnOrder("order", iOrder);
JSONNode jnNumNodes("numNodes", numNodes);
JSONNode jnNumPaths("numPaths", numPaths);
//Set processing times array
JSONNode jnTimesArray(JSON_ARRAY);
jnTimesArray.set_name("ProcessingTimes");
JSONNode jnPreTime("preproc", d1);
JSONNode jnSourceTime("source", d2);
JSONNode jnReceiverTime("emitter", d3);
JSONNode jnPathsTime("pathsFinding", d4);
//Add times to array
jnTimesArray.push_back(jnPreTime);
jnTimesArray.push_back(jnSourceTime);
jnTimesArray.push_back(jnReceiverTime);
jnTimesArray.push_back(jnPathsTime);
//Push back all nodes to parent node
jnBranch.push_back(jnSource);
jnBranch.push_back(jnReceiver);
jnBranch.push_back(jnOrder);
jnBranch.push_back(jnNumNodes);
jnBranch.push_back(jnNumPaths);
jnBranch.push_back(jnTimesArray);
std::string ss;
ss = jnBranch.write_formatted();
std::ofstream out(sSubFolder + "S" + IntToString(iSource) + "R" + IntToString(iReceiver) + "O" + IntToString(iOrder) + ".json");
out << ss.c_str();
out.close();
}
}
}
return 0;
#endif
//Single simulation
#if 1
#if 0
const int iMaxDiffractionOrder = 4;
const int iMaxReflectionOrder = 4;
const int iMaxCombinedOrder = 4; //iMaxDiffractionOrder + iMaxReflectionOrder;
const int iMaxCombinedOrder = 1; //iMaxDiffractionOrder + iMaxReflectionOrder;
ITAStopWatch sw; sw.start();
......@@ -204,6 +282,7 @@ int main(int iNumInArgs, char* pcInArgs[])
cout << "Calculation time applying sensor: " << timeToString(sw.stop()) << endl;
CPropagationPathList oPathList;
cout << "Calculation time applying sensor: " << timeToString(sw.stop()) << endl;
sw.start();
......@@ -248,3 +327,4 @@ int main(int iNumInArgs, char* pcInArgs[])
#endif
}
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