Exemplo n.º 1
0
def get_params(_profile='BaselineHTHI'):
    _model = 'agent-based-model'
    camp = 'Moria'
    overrides = '{"numberOfIterations": 1, "nProcesses": 1}'
    facade = Facade.simple()
    params = create_params(facade.ps, _model, _profile, camp, overrides)
    return params
Exemplo n.º 2
0
import argparse
import logging
from enum import Enum
from ai4good.models.model_registry import get_models, create_params
from ai4good.models.model_registry import get_models
from ai4good.runner.facade import Facade
from ai4good.models.model import ModelResult


facade = Facade.simple()


def cache_info():

    def find_profile(m, c, rid):
        _mdl = get_models()[m](facade.ps)
        for p in facade.ps.get_profiles(m):
            params = create_params(facade.ps, m, p, c)
            res_id = _mdl.result_id(params)
            if res_id == rid:
                return p
        return None

    for m in get_models():
        cached_data = facade.rs.list(m)
        print(f"---- {m} ----")
        for cd in cached_data:
            rid = facade.rs.result_id_from_file_name(cd, m)
            mr: ModelResult = facade.rs.load(m, rid)
            p = mr.get('params')
            profile_info = find_profile(m, p.camp, rid)
Exemplo n.º 3
0
 def setUp(self) -> None:
     self.facade = Facade.simple()
     self.profile_df = self.facade.ps.get_params(CompartmentalModel.ID,
                                                 'baseline')
 def setUp(self) -> None:
     self.facade = Facade.simple()
     self.mdl = get_models()['compartmental-model'](self.facade.ps)