Various functions.
More...
|
def | decrease (x, M, Selection) |
| Computes a decreasing function of x in [0,M] which sums to 1 1/(x+M) normalized for x in [0,M]. More...
|
|
def | chances (proba, N) |
| computes what one gets from a maximum of N with probability proba More...
|
|
def | uniform (proba, Max=1) |
| computes random uniform variable between 0 and Max More...
|
|
def | fortune_wheel (Probabilities) |
| draws one one the pie shares y picking a location uniformly More...
|
|
def | percent (x) |
|
def | noise_mult (x, range_) |
| returns x affected by a multiplicative uniform noise between 1-range_/100 and 1+range_/100 More...
|
|
def | noise_add (x, range_) |
| returns x affected by an additive uniform noise between -range_ and range_ More...
|
|
def | transpose (Matrix) |
| groups ith items in each list of Matrix More...
|
|
def | Nb2A (Nb) |
| converts a number into letters - Useful to list files in correct order More...
|
|
def | Nb2A0 (Nb) |
| converts a number into a padded string More...
|
|
def | Polygon (x, Points=()) |
| computes a polygon function crossing all points in Points More...
|
|
def | FileAnalysis (FileName, Pattern, Flag=re.M) |
| Analyses the content of a file and returns all matching occurrences of Pattern. More...
|
|
def | List2File (L, FileName) |
| Saves a list of strings into a file. More...
|
|
def | error (ErrMsg, Explanation='') |
|
def | warning (WMsg, Explanation='') |
|
def | boost () |
|
|
| GrayTable = EvolifeGray.GrayCode() |
|
| P = Parameters('../Evolife.evo') |
|
int | M = 10 |
|
| S = P.Parameter('Selectivity') |
|
◆ boost()
def Evolife.Tools.Tools.boost |
( |
| ) |
|
◆ chances()
def Evolife.Tools.Tools.chances |
( |
|
proba, |
|
|
|
N |
|
) |
| |
computes what one gets from a maximum of N with probability proba
Definition at line 62 of file Tools.py.
◆ decrease()
def Evolife.Tools.Tools.decrease |
( |
|
x, |
|
|
|
M, |
|
|
|
Selection |
|
) |
| |
Computes a decreasing function of x in [0,M] which sums to 1 1/(x+M) normalized for x in [0,M].
Definition at line 32 of file Tools.py.
◆ error()
def Evolife.Tools.Tools.error |
( |
|
ErrMsg, |
|
|
|
Explanation = '' |
|
) |
| |
◆ FileAnalysis()
def Evolife.Tools.Tools.FileAnalysis |
( |
|
FileName, |
|
|
|
Pattern, |
|
|
|
Flag = re.M |
|
) |
| |
Analyses the content of a file and returns all matching occurrences of Pattern.
Definition at line 158 of file Tools.py.
◆ fortune_wheel()
def Evolife.Tools.Tools.fortune_wheel |
( |
|
Probabilities | ) |
|
draws one one the pie shares y picking a location uniformly
Definition at line 78 of file Tools.py.
◆ List2File()
def Evolife.Tools.Tools.List2File |
( |
|
L, |
|
|
|
FileName |
|
) |
| |
Saves a list of strings into a file.
Definition at line 167 of file Tools.py.
◆ Nb2A()
def Evolife.Tools.Tools.Nb2A |
( |
|
Nb | ) |
|
converts a number into letters - Useful to list files in correct order
Definition at line 127 of file Tools.py.
◆ Nb2A0()
def Evolife.Tools.Tools.Nb2A0 |
( |
|
Nb | ) |
|
converts a number into a padded string
Definition at line 135 of file Tools.py.
◆ noise_add()
def Evolife.Tools.Tools.noise_add |
( |
|
x, |
|
|
|
range_ |
|
) |
| |
returns x affected by an additive uniform noise between -range_ and range_
Definition at line 99 of file Tools.py.
◆ noise_mult()
def Evolife.Tools.Tools.noise_mult |
( |
|
x, |
|
|
|
range_ |
|
) |
| |
returns x affected by a multiplicative uniform noise between 1-range_/100 and 1+range_/100
Definition at line 91 of file Tools.py.
◆ percent()
def Evolife.Tools.Tools.percent |
( |
|
x | ) |
|
◆ Polygon()
def Evolife.Tools.Tools.Polygon |
( |
|
x, |
|
|
|
Points = () |
|
) |
| |
computes a polygon function crossing all points in Points
Definition at line 141 of file Tools.py.
◆ transpose()
def Evolife.Tools.Tools.transpose |
( |
|
Matrix | ) |
|
groups ith items in each list of Matrix
Definition at line 105 of file Tools.py.
◆ uniform()
def Evolife.Tools.Tools.uniform |
( |
|
proba, |
|
|
|
Max = 1 |
|
) |
| |
computes random uniform variable between 0 and Max
Definition at line 70 of file Tools.py.
◆ warning()
def Evolife.Tools.Tools.warning |
( |
|
WMsg, |
|
|
|
Explanation = '' |
|
) |
| |
◆ GrayTable
Evolife.Tools.Tools.GrayTable = EvolifeGray.GrayCode() |
int Evolife.Tools.Tools.M = 10 |
Evolife.Tools.Tools.P = Parameters('../Evolife.evo') |
Evolife.Tools.Tools.S = P.Parameter('Selectivity') |