ema workbench

Table Of Contents

Other Sub Sites

Excel

Created on 19 sep. 2011

Code author: jhkwakkel <j.h.kwakkel (at) tudelft (dot) nl>

This module provides a base class that can be used to perform EMA on Excel models. It relies on win32com

ExcelModelStructureInterface

class excel.ExcelModelStructureInterface(workingDirectory, name)

Base class for connecting the EMA workbench to models in Excel. To automate this connection as much as possible. This implementation relies on naming cells in Excel. These names can then be used here as names for the uncertainties and the outcomes. See e.g. this site for details on naming cells and sets of cells.

The provided implementation here does work with ParallelEMA.

xl

Reference to the Excel application. This attribute is None untill model_init has been invoked.

wb

Reference to the workbook. This attribute is None untill model_init has been invoked.

sheet

Name of the sheet on which one want to set values

workbook

relative path to workbook

model_init(policy, kwargs)
Parameters:
  • policy – policy to be run, in the default implementation, this argument is ignored. Extent model_init() to specify how this argument should be used.
  • kwargs – keyword arguments to be used by model_init()
run_model(case)

Method for running an instantiated model structures. This implementation assumes that the names of the uncertainties correspond to the name of the cells in Excel. See e.g. this site for details or use Google and search on ‘named range’. One of the requirements on the names is that the cannot contains spaces.

For the extraction of results, the same approach is used. That is, this implementation assumes that the name of a Outcome instance corresponds to the name of a cell, or set of cells.

Parameters:case – dictionary with arguments for running the model
reset_model()

Method for reseting the model to its initial state before runModel was called

cleanup()

cleaning up prior to finishing performing experiments. This will close the workbook and close Excel.