Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
geopat
geopat
Commits
03bfddb2
Commit
03bfddb2
authored
Mar 11, 2019
by
Dumoulin Nicolas
Browse files
python3 fixes
parent
e6050188
Changes
2
Hide whitespace changes
Inline
Side-by-side
scenariosAleatoires/proximite.py
View file @
03bfddb2
...
...
@@ -113,8 +113,8 @@ def proximite(shape, fruit_legumes, affichage) :
popBv
=
bv
[
x
][
0
]
nombre_bv
+=
1
if
affichage
==
True
:
print
print
x
print
()
print
(
x
)
#print
Sbv
=
(
total_culture
*
float
(
pourcentage_surface
[
3
])
/
100
*
popBv
/
Population_PAT
)
...
...
@@ -124,24 +124,24 @@ def proximite(shape, fruit_legumes, affichage) :
if
Sbv
-
surf_bv
<
0
:
indice_proximite
=
0
if
affichage
==
True
:
print
"Il y a trop de fruits/legumes dans ce bassin de vie"
print
(
"Il y a trop de fruits/legumes dans ce bassin de vie"
)
indice_proximite
=
indice_proximite
/
100
else
:
indice_proximite
=
(
Sbv
-
surf_bv
)
/
Sbv
*
100
if
affichage
==
True
:
print
"Il n'y a pas assez de fruits/légumes dans ce bassin de vie"
print
(
"Il n'y a pas assez de fruits/légumes dans ce bassin de vie"
)
total_diff
+=
indice_proximite
*
popBv
if
affichage
==
True
:
print
"Indice de proximité : "
+
str
(
indice_proximite
)
print
(
"Indice de proximité : "
+
str
(
indice_proximite
)
)
# Average of indices of each living area
diff_moyenne
=
total_diff
/
(
Population_PAT
)
# Near 0 -> good value, the nearest from 100, the baddest the value and baddest the repartition of fruits and vegetables is.
if
affichage
==
True
:
print
print
"Indice de proximité du scénario : "
+
str
(
diff_moyenne
)
+
"%"
print
()
print
(
"Indice de proximité du scénario : "
+
str
(
diff_moyenne
)
+
"%"
)
return
diff_moyenne
...
...
scenariosAleatoires/resilience_list.py
View file @
03bfddb2
...
...
@@ -69,10 +69,10 @@ def resilience(grille, layer_scenario, affichage):
if
pi
!=
0
:
H
+=
float
(
pi
*
math
.
log
(
pi
))
if
affichage
==
True
:
print
r
+
" : "
+
str
(
-
H
)
print
(
r
+
" : "
+
str
(
-
H
)
)
indice_resilience
+=
-
H
if
affichage
==
True
:
print
"Indice de résilience : "
+
str
(
indice_resilience
/
nombre_case
)
print
(
"Indice de résilience : "
+
str
(
indice_resilience
/
nombre_case
)
)
# The higher the indice, the better it is
return
indice_resilience
/
nombre_case
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment