didppy.ElementTable

class didppy.ElementTable

Table of element constants.

t[index] returns an element expression referring to an item where t is ElementTable and index is a sequence of ElementExpr, ElementVar, ElementResourceVar, or int.

Examples

>>> import didppy as dp
>>> model = dp.Model()
>>> obj = model.add_object_type(number=2)
>>> var = model.add_element_var(object_type=obj, target=1)
>>> table = model.add_element_table({(0, 0, 0, 0): 1, (1, 1, 1, 1): 3}, default=2)
>>> table[0, var, 1, 0].eval(model.target_state, model)
2

Methods