Skip to content

Commit

Permalink
[net] init geant topology: vertices with 2D coord ok (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
cassiotbatista committed Jun 22, 2021
1 parent b0ca7cc commit 1248ef3
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rwa_wdm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

# network topology options
net.add_argument('-t', default='nsf', dest='topology',
choices=['nsf', 'clara', 'janet', 'rnp'],
choices=['nsf', 'clara', 'janet', 'rnp', 'geant'],
metavar='<topology>',
help='network topology')
net.add_argument('-c', type=int, default=8, dest='channels',
Expand Down
1 change: 1 addition & 0 deletions rwa_wdm/net/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
from .janet import JointAcademicNetwork
from .nsf import NationalScienceFoundation
from .rnp import RedeNacionalPesquisa
from .geant import GigabitEuropeanAcademic
# from .arpa import AdvancedResearchProjectsAgency
# from .italian import Italian
71 changes: 71 additions & 0 deletions rwa_wdm/net/geant.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
from typing import Dict, List, Tuple
from collections import OrderedDict

from . import Network


class GigabitEuropeanAcademic(Network):
"""Gigabit European Academic Network (GÉANT)"""

def __init__(self, ch_n):
self._name = 'geant'
self._fullname = u'Gigabit European Academic Network'
self._s = 3 # FIXME
self._d = 9 # FIXME
super().__init__(ch_n,
len(self.get_nodes_2D_pos()),
len(self.get_edges()))

def get_edges(self) -> List[Tuple[int, int]]:
"""get"""

return [ ] # FIXME

def get_nodes_2D_pos(self) -> Dict[str, Tuple[float, float]]:
"""Get position of the nodes on the bidimensional Cartesian plan"""

return OrderedDict([
('AL', (9.5, 3.2)), # 0 'ALBANIA',
('AM', (15.5, 3.1)), # 1 'ARMENIA',
('AT', (8.1, 5.1)), # 2 'AUSTRIA',
('AZ', (16.2, 3.1)), # 3 'AZERBAIJAN',
('BE', (5.9, 6.2)), # 4 'BELGIUM',
('BG', (10.8, 3.8)), # 5 'BULGARIA',
('BY', (11.3, 6.9)), # 6 'BELARUS',
('CH', (6.8, 4.8)), # 7 'SWITZERLAND',
('CY', (12.8, 1.5)), # 8 'CYPRUS',
('CZ', (8.2, 5.9)), # 9 'CZECH REPUBLIC',
('DE', (7.0, 6.0)), # 10 'GERMANY',
('DK', (7.0, 7.9)), # 11 'DENMARK',
('EE', (10.9, 8.8)), # 12 'ESTONIA',
('ES', (4.0, 3.0)), # 13 'SPAIN',
('FI', (11.0, 10.3)), # 14 'FINLAND',
('FR', (5.5, 4.9)), # 15 'FRANCE',
('GE', (15.0, 3.7)), # 16 'GEORGIA',
('GR', (10.2, 2.5)), # 17 'GREECE',
('HR', (8.9, 4.6)), # 18 'CROATIA',
('HU', (9.8, 5.0)), # 19 'HUNGARY',
('IE', (2.9, 6.9)), # 20 'IRELAND',
('IL', (13.1, 0.6)), # 21 'ISRAEL',
('IS', (0.6, 11.1)), # 22 'ICELAND',
('IT', (7.5, 4.0)), # 23 'ITALY',
('LT', (10.9, 7.5)), # 24 'LITHUANIA',
('LU', (6.2, 5.7)), # 25 'LUXEMBOURG',
('LV', (10.9, 8.1)), # 26 'LATVIA',
('MD', (11.7, 5.0)), # 27 'MOLDOVA',
('ME', (9.3, 3.7)), # 28 'MONTENEGRO',
('MK', (10.0, 3.3)), # 29 'MACEDONIA',
('MT', (8.2, 1.8)), # 30 'MALTA',
('NL', (6.0, 6.8)), # 31 'NETHERLANDS',
('NO', (6.5, 10.0)), # 32 'NORWAY',
('PL', (9.2, 6.5)), # 33 'POLAND',
('PT', (2.9, 3.0)), # 34 'PORTUGAL',
('RO', (11.1, 4.3)), # 35 'ROMANIA',
('RS', (9.7, 4.2)), # 36 'SERBIA',
('SE', (8.6, 9.5)), # 37 'SWEDEN',
('SI', (8.2, 4.6)), # 38 'SLOVENIA ',
('SK', (9.1, 5.5)), # 39 'SLOVAKIA',
('TR', (12.1, 3.0)), # 40 'TURKEY',
('UK', (4.4, 6.9)), # 41 'UNITED KINGDOM',
('UA', (11.8, 6.0)), # 42 'UKRAINE',
])

0 comments on commit 1248ef3

Please sign in to comment.