Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pydtnsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
discus
pydtnsim
Commits
3c446d4e
Commit
3c446d4e
authored
7 years ago
by
Jarrod Pas
Browse files
Options
Downloads
Patches
Plain Diff
Fixes NCF in HCBF
parent
78a42df2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!3
Version 0.2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pydtn/communities/base.py
+1
-1
1 addition, 1 deletion
pydtn/communities/base.py
pydtn/routers/hcbf.py
+5
-3
5 additions, 3 deletions
pydtn/routers/hcbf.py
with
6 additions
and
4 deletions
pydtn/communities/base.py
+
1
−
1
View file @
3c446d4e
...
...
@@ -114,7 +114,7 @@ class EpochCommunity(TickProcess):
def
get_ncf
(
self
,
x
,
c_y
):
''''''
g
=
self
.
old_graph
if
x
not
in
c_y
or
x
not
in
g
:
if
x
not
in
g
or
x
in
c_y
:
return
0
return
sum
([
g
[
x
][
y
][
'
duration
'
]
...
...
This diff is collapsed.
Click to expand it.
pydtn/routers/hcbf.py
+
5
−
3
View file @
3c446d4e
...
...
@@ -49,7 +49,9 @@ def hcbf(self, packet, state):
return
False
# lp(max_lp) == lp(self)
elif
not_local_community
:
return
False
if
not_local_community
:
max_cbc
=
max
(
not_local_community
,
key
=
cbc
)
if
cbc
(
max_cbc
)
>
cbc
(
self
):
send
(
max_cbc
,
'
cbc
'
)
...
...
@@ -58,7 +60,8 @@ def hcbf(self, packet, state):
return
False
# cbc(max_cbc) == cbc(self)
max_ncf
=
max
(
not_local_community
,
key
=
ncf
)
if
local_community
:
max_ncf
=
max
(
local_community
,
key
=
ncf
)
if
ncf
(
max_ncf
)
>
ncf
(
self
):
send
(
max_ncf
,
'
ncf
'
)
return
True
...
...
@@ -66,7 +69,6 @@ def hcbf(self, packet, state):
return
False
# ncf(max_ncf) == ncf(self)
elif
local_community
:
max_ui
=
max
(
local_community
,
key
=
ui
)
if
ui
(
max_ui
)
>
ui
(
self
):
send
(
max_ui
,
'
ui_lonely
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment