-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClasses.py
More file actions
43 lines (34 loc) · 928 Bytes
/
Classes.py
File metadata and controls
43 lines (34 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
class antennes:
"""definition d'une antenne du reseau"""
def __init__(self, nom, type, x, y, voisins, capacite):
self.n = nom
self.t = type
self.x = x
self.y = y
self.v = voisins
self.c = capacite
"donne la position de l'antenne"
def pos(self):
return (self.x, self.y)
"donne le type de l'antenne"
def type(self):
return self.t
def name(self):
return self.n
def voisins(self):
return self.v
def couleurs(self):
if self.t == '3g':
return 'black'
if self.t == '4g':
return 'red'
if self.t == '5g':
return 'yellow'
"capactité en fonction des types d'antennes"
def capacite_max(self):
if self.t == '3g':
return 100
if self.t == '4g':
return 1000
if self.t == '5g':
return 10000