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
4e1a5b90
Commit
4e1a5b90
authored
7 years ago
by
Jarrod Pas
Browse files
Options
Downloads
Patches
Plain Diff
Fixes buffer capacity not being set
parent
bcf422a9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!3
Version 0.2
,
!1
Full rewrite
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pydtn/__init__.py
+6
-3
6 additions, 3 deletions
pydtn/__init__.py
with
6 additions
and
3 deletions
pydtn/__init__.py
+
6
−
3
View file @
4e1a5b90
...
...
@@ -227,7 +227,7 @@ class Packet:
class
Buffer
:
"""
A place for a node to hold packets.
"""
def
__init__
(
self
,
**
options
):
def
__init__
(
self
,
capacity
=
None
,
**
options
):
"""
Create a buffer.
...
...
@@ -237,7 +237,10 @@ class Buffer:
Keyword arguments:
capacity -- the maximum number of packets to hold (default infinity).
"""
self
.
capacity
=
options
.
get
(
'
capacity
'
,
float
(
'
inf
'
))
if
capacity
is
None
:
self
.
capacity
=
float
(
'
inf
'
)
else
:
self
.
capacity
=
capacity
self
.
store
=
OrderedDict
()
@property
...
...
@@ -280,7 +283,7 @@ class Node:
"""
Create a node.
"""
self
.
network
=
None
self
.
buffer
=
Buffer
()
self
.
buffer
=
Buffer
(
capacity
=
options
.
get
(
'
buffer_capacity
'
,
None
)
)
self
.
_neighbours
=
set
()
self
.
options
=
ChainMap
(
options
,
{
...
...
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