Example #1
0
"""
Created on 26 sep. 2011

@author: jhkwakkel
"""
import matplotlib.pyplot as plt

from expWorkbench import load_results
from analysis.graphs import envelopes

data = load_results(r"../../../src/analysis/1000 flu cases.cPickle")
fig = envelopes(data, column="policy")
plt.savefig("basicEnvelope.png", dpi=75)
def perform_experiments():
    logger = EMAlogging.log_to_stderr(level=EMAlogging.INFO)
    model = SalinizationModel(r"C:\eclipse\workspace\EMA-workbench\models\salinization", "verzilting")
    model.step = 4
    
    ensemble = SimpleModelEnsemble()
    ensemble.set_model_structure(model)

    policies=[{'name': 'no policy',
               'file': r'\verzilting 2.vpm'},
              {'name': 'policy group 8',
               'file': r'\group 8 best policy.vpm'},
              {'name': 'policy other group',
               'file': r'\other group best policy.vpm'},
              {'name': 'policies combined',
               'file': r'\best policies combined.vpm'}
              ]
    ensemble.add_policies(policies)
    
    ensemble.parallel = True
    nr_of_experiments = 1000
    results = ensemble.perform_experiments(nr_of_experiments)
    return results
        
if __name__ == "__main__":
    results = perform_experiments()
    fig = graphs.envelopes(results, column='policy')
    plt.show()
    save_results(results, 'salinization policys both groups.cPickle')
       
@author: jhkwakkel
'''
import numpy as np
import matplotlib.pyplot as plt

from expWorkbench import load_results
from analysis import prim
from expWorkbench import EMAlogging
from analysis.graphs import envelopes
EMAlogging.log_to_stderr(EMAlogging.INFO) 


results  = load_results(r'C:\workspace\EMA-workbench\models\TFSC_all_policies.cPickle')
envelopes(results, 
          column='policy', 
          categories=['adaptive policy',
                      'ap with op'])

#exp, res = results
#
##get out only the results related to the last policy
#exp, res = results
#
#logical = exp['policy'] == 'adaptive policy'
#exp = exp[logical]
#
#temp_res = {}
#for key, value in res.items():
#    temp_res[key] = value[logical]
#res = temp_res
#
Example #4
0
    #        if checkarray[i,-1]< 0.6:
    #            count +=1
    #
    #    print count

    #    envelopes(load_results(r'CESUN_4Policies_1000.cPickle'), outcomes=outcomes,
    #              column = 'policy',categories=['no policy',
    #                                            'basic policy',
    #                                            'adaptive policy',
    #                                            'optimized adaptive'],
    #              fill=True, categorieslabels= ['No Policy', 'Basic Policy',
    #                                   'Adaptive Policy',
    #                                   'Optimized Adaptive Policy'])
    #

    envelopes(results, outcomes=outcomes, column='policy', fill=True)

    plt.show()

#    import matplotlib
#
#    matplotlib.rc('font', weight='bold')
#    matplotlib.rc('font', size=14)
#
#
##    results = load_results(r'CESUN_optimized_1000.cPickle')
##
#    monitor1 = results[1]['monitor for Trigger subsidy T2']
#    monitor2 = results[1]['monitor for Trigger subsidy T3']
#    monitor3 = results[1]['monitor for Trigger subsidy T4']
#    monitor4 = results[1]['monitor for Trigger addnewcom']
#            count +=1
#    
#    print count
    
    
#    envelopes(load_results(r'CESUN_4Policies_1000.cPickle'), outcomes=outcomes, 
#              column = 'policy',categories=['no policy', 
#                                            'basic policy',
#                                            'adaptive policy',
#                                            'optimized adaptive'],
#              fill=True, categorieslabels= ['No Policy', 'Basic Policy',
#                                   'Adaptive Policy', 
#                                   'Optimized Adaptive Policy'])
#      
  
    envelopes(results, outcomes=outcomes, column = 'policy', fill=True)

    plt.show()

#    import matplotlib
#    
#    matplotlib.rc('font', weight='bold')
#    matplotlib.rc('font', size=14)
#    
#
##    results = load_results(r'CESUN_optimized_1000.cPickle')
##
#    monitor1 = results[1]['monitor for Trigger subsidy T2']
#    monitor2 = results[1]['monitor for Trigger subsidy T3']
#    monitor3 = results[1]['monitor for Trigger subsidy T4']
#    monitor4 = results[1]['monitor for Trigger addnewcom']
'''
Created on 26 sep. 2011

@author: jhkwakkel
'''
import matplotlib.pyplot as plt

from expWorkbench import load_results
from analysis.graphs import envelopes

data = load_results(r'../../../src/analysis/1000 flu cases.cPickle')
fig = envelopes(data, column='policy')
plt.savefig("basicEnvelope.png", dpi=75)
Example #7
0
'''
Created on 26 sep. 2011

@author: jhkwakkel
'''
import matplotlib.pyplot as plt

from expWorkbench import load_results
from analysis.graphs import envelopes

data = load_results(r'../../../src/analysis/1000 flu cases.cPickle')
fig = envelopes(data, column='policy')
plt.savefig("basicEnvelope.png", dpi=75)
'''
Created on 7 Sep 2011

@author: chamarat
'''
import matplotlib.pyplot as plt

from expWorkbench import load_results
from analysis.graphs import envelopes

results = load_results(r'.\data\TFSC_policies.cPickle')

fig = envelopes(results, column='policy', fill=True, legend=False)
fig = plt.gcf()
fig.set_size_inches(15,5)
plt.savefig("policycomparison.png", dpi=75)
Example #9
0
'''
Created on 26 sep. 2011

@author: jhkwakkel
'''
import matplotlib.pyplot as plt

from expWorkbench import load_results
from analysis.graphs import envelopes

data = load_results(r'../../../src/analysis/1000 flu cases.cPickle')
fig = envelopes(data, 
                column='policy', 
                categories=['static policy', 'adaptive policy'])
plt.show()
Example #10
0
'''
Created on 7 Sep 2011

@author: chamarat
'''
import matplotlib.pyplot as plt

from expWorkbench import load_results
from analysis.graphs import envelopes

results = load_results(r'.\data\TFSC_policies.cPickle')

fig = envelopes(results, column='policy', fill=True, legend=False)
fig = plt.gcf()
fig.set_size_inches(15, 5)
plt.savefig("policycomparison.png", dpi=75)