-
Notifications
You must be signed in to change notification settings - Fork 0
/
main-conorshouse.cpp
86 lines (73 loc) · 2.85 KB
/
main-conorshouse.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//=========================================================================
// COPYRIGHT (c) 2017 by Trinity College Dublin, Dublin 2, IRELAND
// All rights reserved
//=========================================================================
// Author: Eamonn M. Kenny
// First Modification: March 2017
// Last Modification: 10th March 2017
// Previous Projects: ADAPT
// Current Project: IP2000 STIWRO
// Software Tool Version: 1.0
//=========================================================================
#include <iostream>
#include "raytracing.hh"
#include "building.hh"
#include "convex.hh"
#include "matlab.hh"
#include "reloader.hh"
int main()
{
CRayTracing rayTracingObject;
CMatlab matlabObject;
CPoint3d *receiverPointArray;
CBaseTransceiver btsObject;
string buildingFileName, buildingRooms, btsFileName;
double xStep, yStep, zStep, receiverHeight;
int M, N, i, j, k, l, scalingFactor, numberOfLevels;
CPoint3d startPoint;
CPathLoss pathLossObject;
CMemoryStorage storageObject;
CReloadBuilding reloader;
CProperties directoryPathObject;
directoryPathObject.read( "../directory.xml" );
btsObject.read( "bts915.dat" );
btsObject.setRandomWalk( false );
//btsObject.setNumberOfReflections( numReflections );
//btsObject.setNumberOfTransmissions( numTransmissions );
// conor's house with door item 13 open. 13 convex spaces in total
reloader = CReloadBuilding( "conorhouse" );
// conor's house with 21 doors open
matlabObject.Story( 0, reloader.building_, "story1-" + btsObject.name() + ".txt" );
matlabObject.Floor( 0, reloader.building_, "floor1-" + btsObject.name() + ".txt" );
scalingFactor = 10;
receiverHeight = 1.39;
M = 6.8 * scalingFactor;
N = 8.0 * scalingFactor;
xStep = 1.0 / double(scalingFactor);
yStep = 1.0 / double(scalingFactor);
zStep = 0.0;
startPoint = CPoint3d( -3.4, -4.0, -1.0+receiverHeight );
receiverPointArray = storageObject.CreatePoint3dVector( M * N );
pathLossObject = CPathLoss( startPoint.x, startPoint.y, xStep, yStep, M, N );
numberOfLevels = 1;
for ( l = 0; l < numberOfLevels; l++ )
{
k = 0;
for ( j = 0; j < N; j++ )
{
for ( i = 0; i < M; i++ )
{
receiverPointArray[k] = CPoint3d(startPoint.x + i * xStep,
startPoint.y + j * yStep,
startPoint.z + l * zStep );
k++;
}
}
rayTracingObject = CRayTracing( reloader.building_, btsObject,
pathLossObject, receiverPointArray, LOSSY );
}
cout << "Ray trace performed between Tx: " << btsObject.position()
<< " and start Rx: " << receiverPointArray[0] << endl;
storageObject.DeletePoint3dVector( receiverPointArray );
return 0;
}