-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathModels.py
executable file
·43 lines (33 loc) · 1.09 KB
/
Models.py
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
41
#---- Particle representation
class ParticleModel:
_position = None
_velocity = None
_bestPosition = None
_nbBestPosition = None
_fitness = None
def __init__(self):
self._position = None
self._velocity = None
self._bestPosition = None
self._nbBestPosition = None
self._fitness = None
#---- Swarm representation
class SwarmModel:
_particles = None
_neighbourhoods = None
_bestPosition = None
_bestPositionFitness = None
def __init__(self):
self._particles = []
self._neighbourhoods = None
self._bestPosition = None
self._bestPositionFitness = None
#---- Neighbourhood representation
class NeighbourhoodModel:
_particles = []
_bestPosition = None
_bestPositionFitness = None
def __init__(self, particles):
self._particles = particles
self._bestPosition = None
self._bestPositionFitness = None