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
d641b22d
Commit
d641b22d
authored
7 years ago
by
Jarrod Pas
Browse files
Options
Downloads
Patches
Plain Diff
Fixes tiny code style things
parent
4344252c
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
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/random_node.py
+4
-1
4 additions, 1 deletion
examples/random_node.py
pydtn/__init__.py
+1
-2
1 addition, 2 deletions
pydtn/__init__.py
with
5 additions
and
3 deletions
examples/random_node.py
+
4
−
1
View file @
d641b22d
...
...
@@ -2,6 +2,7 @@ from random import Random
from
pydtn
import
Network
,
Node
,
random_trace
,
random_traffic
class
RandomNode
(
Node
):
def
__init__
(
self
,
seed
=
None
,
**
options
):
super
().
__init__
(
**
options
)
...
...
@@ -14,9 +15,10 @@ class RandomNode(Node):
return
{
target
:
'
random
'
}
return
{}
def
main
():
nodes
=
50
seed
=
42
seed
=
42
traffic_speed
=
1
node_options
=
{
...
...
@@ -38,5 +40,6 @@ def main():
print
(
network
.
stats_summary
)
if
__name__
==
'
__main__
'
:
exit
(
main
())
This diff is collapsed.
Click to expand it.
pydtn/__init__.py
+
1
−
2
View file @
d641b22d
...
...
@@ -116,7 +116,6 @@ class Network:
@property
def
stats
(
self
):
"""
Return detailed statistics for the simulation.
"""
packets
=
[
packet
.
stats
for
packet
in
self
.
packets
]
nodes
=
[
node
.
stats
for
node
in
self
.
nodes
.
values
()]
...
...
@@ -156,7 +155,6 @@ class Network:
return
stats
class
Packet
:
"""
An item to route through the network.
"""
...
...
@@ -409,6 +407,7 @@ class Node:
@property
def
stats
(
self
):
"""
Return node statistics.
"""
return
dict
(
self
.
_stats
)
def
__repr__
(
self
):
...
...
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