Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
re6stnet
Commits
5f163f16
Commit
5f163f16
authored
Aug 02, 2012
by
Ulysse Beaugnon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added distance plots
parent
8bc989a6
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
16 deletions
+28
-16
simulation/realistic_dataset/data/refresh1/distance.png
simulation/realistic_dataset/data/refresh1/distance.png
+0
-0
simulation/realistic_dataset/data/refresh1/distancelog.png
simulation/realistic_dataset/data/refresh1/distancelog.png
+0
-0
simulation/realistic_dataset/graph.cpp
simulation/realistic_dataset/graph.cpp
+20
-8
simulation/realistic_dataset/main.cpp
simulation/realistic_dataset/main.cpp
+7
-8
simulation/realistic_dataset/main.h
simulation/realistic_dataset/main.h
+1
-0
No files found.
simulation/realistic_dataset/data/refresh1/distance.png
0 → 100644
View file @
5f163f16
43.7 KB
simulation/realistic_dataset/data/refresh1/distancelog.png
0 → 100644
View file @
5f163f16
48.7 KB
simulation/realistic_dataset/graph.cpp
View file @
5f163f16
...
@@ -172,17 +172,14 @@ int Graph::UpdateLowRoutes(double& avgDistance, double unreachable, double* arit
...
@@ -172,17 +172,14 @@ int Graph::UpdateLowRoutes(double& avgDistance, double unreachable, double* arit
for
(
int
i
=
0
;
i
<
size
;
i
++
)
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
{
routesResult
r
=
results
[
i
];
routesResult
r
=
results
[
i
];
if
((
adjacency
[
i
].
size
()
>
16
&&
adjacency
[
i
].
size
()
<
26
)
||
round
%
4
==
0
)
{
nUpdated
++
;
while
(
!
r
.
toDelete
.
empty
())
while
(
!
r
.
toDelete
.
empty
())
{
{
RemoveEdge
(
i
,
r
.
toDelete
.
top
());
RemoveEdge
(
i
,
r
.
toDelete
.
top
());
r
.
toDelete
.
pop
();
r
.
toDelete
.
pop
();
}
}
}
SaturateNode
(
i
);
SaturateNode
(
i
);
nUpdated
++
;
avgDistance
+=
r
.
avgDistance
*
(
size
-
r
.
unreachable
);
avgDistance
+=
r
.
avgDistance
*
(
size
-
r
.
unreachable
);
avgDistanceWeight
+=
size
-
r
.
unreachable
;
avgDistanceWeight
+=
size
-
r
.
unreachable
;
...
@@ -258,3 +255,18 @@ void Graph::KillMachines(float proportion)
...
@@ -258,3 +255,18 @@ void Graph::KillMachines(float proportion)
}
}
}
}
}
}
void
Graph
::
Reboot
(
double
proba
)
{
uniform_real_distribution
<
double
>
d
(
0.0
,
1.0
);
for
(
int
i
=
0
;
i
<
size
;
i
++
)
if
(
d
(
generator
)
<=
proba
)
{
for
(
int
j
:
generated
[
i
])
RemoveEdge
(
i
,
j
);
for
(
int
j
:
adjacency
[
i
])
RemoveEdge
(
j
,
i
);
SaturateNode
(
i
);
}
}
\ No newline at end of file
simulation/realistic_dataset/main.cpp
View file @
5f163f16
...
@@ -16,12 +16,10 @@ void simulate(int size, int k, int maxPeer, int seed, const Latency& latency, co
...
@@ -16,12 +16,10 @@ void simulate(int size, int k, int maxPeer, int seed, const Latency& latency, co
Graph
graph
(
size
,
k
,
maxPeer
,
rng
,
latency
);
Graph
graph
(
size
,
k
,
maxPeer
,
rng
,
latency
);
cout
<<
"
\r
"
<<
0
<<
"/"
<<
300
;
cout
<<
"
\r
"
<<
0
<<
"/"
<<
300
0
;
cout
.
flush
();
cout
.
flush
();
long
long
int
nUpdates
=
0
;
for
(
int
i
=
0
;
i
<
3000
;
i
++
)
for
(
int
i
=
0
;
i
<
300
;
i
++
)
{
{
/*for(float a=0.05; a<1; a+=0.05)
/*for(float a=0.05; a<1; a+=0.05)
{
{
...
@@ -35,9 +33,10 @@ void simulate(int size, int k, int maxPeer, int seed, const Latency& latency, co
...
@@ -35,9 +33,10 @@ void simulate(int size, int k, int maxPeer, int seed, const Latency& latency, co
double
avgDistance
,
unreachable
;
double
avgDistance
,
unreachable
;
double
arityDistrib
[
31
],
bcArity
[
31
];
double
arityDistrib
[
31
],
bcArity
[
31
];
nUpdates
+=
graph
.
UpdateLowRoutes
(
avgDistance
,
unreachable
,
arityDistrib
,
bcArity
,
1
,
i
);
graph
.
Reboot
(
1.0
/
(
1036.8
+
1.0
));
graph
.
UpdateLowRoutes
(
avgDistance
,
unreachable
,
arityDistrib
,
bcArity
,
1
,
i
);
fprintf
(
output
,
"%d,%f
, %lld"
,
i
,
avgDistance
,
nUpdates
);
fprintf
(
output
,
"%d,%f
"
,
i
,
avgDistance
);
for
(
int
j
=
0
;
j
<=
30
;
j
++
)
for
(
int
j
=
0
;
j
<=
30
;
j
++
)
fprintf
(
output
,
",%f"
,
arityDistrib
[
j
]);
fprintf
(
output
,
",%f"
,
arityDistrib
[
j
]);
for
(
int
j
=
0
;
j
<=
30
;
j
++
)
for
(
int
j
=
0
;
j
<=
30
;
j
++
)
...
@@ -46,7 +45,7 @@ void simulate(int size, int k, int maxPeer, int seed, const Latency& latency, co
...
@@ -46,7 +45,7 @@ void simulate(int size, int k, int maxPeer, int seed, const Latency& latency, co
fflush
(
output
);
fflush
(
output
);
fsync
(
fno
);
fsync
(
fno
);
cout
<<
"
\r
"
<<
i
+
1
<<
"/"
<<
300
;
cout
<<
"
\r
"
<<
i
+
1
<<
"/"
<<
300
0
;
cout
.
flush
();
cout
.
flush
();
}
}
...
...
simulation/realistic_dataset/main.h
View file @
5f163f16
...
@@ -34,6 +34,7 @@ public:
...
@@ -34,6 +34,7 @@ public:
~
Graph
()
{
delete
[]
adjacency
;
delete
[]
generated
;
};
~
Graph
()
{
delete
[]
adjacency
;
delete
[]
generated
;
};
int
UpdateLowRoutes
(
double
&
avgDistance
,
double
unreachable
,
double
*
arityDistrib
,
double
*
bcArity
,
int
nRefresh
,
int
round
);
int
UpdateLowRoutes
(
double
&
avgDistance
,
double
unreachable
,
double
*
arityDistrib
,
double
*
bcArity
,
int
nRefresh
,
int
round
);
double
GetUnAvalaibility
();
double
GetUnAvalaibility
();
void
Reboot
(
double
proba
);
void
KillMachines
(
float
proportion
);
void
KillMachines
(
float
proportion
);
private:
private:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment