-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpop_with_oppositors.py
More file actions
44 lines (29 loc) · 1.1 KB
/
Copy pathpop_with_oppositors.py
File metadata and controls
44 lines (29 loc) · 1.1 KB
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
42
43
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 15 20:19:36 2020
@author: qtckp
"""
import sys
sys.path.append('..')
import numpy as np
from OppOpPopInit import init_population, SampleInitializers, OppositionOperators, set_seed
from OppOpPopInit.plotting import plot_pop_op
set_seed(1)
min_bound = np.array([-38, -1])
max_bound = np.array([16, 100])
kwargs = dict(minimums = min_bound, maximums=max_bound)
for i in range(3):
creator = SampleInitializers.Normal(**kwargs)
oppositors = [
OppositionOperators.Continual.over(**kwargs),
OppositionOperators.Continual.quasi(**kwargs),
OppositionOperators.Continual.abs(**kwargs)
]
points = init_population(samples_count=20*(i+1), creator= creator, oppositors = oppositors)
plot_pop_op(points,
names = ['over reflection', 'quasi reflection', 'abs reflection'],
bounds = np.vstack((min_bound-1, max_bound+1)).T,
title = "Population with oppositions",
net = False,
save_as = f'./output/pop_with_op{i+1}.png'
)