Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
185 commits
Select commit Hold shift + click to select a range
9fe7daa
check
Marco-Gottardis Feb 16, 2020
05562cd
Merge pull request #1 from Marco-Gottardis/Marco
Dan8991 Feb 16, 2020
9cf0c7a
Create DTN.ipynb
casarinnicola Feb 17, 2020
d029bb4
Merge pull request #2 from casarinnic/Nicola
Dan8991 Feb 17, 2020
c932230
[Change]moved code to another file and removed useless for cycles
Dan8991 Feb 17, 2020
1fe4fe4
[Add]jupyter stuff
Dan8991 Feb 17, 2020
9706289
Update DTN.ipynb
casarinnicola Feb 18, 2020
8371bb7
Update DTN.ipynb
casarinnicola Feb 18, 2020
fa52f8d
Update DTN.ipynb
casarinnicola Feb 18, 2020
b546287
Merge branch 'Nicola2' into Nicola
casarinnicola Feb 18, 2020
5dab06a
Update Project.ipynb
casarinnicola Feb 18, 2020
ceb7765
Update Project.ipynb
casarinnicola Feb 18, 2020
8eb336b
Merge pull request #3 from casarinnic/Nicola
Dan8991 Feb 18, 2020
a69647d
[Patch]resolved conflicts
Dan8991 Feb 17, 2020
578d2ba
[Add]utility functions for modified Dijkstra algorithm
Dan8991 Feb 17, 2020
872c170
[Add]Dijkstra algorithm
Dan8991 Feb 17, 2020
922022b
[Change]now Djikstra returns just the next hop and the arrival time
Dan8991 Feb 17, 2020
1cbeca8
[Add]comments
Dan8991 Feb 17, 2020
eb95e94
[Patch]fixed some problems
Dan8991 Feb 18, 2020
3dbdb80
[Change]cells order
Dan8991 Feb 18, 2020
cf16897
[Patch]slices from float to int
Dan8991 Feb 18, 2020
64369b4
Implemented delay function
Marco-Gottardis Feb 18, 2020
ea1fb72
Update Project.ipynb
casarinnicola Feb 18, 2020
af2c179
issue #4
casarinnicola Feb 19, 2020
12f0b4e
resolved conflicts
Marco-Gottardis Feb 19, 2020
1f7e5e2
add the packet class
Dan8991 Feb 19, 2020
3081428
[Add]get_queues function
Dan8991 Feb 19, 2020
869c436
[Add]added the Node class
Dan8991 Feb 19, 2020
9f72056
[Add]routing algorithm
Dan8991 Feb 19, 2020
6e92825
commented the function and fixed the test
Marco-Gottardis Feb 19, 2020
914f752
moved the comments and deleted the useless file
Marco-Gottardis Feb 19, 2020
76f90d1
Merge pull request #5 from Marco-Gottardis/Marco
Dan8991 Feb 19, 2020
b741c3a
ipynb checkpoin added
casarinnicola Feb 19, 2020
4d1f2f7
[Patch]fixed some problems
Dan8991 Feb 19, 2020
4073ea7
[Conficts]fixed merge conflicts
Dan8991 Feb 19, 2020
770433b
Conflicts solved
casarinnicola Feb 19, 2020
2a0137f
Merge branch 'Group12-2' into Nicola
casarinnicola Feb 19, 2020
7658acf
[Delete]removed ipynb checkpoints since they are useless
Dan8991 Feb 19, 2020
4228a49
[Add]fixed typo in .gitignore file
Dan8991 Feb 19, 2020
e13aa67
Update Project.ipynb
casarinnicola Feb 19, 2020
e9b74e8
[Patch]fixed non existing previous node
Dan8991 Feb 19, 2020
bbaadb1
[Add]fixing conflicts
Dan8991 Feb 19, 2020
21f5f2c
Update project.ipynb
casarinnicola Feb 19, 2020
df52fee
[Test]
Dan8991 Feb 19, 2020
217e6d6
Merge branch 'Group12-2' into Nicola
casarinnicola Feb 19, 2020
9804135
Update Project.ipynb
casarinnicola Feb 19, 2020
f37e6b9
Merge pull request #7 from casarinnic/Nicola
Dan8991 Feb 19, 2020
9d0d4e7
[Add]fixed problems
Dan8991 Feb 19, 2020
d45ecb7
implemented pkt_plot function and its test
Marco-Gottardis Feb 19, 2020
a859cc2
[Patch]now the routing algortihm is working properlu
Dan8991 Feb 19, 2020
7b9989a
[Add]comments to explain the code
Dan8991 Feb 19, 2020
a72311c
Update Project.ipynb
casarinnicola Feb 20, 2020
0d616c9
Revert "Update Project.ipynb"
casarinnicola Feb 20, 2020
881cddc
Update Project.ipynb
casarinnicola Feb 20, 2020
113d11e
Merge pull request #9 from casarinnic/Nicola
Dan8991 Feb 20, 2020
c45a24d
[Conflicts]fixed conflicts
Dan8991 Feb 20, 2020
bc747f4
fixed conflicts
Marco-Gottardis Feb 20, 2020
ea84eb9
Merge pull request #8 from Marco-Gottardis/Marco
Dan8991 Feb 20, 2020
a9b6712
[Conflicts]fixed pull request #8
Dan8991 Feb 20, 2020
2906738
implemented and tested deviations and throughput functions
Marco-Gottardis Feb 20, 2020
c15d4fb
deleted useless file
Marco-Gottardis Feb 20, 2020
0a7b52e
Update Project.ipynb
casarinnicola Feb 21, 2020
8dda7be
Update Project.ipynb
casarinnicola Feb 21, 2020
9a327d5
Merge pull request #11 from casarinnic/Nicola
Dan8991 Feb 21, 2020
013bed9
[Add]greedy algorithm presentation
Dan8991 Feb 21, 2020
9d04186
fixed conflicts
Marco-Gottardis Feb 21, 2020
db58aae
Merge pull request #10 from Marco-Gottardis/Marco
Dan8991 Feb 21, 2020
67f2402
[Coflict]fixed different version
Dan8991 Feb 21, 2020
e9ee244
[Patch]forgot to remove one part of the conflict
Dan8991 Feb 21, 2020
74dc406
[Patch]run the notebook to fix a small problem
Dan8991 Feb 21, 2020
7f7d136
[Add]function controlling that nodes are not isolated and the routing…
Dan8991 Feb 21, 2020
6abe460
executed the notebooks
Dan8991 Feb 21, 2020
796bbac
[Change]improved the efficientcy of the routing algorithm
Dan8991 Feb 21, 2020
731de92
define varaiable
marty2697 Feb 21, 2020
15ca8cd
propagation function
marty2697 Feb 21, 2020
646b754
Update Project.ipynb
casarinnicola Feb 22, 2020
4ddea9a
check the link function
marty2697 Feb 22, 2020
587ad65
arrive_function
marty2697 Feb 22, 2020
67d8f1f
set vulnerable_time function
marty2697 Feb 22, 2020
46bcfcf
check the possible collision
marty2697 Feb 22, 2020
e9b9e00
send the packets to other nodes
marty2697 Feb 22, 2020
5e04ce2
send the packets to earth
marty2697 Feb 22, 2020
38b5d2e
add cicle for in order to ruin algorithm
marty2697 Feb 22, 2020
bfe3f5a
[Change]moved functions inside other files in order to tidy up the pr…
Dan8991 Feb 22, 2020
9111542
[Delete]removed __pycache__ files
Dan8991 Feb 22, 2020
afaf377
Added the first part of the introduction
Marco-Gottardis Feb 22, 2020
aeacce6
Merge pull request #12 from marty2697/Martina
Dan8991 Feb 22, 2020
52ebe85
[Change]improved some implementations
Dan8991 Feb 22, 2020
5c00939
[Change] fixed small bug and improved if statements
Dan8991 Feb 22, 2020
76609a9
[Delete]removed unnecessary dimension for the vulnerable time
Dan8991 Feb 22, 2020
8a508d3
[Change]fixed small typos
Dan8991 Feb 22, 2020
4f88183
[Change]improved some if statements
Dan8991 Feb 22, 2020
b93028a
[Delete] == True and == False as they are not needed
Dan8991 Feb 22, 2020
970f2cc
[Change]used more human readable names
Dan8991 Feb 22, 2020
8b3c332
[Change]rewritten the return statement of is_collision
Dan8991 Feb 22, 2020
68c2ccf
[Change]no function from epidemics uses global inputs
Dan8991 Feb 22, 2020
187858f
[Change]finished restyling for epidemic code
Dan8991 Feb 22, 2020
84851d4
Merge pull request #13 from Marco-Gottardis/Marco
Dan8991 Feb 22, 2020
c142955
Merge branch 'Marco' into Group12
Dan8991 Feb 22, 2020
3903709
[Add]fixed conflicts
Dan8991 Feb 22, 2020
de3fdbe
[Conflicts]fixed merge conflicts
Dan8991 Feb 22, 2020
a59b00f
[Add]epidemics file
Dan8991 Feb 22, 2020
f6af0a9
[Change]run notebook
Dan8991 Feb 22, 2020
ebeb40a
Update Project.ipynb
casarinnicola Feb 22, 2020
699f4bb
[Add]implemented test on the e2e delay if the ttr is increased
Dan8991 Feb 24, 2020
5ec3adb
[Change]moved the seed outside the function because the produced matr…
Dan8991 Feb 24, 2020
972e9df
[Conflicts]
Dan8991 Feb 24, 2020
0955041
[Add]testing performance if increasing the load
Dan8991 Feb 24, 2020
7e87d5b
Update Project.ipynb
casarinnicola Feb 25, 2020
acb6517
[Add]plotted the number of packet passing for each node
Dan8991 Feb 25, 2020
e7cd725
Merge pull request #15 from casarinnic/Nicola
Dan8991 Feb 25, 2020
0c026b6
fixed conflicts
Dan8991 Feb 25, 2020
4bf9830
Added color feature on pkt_plot
Marco-Gottardis Feb 25, 2020
07d7142
Update Project.ipynb
casarinnicola Feb 25, 2020
c08208a
Merge pull request #16 from casarinnic/Nicola
Dan8991 Feb 26, 2020
596f158
[Merge]solved conflicts
Dan8991 Feb 26, 2020
3755a93
Fixed conflicts
Marco-Gottardis Feb 26, 2020
512a93e
[Add]graphs of different values as some constraints varies
Dan8991 Feb 26, 2020
588904d
[Add]improved markdown presentation
Dan8991 Feb 26, 2020
8c9e036
Added assumptions in the intro
Marco-Gottardis Feb 26, 2020
a715e64
[Change]improved plots for transmission time changes
Dan8991 Feb 26, 2020
9d090d5
Merge pull request #17 from Marco-Gottardis/Marco
Dan8991 Feb 26, 2020
b80b90c
[Add]fixed plots
Dan8991 Feb 26, 2020
afe505e
add description
marty2697 Feb 27, 2020
9739a9a
Merge pull request #18 from marty2697/Martina
Dan8991 Feb 27, 2020
6e98424
[Add]improved plots for greedy routing
Dan8991 Feb 27, 2020
f6a338e
[Merge]fixed conflicts
Dan8991 Feb 27, 2020
c9ad8fa
[Change]moved epidemic function to the epidemic file
Dan8991 Feb 27, 2020
074b887
[Add]plot of arrival time variation as packet number varies
Dan8991 Feb 27, 2020
3242020
[Add]plotting the percentage of packets
Dan8991 Feb 28, 2020
6e53103
[Delete]image
Dan8991 Feb 28, 2020
6886207
[Merge]conflicts
Dan8991 Feb 28, 2020
e65fcf8
[Change]slightly improved performance
Dan8991 Feb 28, 2020
31c2c32
[Change]improved the efficiency of the algorithm
Dan8991 Feb 28, 2020
0629db4
[Merge]conflicts
Dan8991 Feb 28, 2020
f254b97
some small corrections
Marco-Gottardis Mar 1, 2020
44ad945
corrected some typos
Marco-Gottardis Mar 1, 2020
9813986
Added markdown with result interpretation
Marco-Gottardis Mar 1, 2020
83a832c
Merge pull request #20 from Marco-Gottardis/Marco
Dan8991 Mar 2, 2020
feae5be
[Add]improved plots
Dan8991 Mar 2, 2020
438b286
[Change]improved graphs
Dan8991 Mar 2, 2020
0f0cd8a
colors on pkt_plot and a piece of markdown
Marco-Gottardis Mar 2, 2020
350a81c
Resolved conflicts
Marco-Gottardis Mar 2, 2020
991f82e
Merge pull request #21 from Marco-Gottardis/Marco
Dan8991 Mar 2, 2020
b5ceb44
show resultes
marty2697 Mar 3, 2020
8213063
graphicaly results
marty2697 Mar 3, 2020
f94d2d6
Merge pull request #22 from marty2697/Martina
Dan8991 Mar 4, 2020
04c9882
[Patch]fixed a bug that would cause collisions
Dan8991 Mar 4, 2020
a161e87
[Patch]fixed minor bugs
Dan8991 Mar 4, 2020
0eb8467
[Patch]fixed animation problem
Dan8991 Mar 4, 2020
698b46c
[Add]added the same return value as the one in greedy routing so it c…
Dan8991 Mar 4, 2020
aabfd01
Corrected all the markdown about the epidemic algorithm
Marco-Gottardis Mar 4, 2020
757ae28
Merge branch 'Group12' into Marco
Marco-Gottardis Mar 4, 2020
d1ad278
Markdown comparing modes
Marco-Gottardis Mar 6, 2020
5a69216
[Add]fixed small problem with animation
Dan8991 Mar 6, 2020
c213575
[Add]confrontation between the two algorithms
Dan8991 Mar 6, 2020
6b4c615
Added some markdowns
Marco-Gottardis Mar 6, 2020
477529a
Update Project.ipynb
casarinnicola Mar 6, 2020
c43eabb
Update Project.ipynb
casarinnicola Mar 6, 2020
0849059
Update Project.ipynb
casarinnicola Mar 6, 2020
54f3461
Merge pull request #19 from casarinnic/Nicola
Dan8991 Mar 7, 2020
8e4c319
[Merge]fixed conflicts
Dan8991 Mar 7, 2020
c4c6149
[Add]comments
Dan8991 Mar 7, 2020
f288f63
Added other markdowns
Marco-Gottardis Mar 8, 2020
6c489fc
[Patch]light and unstable mode had different deactivation times so so…
Dan8991 Mar 10, 2020
36164e6
Added other markdowns
Marco-Gottardis Mar 11, 2020
1f54d7e
Merge pull request #23 from Marco-Gottardis/Marco
Dan8991 Mar 12, 2020
2c1af5f
[Add]various markdown descriptions about obtained results
Dan8991 Mar 13, 2020
b658f2d
[Change]removed control ifs
Dan8991 Mar 13, 2020
4a17615
[Add]executed notebook
Dan8991 Mar 13, 2020
88235d9
Corrections on all the markdowns
Marco-Gottardis Mar 14, 2020
befee79
Merge pull request #24 from Marco-Gottardis/Marco
Dan8991 Mar 14, 2020
eed6ec6
Create animation_utilities.py
casarinnicola Mar 15, 2020
cc05f76
Restyling
casarinnicola Mar 24, 2020
888981b
Update graphics.py
casarinnicola Mar 24, 2020
f50a0e5
Update Project.ipynb
casarinnicola Mar 24, 2020
0e39883
Update Project.ipynb
casarinnicola Mar 24, 2020
c9c4cf7
Update Project.ipynb
casarinnicola Mar 24, 2020
53ef7f0
Merge pull request #25 from casarinnic/Nicola
Dan8991 Mar 25, 2020
ec193ac
[Add]Small changes on some descriptions and plots
Dan8991 Mar 26, 2020
ee04c7b
[Add]final changes
Dan8991 Mar 26, 2020
908c420
[Add]animations registrations and fixed one plot
Dan8991 Mar 28, 2020
9cafa5b
[Add]modified legend
Dan8991 Mar 29, 2020
5a5fb26
[Add]slight change in markdown
Dan8991 Mar 30, 2020
a2605a3
[Add]changed colors
Dan8991 Apr 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.ipynb_checkpoints/
utility_functions/__pycache__
utility_functions/__pycache__/*
3,914 changes: 3,912 additions & 2 deletions Project.ipynb

Large diffs are not rendered by default.

Binary file added figures/dijkstra.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions figures/routing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added link.mp4
Binary file not shown.
2 changes: 1 addition & 1 deletion members.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Surname Name
Gottardis Marco
Gottardis Marco eccomi!
Mari Daniele
Casarin Nicola
Camaioni Martina
Binary file added nodes.mp4
Binary file not shown.
Binary file added packets.mp4
Binary file not shown.
72 changes: 72 additions & 0 deletions utility_functions/animation_utilities.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import collections as mc
import mpl_toolkits.mplot3d.axes3d as p3
import matplotlib.animation as animation

#returns a list of active links
def get_links(A,nodes):
n = A.shape[0]
return [np.array([nodes[i],nodes[j]]).T for i in range(n) for j in range(i+1) if A[i,j]!=np.inf]

#checks if a link is active
def check_active(link, link_list):
for x in link_list:
if np.array_equal(x, link):
return True
return False

def update_lines(num, dataLines, lines, active_links, title) :

title.set_text("Time = {}s".format(num))

for line, data in zip(lines, dataLines) :
line.set_data(data[0:2, :])
line.set_3d_properties(data[2, :])
line.set_color("black")
if not check_active(data, active_links[num]):
line.set_color("red")
return lines

def get_vel(node1, node2, c=3e8):
diff = node2 - node1
dist = np.linalg.norm(diff)
time = dist/c
vel = diff/time
return vel

def update_graph(num,graph,coord,coord_nodes,start_times,arrival_times,step,n_pkt,vel,path,done,title,speed=3):

time = num * speed

for i in range(n_pkt):
if done[i]:
continue

start = start_times[i][step[i]]
end = arrival_times[i][step[i]]

if time < start:
status = "waiting"
elif start <= time <= end:
status = "midair"
elif time > end:
status = "arrived"

if status == "midair":
coord[i,:] = coord[i,:] + vel[i,:] * speed
elif status == "waiting":
pass
elif status == "arrived":
try:
step[i] += 1
vel[i,:] = get_vel(coord_nodes[path[i][step[i]],:], coord_nodes[path[i][step[i]+1],:])
start = start_times[i][step[i]]
end = arrival_times[i][step[i]]
except IndexError: #no more steps
done[i] = True


graph._offsets3d = (coord[:,0],coord[:,1],coord[:,2])
title.set_text("Time = {}s".format(num))
36 changes: 36 additions & 0 deletions utility_functions/classes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
class Packet():

def __init__(self, index ,destination):

#final destination of the packet
self.destination = destination

#arrival time at the next hop
self.arrival_time = -1

#index of the next hop
self.next_hop = -1

#index that identifies the packet, used for debugging purposes
self.id = index

#starting node
self.source = -1

self.route = []

self.arrival_times = []

#function that is called when str(packet) is called
def __str__(self):
return f"id: {self.id}, next hop: {self.next_hop}, destination: {self.destination}"

class Node():

def __init__(self, packets, index):

#queue of the packets
self.packets = packets

#index of the node
self.id = index
Loading