Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
algorand
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nilak
algorand
Commits
a57fdb04
Commit
a57fdb04
authored
May 01, 2019
by
THAKARE AKSHAY HARIBHAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaning and o=improving
parent
1157e817
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
4 deletions
+3
-4
Network.py
Network.py
+2
-2
OverlayNode.py
OverlayNode.py
+1
-1
filegen.py
filegen.py
+0
-1
No files found.
Network.py
View file @
a57fdb04
...
...
@@ -34,7 +34,7 @@ class Network():
w
=
randint
(
1
,
51
,
4
)
# 51 is excluded - range (1,50)
self
.
badaW
=
np
.
sum
(
w
)
i
=
0
with
open
(
'Nodes.dat'
,
'r'
)
as
f
:
with
open
(
'Nodes
1
.dat'
,
'r'
)
as
f
:
reader
=
csv
.
reader
(
f
)
for
row
in
reader
:
node
=
row
[
0
]
# Node id
...
...
@@ -44,7 +44,7 @@ class Network():
# print(self.nodes.get('1')) #keys are strings
with
open
(
'Links.dat'
,
'r'
)
as
f
:
with
open
(
'Links
1
.dat'
,
'r'
)
as
f
:
reader
=
csv
.
reader
(
f
)
for
row
in
reader
:
tup
=
row
[
0
]
.
split
()
...
...
OverlayNode.py
View file @
a57fdb04
...
...
@@ -59,6 +59,7 @@ class OverlayNode(Node):
# Todo something is wrong here not getting correct votes back
votes
=
Utility
.
verifySort
(
pk
,
sorthash
,
proof
,
seed
,
tou
,
role
,
self
.
network
.
pk_weight_map
.
get
(
pk
),
self
.
network
.
badaW
)
print
(
"why votes be zero"
)
print
(
votes
,
"
\t
"
,
value
,
"
\t
"
,
sorthash
)
return
votes
,
value
,
sorthash
pass
...
...
@@ -73,7 +74,6 @@ class OverlayNode(Node):
# print(round, " # ",step )
if
msg_round
==
round
and
msg_step
==
step
:
#check if message belong to current round and current step or not
votes
,
value
,
sorthash
=
self
.
algo_processMsg
(
msg
,
tou
)
print
(
"votes : "
,
votes
)
if
msg_pk
in
voters
or
votes
==
0
:
print
(
self
.
id
+
" continuing"
)
continue
...
...
filegen.py
View file @
a57fdb04
...
...
@@ -2,7 +2,6 @@ import hashlib
from
numpy.random
import
randint
import
sys
import
networkx
as
nx
import
matplotlib.pyplot
as
plt
from
networkx.algorithms
import
community
f
=
open
(
"Nodes1.dat"
,
"w"
)
...
...
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