You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
709 B

  1. from . import storage
  2. from .storage import *
  3. class ModelInstantiator:
  4. def __init__(self, model):
  5. if model.model_type == ModelType.MDP:
  6. self._instantiator = PmdpInstantiator(model)
  7. elif model.model_type == ModelType.DTMC:
  8. self._instantiator = PdtmcInstantiator(model)
  9. elif model.model_type == ModelType.CTMC:
  10. self._instantiator = PctmcInstantiator(model)
  11. elif model.model_type == ModelType.MA:
  12. self._instantiator = PmaInstantiator(model)
  13. else:
  14. raise ValueError("Model type {} not supported".format(model.model_type))
  15. def instantiate(self, point):
  16. return self._instantiator.instantiate(point)