Skip to content
Snippets Groups Projects
Commit 9809d610 authored by abaucher's avatar abaucher
Browse files

Added get_scenario and completed limits to growth until scenario 5

parent d5d90cd7
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -7,7 +7,7 @@ from pydynamo.core.parse_system import new_cst_politic, new_table_politic, new_s
from pydynamo.core.plot_system import *
# import pydynamo.core.dynamo_converter
from pydynamo.core import psdsystem
from .world3 import w3_code, w3_defs, plot_world_03, plot_world_with_scales, var_color
from .world3 import w3_code, w3_defs, plot_world_03, plot_world_with_scales, var_color, scenarios
from .world2 import w2_code, w2_defs, scales_w2
......@@ -23,3 +23,12 @@ def get_w2():
def plot_w2(w2, title=''):
plot_system(w2, scales_w2, scales=scales_w2, title=title)
def get_scenario(number):
w3s = get_w3()
changes = scenarios[number]['changes']
for c, v in changes.items():
setattr(w3s, c, v)
return w3s
......@@ -30,7 +30,7 @@ def plot_system(s, v_names=None, rescale=False, com=True, filter_no=None, scales
if rescale:
plt.ylabel('Rescaled values')
plt.xlabel('Time')
plt.legend()
plt.legend(loc='center left')
plt.title(title)
def show_pyvis(s, init_val=True, notebook=False, options=None, highlight=None, colors=None):
......
......@@ -3,6 +3,7 @@ __version__ = "0.1"
from .plot_utils import plot_world_with_scales, plot_world_03
from .infos import get_sectors, get_definitions
from .infos.get_sectors import sector_color
from .scenarios_limits_to_growth import scenarios
import os
import json
......@@ -19,6 +20,7 @@ for var in var_sector:
var_color = {v: sector_color[sector] for v, sector in var_sector.items()}
"""
code_file = 'world3/code/limits_to_growth_pydynamo_code.py'
code_file_72 = 'world3/code/limits_to_growth_pydynamo_code_72.py'
......
scenarios = [
{
'title': 'Scenario #1: Business as usual',
'changes': {}
},
{
'title': 'Scenario #2: double -- and more accessible -- non-renewable resources',
'changes': {
'fcaortm': 2002,
'nri': 2000000000000.0,
'fcaor2t': [1.0, 0.1, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05],
}
},
{
'title': 'Scenario #3: Scenario #2 plus pollution technology advancing from 2002',
'changes': {
'pyear': 2002,
'pptcmt': [-0.04, 0],
'fcaortm': 2002,
'nri': 2000000000000.0,
'fcaor2t': [1.0, 0.1, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05],
}
},
{
'title': 'Scenario #4: Scenario #3 plus yield technology advancing from 2002',
'changes': {
'pyear': 2002,
'lytcrmt': [0, 0.04],
'pptcmt': [-0.04, 0],
'fcaortm': 2002,
'nri': 2000000000000.0,
'fcaor2t': [1.0, 0.1, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05],
}
},
{
'title': 'Scenario #5: Scenario #4 plus erosion control advancing from 2002',
'changes': {
'fcaortm': 2002,
'lytcrmt': [0, 0.04],
'llmytm': 2002,
'fcaor2t': [1.0, 0.1, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05],
'pyear': 2002,
'nri': 2000000000000.0,
'pptcmt': [-0.04, 0]
}
},
{
'title': 'Scenario #6: Scenario #5 plus resource technology advancing from 2002',
'changes': {
'fcaortm': 2002,
'lytcrmt': [0, 0.04],
'llmytm': 2002,
'fcaor2t': [1.0, 0.1, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05],
'rtcmt': [0.04, 0.0],
'pyear': 2002,
'nri': 2000000000000.0,
'pptcmt': [-0.04, 0],
'pyear': 2002,
}
},
{
'title': 'Scenario #7: is Scenario #2 plus population policies from 2002',
'changes': {
'zpgt': 2002,
'fcest': 2002,
'nri': 2000000000000.0,
}
},
{
'title': 'Scenario #8: Scenario #7 plus a fixed goal for industrial output per capita from 2002, and 25 % longer life of capital',
'changes': {
'iopcd': 350,
'fcest': 2002,
'iet': 2002,
'alsc2': 25,
'alai2': 2.5,
'alic2': 18,
'pyear': 2002,
'nri': 2000000000000.0,
'zpgt': 2002
}
},
{
'title': 'Scenario #9: Scenario #8 \nplus resource -, pollution -, and yield – technologies\n and erosion control advancing from 2002',
'changes': {
'lytcrmt': [0, 0.04],
'llmytm': 2002,
'iopcd': 350,
'fcest': 2002,
'iet': 2002,
'rtcmt': [0.04, 0.0],
'alsc2': 25,
'alai2': 2.5,
'alic2': 18,
'pyear': 2002,
'nri': 2000000000000.0,
'pptcmt': [-0.04, 0],
'zpgt': 2002
}
},
{
'title': 'Scenario #10: Scenario #9 with policy implementation 20 years earlier, in 1982',
'changes': {
'lytcrmt': [0, 0.04],
'llmytm': 1982,
'iopcd': 350,
'fcest': 2002,
'iet': 1982,
'rtcmt': [0.04, 0.0],
'alsc2': 25,
'alai2': 2.5,
'alic2': 18,
'pyear': 1982,
'nri': 2000000000000.0,
'pptcmt': [-0.04, 0],
'zpgt': 2002
}
},
{
'title': 'Scenario #11: Scenario #9 with policy implementation 10 years later, in 2012:',
'changes': {
'lytcrmt': [0, 0.04],
'llmytm': 2012,
'iopcd': 350,
'fcest': 2002,
'iet': 2012,
'rtcmt': [0.04, 0.0],
'alsc2': 25,
'alai2': 2.5,
'alic2': 18,
'pyear': 2012,
'nri': 2000000000000.0,
'pptcmt': [-0.04, 0],
'zpgt': 2002
}
}
]
fils = [[1, 2, 3, 4, 5], [2, 7, 8, 9], [9, 10], [9, 11]]
obs = [
"À mesure que les ressources s'épuisent, une part beaucoup plus grande des investissements industriels doit être alouée à leur extraction, et les investissements deviennent alors insuffisants, ce qui enclenche la boucle de rétroaction d'effondrement du capital industriel.",
"La pollution générée par l'agriculture",
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment